This documents an old version of bs::framework. Click here to see the latest release.
MeshBase Class Reference

Description

Base class all mesh implementations derive from.

Meshes hold geometry information, normally in the form of one or several index or vertex buffers. Different mesh implementations might choose to manage those buffers differently.

Note
Sim thread.

Inherits Resource.

Inherited by Mesh, and TransientMesh.

Methods

 MeshBase (UINT32 numVertices, UINT32 numIndices, DrawOperationType drawOp=DOT_TRIANGLE_LIST)
 Constructs a new mesh with no sub-meshes. More...
 
 MeshBase (UINT32 numVertices, UINT32 numIndices, const Vector< SubMesh > &subMeshes)
 Constructs a new mesh with one or multiple sub-meshes. More...
 
const MeshPropertiesgetProperties () const
 Returns properties that contain information about the mesh. More...
 
SPtr< ct::MeshBasegetCore () const
 Retrieves a core implementation of a mesh usable only from the core thread. More...
 
RTTITypeBasegetRTTI () const override
 Returns an interface you can use to access class' Run Time Type Information. More...
 
- Methods inherited from Resource
 Resource (bool requiresGpuInitialization=true)
 
const StringgetName () const
 Returns the name of the resource. More...
 
void setName (const String &name)
 Sets the name of the resource. More...
 
SPtr< ResourceMetaDatagetMetaData () const
 Retrieves meta-data containing various information describing a resource. More...
 
virtual bool allowAsyncLoading () const
 Returns whether or not this resource is allowed to be asynchronously loaded. More...
 
RTTITypeBasegetRTTI () const override
 Returns an interface you can use to access class' Run Time Type Information. More...
 
- Methods inherited from IReflectable
bool isDerivedFrom (RTTITypeBase *base)
 Returns true if current RTTI class is derived from base (Or if it is the same type as base). More...
 
UINT32 getTypeId () const
 Returns an unique type identifier of the class. More...
 
const StringgetTypeName () const
 Returns the type name of the class. More...
 
- Methods inherited from CoreObject
virtual void destroy ()
 Frees all the data held by this object. More...
 
virtual void initialize ()
 Initializes all the internal resources of this object. More...
 
bool isInitialized () const
 Returns true if the object has been initialized. More...
 
bool isDestroyed () const
 Returns true if the object has been destroyed. More...
 
void blockUntilCoreInitialized () const
 Blocks the current thread until the resource is fully initialized. More...
 
UINT64 getInternalID () const
 Returns an unique identifier for this object. More...
 
SPtr< CoreObjectgetThisPtr () const
 Returns a shared_ptr version of "this" pointer. More...
 
SPtr< ct::CoreObjectgetCore () const
 Returns an object that contains a core thread specific implementation of this CoreObject. More...
 
void syncToCore ()
 Ensures all dirty syncable data is send to the core thread counterpart of this object (if any). More...
 
void _setThisPtr (SPtr< CoreObject > ptrThis)
 Sets a shared this pointer to this object. More...
 

Static methods

static RTTITypeBasegetRTTIStatic ()
 
- Static methods inherited from Resource
static RTTITypeBasegetRTTIStatic ()
 
- Static methods inherited from IReflectable
static UnorderedMap< UINT32, RTTITypeBase * > & getAllRTTITypes ()
 Returns all available RTTI types. More...
 
static SPtr< IReflectablecreateInstanceFromTypeId (UINT32 rttiTypeId)
 Creates an empty instance of a class from a type identifier. More...
 
static void _registerRTTIType (RTTITypeBase *rttiType)
 Called by each type implementing RTTITypeBase, on program load. More...
 
static RTTITypeBase_getRTTIfromTypeId (UINT32 rttiTypeId)
 Returns class' RTTI type from type id. More...
 
static bool _isTypeIdDuplicate (UINT32 typeId)
 Checks if the provided type id is unique. More...
 
static void _checkForCircularReferences ()
 Iterates over all RTTI types and reports any circular references (for example one type having a field referencing another type, and that type having a field referencing the first type). More...
 
static RTTITypeBasegetRTTIStatic ()
 Returns an interface you can use to access class' Run Time Type Information. More...
 
- Static methods inherited from CoreObject
template<class T , class MemAlloc >
static void _delete (CoreObject *obj)
 Schedules the object to be destroyed, and then deleted. More...
 

Additional Inherited Members

- Protected Types inherited from CoreObject
enum  Flags { CGO_DESTROYED = 0x01, CGO_INIT_ON_CORE_THREAD = 0x02, CGO_INITIALIZED = 0x04 }
 Values that represent current state of the core object. More...
 

Method documentation

◆ getCore()

SPtr<ct::MeshBase> getCore ( ) const

Retrieves a core implementation of a mesh usable only from the core thread.

◆ getProperties()

const MeshProperties& getProperties ( ) const

Returns properties that contain information about the mesh.

◆ getRTTI()

RTTITypeBase* getRTTI ( ) const
overridevirtual

Returns an interface you can use to access class' Run Time Type Information.

Note

You must derive your own version of RTTITypeBase, in which you may encapsulate all reflection specific operations.

Implements IReflectable.

◆ syncToCore()

CoreSyncData syncToCore ( FrameAlloc allocator)
overrideprotectedvirtual

Ensures all dirty syncable data is send to the core thread counterpart of this object (if any).

Note
Call this if you have modified the object and need to make sure core thread has an up to date version. Normally this is done automatically at the end of a frame.
This is an asynchronous method.

Reimplemented from CoreObject.

Constructor & Destructor Documentation

◆ MeshBase() [1/2]

MeshBase ( UINT32  numVertices,
UINT32  numIndices,
DrawOperationType  drawOp = DOT_TRIANGLE_LIST 
)

Constructs a new mesh with no sub-meshes.

Parameters
[in]numVerticesNumber of vertices in the mesh.
[in]numIndicesNumber of indices in the mesh.
[in]drawOpDetermines how should the provided indices be interpreted by the pipeline. Default option is triangles, where three indices represent a single triangle.

◆ MeshBase() [2/2]

MeshBase ( UINT32  numVertices,
UINT32  numIndices,
const Vector< SubMesh > &  subMeshes 
)

Constructs a new mesh with one or multiple sub-meshes.

(When using just one sub-mesh it is equivalent to using the other overload).

Parameters
[in]numVerticesNumber of vertices in the mesh.
[in]numIndicesNumber of indices in the mesh.
[in]subMeshesDefines how are indices separated into sub-meshes, and how are those sub-meshes rendered.