Irrlicht 3D Engine
irr::scene::CMeshBuffer< T > Class Template Reference

Template implementation of the IMeshBuffer interface. More...

#include <CMeshBuffer.h>

+ Inheritance diagram for irr::scene::CMeshBuffer< T >:

Public Member Functions

 CMeshBuffer ()
 Default constructor for empty meshbuffer. More...
 
virtual void append (const void *const vertices, u32 numVertices, const u16 *const indices, u32 numIndices)
 Append the vertices and indices to the current buffer. More...
 
virtual void append (const IMeshBuffer *const other)
 Append the meshbuffer to the current buffer. More...
 
virtual const core::aabbox3d< f32 > & getBoundingBox () const
 Get the axis aligned bounding box. More...
 
virtual u32 getChangedID_Index () const
 Get the currently used ID for identification of changes. More...
 
virtual u32 getChangedID_Vertex () const
 Get the currently used ID for identification of changes. More...
 
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index () const
 get the current hardware mapping hint More...
 
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex () const
 get the current hardware mapping hint More...
 
virtual u32 getIndexCount () const
 Get number of indices. More...
 
virtual video::E_INDEX_TYPE getIndexType () const
 Get type of index data which is stored in this meshbuffer. More...
 
virtual const u16getIndices () const
 Get pointer to indices. More...
 
virtual u16getIndices ()
 Get pointer to indices. More...
 
virtual const video::SMaterialgetMaterial () const
 Get material of this meshbuffer. More...
 
virtual video::SMaterialgetMaterial ()
 Get material of this meshbuffer. More...
 
virtual const core::vector3dfgetNormal (u32 i) const
 returns normal of vertex i More...
 
virtual core::vector3dfgetNormal (u32 i)
 returns normal of vertex i More...
 
virtual const core::vector3dfgetPosition (u32 i) const
 returns position of vertex i More...
 
virtual core::vector3dfgetPosition (u32 i)
 returns position of vertex i More...
 
virtual E_PRIMITIVE_TYPE getPrimitiveType () const
 Get the kind of primitive geometry which is used by the meshbuffer. More...
 
virtual const core::vector2dfgetTCoords (u32 i) const
 returns texture coord of vertex i More...
 
virtual core::vector2dfgetTCoords (u32 i)
 returns texture coord of vertex i More...
 
virtual u32 getVertexCount () const
 Get number of vertices. More...
 
virtual video::E_VERTEX_TYPE getVertexType () const
 Get type of vertex data stored in this buffer. More...
 
virtual const void * getVertices () const
 Get pointer to vertices. More...
 
virtual void * getVertices ()
 Get pointer to vertices. More...
 
virtual void recalculateBoundingBox ()
 Recalculate the bounding box. More...
 
virtual void setBoundingBox (const core::aabbox3df &box)
 Set the axis aligned bounding box. More...
 
virtual void setDirty (E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
 flags the mesh as changed, reloads hardware buffers More...
 
virtual void setHardwareMappingHint (E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
 set the hardware mapping hint, for driver More...
 
virtual void setPrimitiveType (E_PRIMITIVE_TYPE type)
 Describe what kind of primitive geometry is used by the meshbuffer. More...
 
- Public Member Functions inherited from irr::scene::IMeshBuffer
virtual u32 getPrimitiveCount () const
 Calculate how many geometric primitives are used by this meshbuffer. More...
 
- Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor. More...
 
virtual ~IReferenceCounted ()
 Destructor. More...
 
bool drop () const
 Drops the object. Decrements the reference counter by one. More...
 
const c8getDebugName () const
 Returns the debug name of the object. More...
 
s32 getReferenceCount () const
 Get the reference count. More...
 
void grab () const
 Grabs the object. Increments the reference counter by one. More...
 

Public Attributes

core::aabbox3d< f32BoundingBox
 Bounding box of this meshbuffer. More...
 
u32 ChangedID_Index
 
u32 ChangedID_Vertex
 
core::array< u16Indices
 Indices into the vertices of this buffer. More...
 
E_HARDWARE_MAPPING MappingHint_Index
 
E_HARDWARE_MAPPING MappingHint_Vertex
 hardware mapping hint More...
 
video::SMaterial Material
 Material for this meshbuffer. More...
 
E_PRIMITIVE_TYPE PrimitiveType
 Primitive type used for rendering (triangles, lines, ...) More...
 
core::array< T > Vertices
 Vertices of this buffer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from irr::IReferenceCounted
void setDebugName (const c8 *newName)
 Sets the debug name of the object. More...
 

Detailed Description

template<class T>
class irr::scene::CMeshBuffer< T >

Template implementation of the IMeshBuffer interface.

Definition at line 17 of file CMeshBuffer.h.

Constructor & Destructor Documentation

◆ CMeshBuffer()

template<class T >
irr::scene::CMeshBuffer< T >::CMeshBuffer ( )
inline

Default constructor for empty meshbuffer.

Definition at line 21 of file CMeshBuffer.h.

References irr::IReferenceCounted::setDebugName().

Member Function Documentation

◆ append() [1/2]

template<class T >
virtual void irr::scene::CMeshBuffer< T >::append ( const void *const  vertices,
u32  numVertices,
const u16 *const  indices,
u32  numIndices 
)
inlinevirtual

◆ append() [2/2]

template<class T >
virtual void irr::scene::CMeshBuffer< T >::append ( const IMeshBuffer *const  other)
inlinevirtual

Append the meshbuffer to the current buffer.

Only works for compatible types, i.e. either the same type or the main buffer is of standard type. Otherwise, behavior is undefined.

Parameters
otherMeshbuffer to be appended to this one.

Implements irr::scene::IMeshBuffer.

Definition at line 214 of file CMeshBuffer.h.

◆ getBoundingBox()

template<class T >
virtual const core::aabbox3d<f32>& irr::scene::CMeshBuffer< T >::getBoundingBox ( ) const
inlinevirtual

Get the axis aligned bounding box.

Returns
Axis aligned bounding box of this buffer.

Implements irr::scene::IMeshBuffer.

Definition at line 104 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::BoundingBox.

◆ getChangedID_Index()

template<class T >
virtual u32 irr::scene::CMeshBuffer< T >::getChangedID_Index ( ) const
inlinevirtual

Get the currently used ID for identification of changes.

This shouldn't be used for anything outside the VideoDriver.

Implements irr::scene::IMeshBuffer.

Definition at line 287 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::ChangedID_Index.

◆ getChangedID_Vertex()

template<class T >
virtual u32 irr::scene::CMeshBuffer< T >::getChangedID_Vertex ( ) const
inlinevirtual

Get the currently used ID for identification of changes.

This shouldn't be used for anything outside the VideoDriver.

Implements irr::scene::IMeshBuffer.

Definition at line 283 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::ChangedID_Vertex.

◆ getHardwareMappingHint_Index()

template<class T >
virtual E_HARDWARE_MAPPING irr::scene::CMeshBuffer< T >::getHardwareMappingHint_Index ( ) const
inlinevirtual

get the current hardware mapping hint

Implements irr::scene::IMeshBuffer.

Definition at line 246 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::MappingHint_Index.

◆ getHardwareMappingHint_Vertex()

template<class T >
virtual E_HARDWARE_MAPPING irr::scene::CMeshBuffer< T >::getHardwareMappingHint_Vertex ( ) const
inlinevirtual

get the current hardware mapping hint

Implements irr::scene::IMeshBuffer.

Definition at line 240 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::MappingHint_Vertex.

◆ getIndexCount()

template<class T >
virtual u32 irr::scene::CMeshBuffer< T >::getIndexCount ( ) const
inlinevirtual

Get number of indices.

Returns
Number of indices.

Implements irr::scene::IMeshBuffer.

Definition at line 96 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Indices, and irr::core::array< T, TAlloc >::size().

Referenced by irr::scene::CMeshBuffer< T >::append().

◆ getIndexType()

template<class T >
virtual video::E_INDEX_TYPE irr::scene::CMeshBuffer< T >::getIndexType ( ) const
inlinevirtual

Get type of index data which is stored in this meshbuffer.

Returns
Index type of this buffer.

Implements irr::scene::IMeshBuffer.

Definition at line 73 of file CMeshBuffer.h.

References irr::video::EIT_16BIT.

◆ getIndices() [1/2]

template<class T >
virtual const u16* irr::scene::CMeshBuffer< T >::getIndices ( ) const
inlinevirtual

Get pointer to indices.

Returns
Pointer to indices.

Implements irr::scene::IMeshBuffer.

Definition at line 80 of file CMeshBuffer.h.

References irr::core::array< T, TAlloc >::const_pointer(), and irr::scene::CMeshBuffer< T >::Indices.

◆ getIndices() [2/2]

template<class T >
virtual u16* irr::scene::CMeshBuffer< T >::getIndices ( )
inlinevirtual

Get pointer to indices.

Returns
Pointer to indices.

Implements irr::scene::IMeshBuffer.

Definition at line 88 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Indices, and irr::core::array< T, TAlloc >::pointer().

◆ getMaterial() [1/2]

template<class T >
virtual const video::SMaterial& irr::scene::CMeshBuffer< T >::getMaterial ( ) const
inlinevirtual

Get material of this meshbuffer.

Returns
Material of this buffer

Implements irr::scene::IMeshBuffer.

Definition at line 34 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Material.

◆ getMaterial() [2/2]

template<class T >
virtual video::SMaterial& irr::scene::CMeshBuffer< T >::getMaterial ( )
inlinevirtual

Get material of this meshbuffer.

Returns
Material of this buffer

Implements irr::scene::IMeshBuffer.

Definition at line 42 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Material.

◆ getNormal() [1/2]

template<class T >
virtual const core::vector3df& irr::scene::CMeshBuffer< T >::getNormal ( u32  i) const
inlinevirtual

returns normal of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 156 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Vertices.

◆ getNormal() [2/2]

template<class T >
virtual core::vector3df& irr::scene::CMeshBuffer< T >::getNormal ( u32  i)
inlinevirtual

returns normal of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 162 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Vertices.

◆ getPosition() [1/2]

template<class T >
virtual const core::vector3df& irr::scene::CMeshBuffer< T >::getPosition ( u32  i) const
inlinevirtual

returns position of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 144 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Vertices.

◆ getPosition() [2/2]

template<class T >
virtual core::vector3df& irr::scene::CMeshBuffer< T >::getPosition ( u32  i)
inlinevirtual

returns position of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 150 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Vertices.

◆ getPrimitiveType()

template<class T >
virtual E_PRIMITIVE_TYPE irr::scene::CMeshBuffer< T >::getPrimitiveType ( ) const
inlinevirtual

Get the kind of primitive geometry which is used by the meshbuffer.

Implements irr::scene::IMeshBuffer.

Definition at line 267 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::PrimitiveType.

◆ getTCoords() [1/2]

template<class T >
virtual const core::vector2df& irr::scene::CMeshBuffer< T >::getTCoords ( u32  i) const
inlinevirtual

returns texture coord of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 168 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Vertices.

◆ getTCoords() [2/2]

template<class T >
virtual core::vector2df& irr::scene::CMeshBuffer< T >::getTCoords ( u32  i)
inlinevirtual

returns texture coord of vertex i

Implements irr::scene::IMeshBuffer.

Definition at line 174 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::Vertices.

◆ getVertexCount()

template<class T >
virtual u32 irr::scene::CMeshBuffer< T >::getVertexCount ( ) const
inlinevirtual

Get number of vertices.

Returns
Number of vertices.

Implements irr::scene::IMeshBuffer.

Definition at line 66 of file CMeshBuffer.h.

References irr::core::array< T, TAlloc >::size(), and irr::scene::CMeshBuffer< T >::Vertices.

Referenced by irr::scene::CMeshBuffer< T >::append().

◆ getVertexType()

template<class T >
virtual video::E_VERTEX_TYPE irr::scene::CMeshBuffer< T >::getVertexType ( ) const
inlinevirtual

Get type of vertex data stored in this buffer.

Returns
Type of vertex data.

Implements irr::scene::IMeshBuffer.

Definition at line 138 of file CMeshBuffer.h.

◆ getVertices() [1/2]

template<class T >
virtual const void* irr::scene::CMeshBuffer< T >::getVertices ( ) const
inlinevirtual

Get pointer to vertices.

Returns
Pointer to vertices.

Implements irr::scene::IMeshBuffer.

Definition at line 50 of file CMeshBuffer.h.

References irr::core::array< T, TAlloc >::const_pointer(), and irr::scene::CMeshBuffer< T >::Vertices.

Referenced by irr::scene::CMeshBuffer< T >::append().

◆ getVertices() [2/2]

template<class T >
virtual void* irr::scene::CMeshBuffer< T >::getVertices ( )
inlinevirtual

Get pointer to vertices.

Returns
Pointer to vertices.

Implements irr::scene::IMeshBuffer.

Definition at line 58 of file CMeshBuffer.h.

References irr::core::array< T, TAlloc >::pointer(), and irr::scene::CMeshBuffer< T >::Vertices.

◆ recalculateBoundingBox()

template<class T >
virtual void irr::scene::CMeshBuffer< T >::recalculateBoundingBox ( )
inlinevirtual

◆ setBoundingBox()

template<class T >
virtual void irr::scene::CMeshBuffer< T >::setBoundingBox ( const core::aabbox3df box)
inlinevirtual

Set the axis aligned bounding box.

Parameters
boxNew axis aligned bounding box for this buffer. set user axis aligned bounding box

Implements irr::scene::IMeshBuffer.

Definition at line 113 of file CMeshBuffer.h.

◆ setDirty()

template<class T >
virtual void irr::scene::CMeshBuffer< T >::setDirty ( E_BUFFER_TYPE  Buffer = EBT_VERTEX_AND_INDEX)
inlinevirtual

◆ setHardwareMappingHint()

template<class T >
virtual void irr::scene::CMeshBuffer< T >::setHardwareMappingHint ( E_HARDWARE_MAPPING  NewMappingHint,
E_BUFFER_TYPE  Buffer = EBT_VERTEX_AND_INDEX 
)
inlinevirtual

◆ setPrimitiveType()

template<class T >
virtual void irr::scene::CMeshBuffer< T >::setPrimitiveType ( E_PRIMITIVE_TYPE  type)
inlinevirtual

Describe what kind of primitive geometry is used by the meshbuffer.

Implements irr::scene::IMeshBuffer.

Definition at line 261 of file CMeshBuffer.h.

References irr::scene::CMeshBuffer< T >::PrimitiveType.

Member Data Documentation

◆ BoundingBox

◆ ChangedID_Index

template<class T >
u32 irr::scene::CMeshBuffer< T >::ChangedID_Index

◆ ChangedID_Vertex

template<class T >
u32 irr::scene::CMeshBuffer< T >::ChangedID_Vertex

◆ Indices

template<class T >
core::array<u16> irr::scene::CMeshBuffer< T >::Indices

Indices into the vertices of this buffer.

Definition at line 301 of file CMeshBuffer.h.

Referenced by irr::scene::CMeshBuffer< T >::append(), irr::scene::CMeshBuffer< T >::getIndexCount(), and irr::scene::CMeshBuffer< T >::getIndices().

◆ MappingHint_Index

◆ MappingHint_Vertex

template<class T >
E_HARDWARE_MAPPING irr::scene::CMeshBuffer< T >::MappingHint_Vertex

◆ Material

template<class T >
video::SMaterial irr::scene::CMeshBuffer< T >::Material

Material for this meshbuffer.

Definition at line 297 of file CMeshBuffer.h.

Referenced by irr::scene::CMeshBuffer< T >::getMaterial().

◆ PrimitiveType

template<class T >
E_PRIMITIVE_TYPE irr::scene::CMeshBuffer< T >::PrimitiveType

Primitive type used for rendering (triangles, lines, ...)

Definition at line 305 of file CMeshBuffer.h.

Referenced by irr::scene::CMeshBuffer< T >::getPrimitiveType(), and irr::scene::CMeshBuffer< T >::setPrimitiveType().

◆ Vertices


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