SuperTuxKart
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
irr::scene::CBatchingMesh Class Reference
Inheritance diagram for irr::scene::CBatchingMesh:
Inheritance graph
[legend]

Classes

struct  SBufferReference
 
struct  SDestBufferReference
 
struct  SMaterialReference
 

Public Member Functions

bool isDirty (s32 id=-1)
 returns true if new buffers have been added without updating the internal buffers
 
void update ()
 refreshes the internal buffers from source
 
void clear ()
 drops all buffers and clears internal states
 
void finalize ()
 first updates the mesh, then drops all source buffers.
 
core::array< s32 > addMesh (IMesh *mesh, core::vector3df pos=core::vector3df(0, 0, 0), core::vector3df rot=core::vector3df(0, 0, 0), core::vector3df scale=core::vector3df(1, 1, 1))
 adds a mesh to the buffers with the given offset
 
core::array< s32 > addMesh (IMesh *mesh, const core::matrix4 &transform)
 adds a mesh with the given transformation
 
s32 addMeshBuffer (IMeshBuffer *buffer, core::vector3df pos=core::vector3df(0, 0, 0), core::vector3df rot=core::vector3df(0, 0, 0), core::vector3df scale=core::vector3df(1, 1, 1))
 adds a mesh buffer with the given transformation
 
s32 addMeshBuffer (IMeshBuffer *buffer, const core::matrix4 &transform)
 adds a mesh with the given transformation
 
void recalculateBoundingBox ()
 updates bouding box from internal buffers
 
core::array< bool > moveMesh (const core::array< s32 > &bufferIDs, const core::matrix4 &newMatrix)
 Moves a mesh,.
 
bool moveMeshBuffer (const s32 id, const core::matrix4 &newMatrix)
 Moves a mesh buffer.
 
IMeshBuffer * getSourceBuffer (s32 id)
 returns the source buffer, if available
 
core::matrix4 getSourceBufferMatrix (s32 id)
 returns the matrix of the source buffer
 
u32 getSourceBufferCount () const
 returns the number of source buffers
 
virtual u32 getMeshBufferCount () const
 Returns the amount of mesh buffers.
 
virtual IMeshBuffer * getMeshBuffer (u32 nr) const
 Returns pointer to a mesh buffer.
 
virtual IMeshBuffer * getMeshBuffer (const video::SMaterial &material) const
 Returns pointer to a mesh buffer which fits a material.
 
virtual const core::aabbox3d< f32 > & getBoundingBox () const
 Returns an axis aligned bounding box of the mesh.
 
virtual void setBoundingBox (const core::aabbox3df &box)
 set user axis aligned bounding box
 
virtual void setMaterialFlag (video::E_MATERIAL_FLAG flag, bool newvalue)
 Sets a flag of all contained materials to a new value.
 
virtual void setHardwareMappingHint (E_HARDWARE_MAPPING mapping, E_BUFFER_TYPE type)
 
virtual void setDirty (E_BUFFER_TYPE type)
 

Private Member Functions

void addSourceBuffer (IMeshBuffer *source)
 
void updateDestFromSourceBuffer (u32 id)
 
void recalculateDestBufferBoundingBox (u32 i)
 

Private Attributes

core::array< IMeshBuffer * > SourceBuffers
 Source mesh buffers, these are locked.
 
core::array< SBufferReferenceBufferReferences
 
core::array< SMaterialReferenceMaterialReferences
 
core::array< SDestBufferReferenceDestBuffers
 
core::aabbox3d< f32 > Box
 bounding containing all destination buffers
 
bool IsDirty
 does it require an update?
 
bool IsFinal
 can it be changed?
 

Member Function Documentation

◆ addMesh() [1/2]

core::array< s32 > irr::scene::CBatchingMesh::addMesh ( IMesh *  mesh,
const core::matrix4 &  transform 
)

adds a mesh with the given transformation

\Return: Returns an array of ID numbers

◆ addMesh() [2/2]

core::array< s32 > irr::scene::CBatchingMesh::addMesh ( IMesh *  mesh,
core::vector3df  pos = core::vector3df(0,0,0),
core::vector3df  rot = core::vector3df(0,0,0),
core::vector3df  scale = core::vector3df(1,1,1) 
)

adds a mesh to the buffers with the given offset

\Return: Returns an array of ID numbers

\Returns Returns an array of ID numbers

◆ addMeshBuffer() [1/2]

s32 irr::scene::CBatchingMesh::addMeshBuffer ( IMeshBuffer *  buffer,
const core::matrix4 &  transform 
)

adds a mesh with the given transformation

\Return Returns the ID of this mesh buffer

◆ addMeshBuffer() [2/2]

s32 irr::scene::CBatchingMesh::addMeshBuffer ( IMeshBuffer *  buffer,
core::vector3df  pos = core::vector3df(0,0,0),
core::vector3df  rot = core::vector3df(0,0,0),
core::vector3df  scale = core::vector3df(1,1,1) 
)

adds a mesh buffer with the given transformation

\Return: Returns the ID of this mesh buffer

\Return Returns the ID of this mesh buffer

◆ finalize()

void irr::scene::CBatchingMesh::finalize ( )

first updates the mesh, then drops all source buffers.

once this mesh has been finalized, it cannot be changed again!

◆ getBoundingBox()

const core::aabbox3d< f32 > & irr::scene::CBatchingMesh::getBoundingBox ( ) const
virtual

Returns an axis aligned bounding box of the mesh.

Returns
A bounding box of this mesh is returned.

◆ getMeshBuffer() [1/2]

IMeshBuffer * irr::scene::CBatchingMesh::getMeshBuffer ( const video::SMaterial &  material) const
virtual

Returns pointer to a mesh buffer which fits a material.

Parameters
materialmaterial to search for
Returns
Returns the pointer to the mesh buffer or NULL if there is no such mesh buffer.

◆ getMeshBuffer() [2/2]

IMeshBuffer * irr::scene::CBatchingMesh::getMeshBuffer ( u32  nr) const
virtual

Returns pointer to a mesh buffer.

Parameters
nrZero based index of the mesh buffer. The maximum value is getMeshBufferCount() - 1;
Returns
Returns the pointer to the mesh buffer or NULL if there is no such mesh buffer.

◆ getMeshBufferCount()

u32 irr::scene::CBatchingMesh::getMeshBufferCount ( ) const
virtual

Returns the amount of mesh buffers.

Returns
Returns the amount of mesh buffers (IMeshBuffer) in this mesh.

◆ moveMesh()

core::array< bool > irr::scene::CBatchingMesh::moveMesh ( const core::array< s32 > &  bufferIDs,
const core::matrix4 &  newMatrix 
)

Moves a mesh,.

Moves a mesh.

mesh buffers in clean destination buffers will be moved immediately, ones in dirty buffers will be left until the next update

◆ moveMeshBuffer()

bool irr::scene::CBatchingMesh::moveMeshBuffer ( const s32  id,
const core::matrix4 &  newMatrix 
)

Moves a mesh buffer.

if the destination buffer is clean it will be moved immediately, if a member of a dirty buffer, it will be left until the next update

◆ setMaterialFlag()

void irr::scene::CBatchingMesh::setMaterialFlag ( video::E_MATERIAL_FLAG  flag,
bool  newvalue 
)
virtual

Sets a flag of all contained materials to a new value.

Parameters
flagFlag to set in all materials.
newvalueNew value to set in all materials.

The documentation for this class was generated from the following files: