5 #ifndef __T_MESH_BUFFER_H_INCLUDED__ 6 #define __T_MESH_BUFFER_H_INCLUDED__ 135 return T().getType();
180 virtual void append(
const void*
const vertices,
u32 numVertices,
const u16*
const indices,
u32 numIndices)
189 for (i=0; i<numVertices; ++i)
196 for (i=0; i<numIndices; ++i)
virtual const core::vector3df & getNormal(u32 i) const
returns normal of vertex i
Change the vertex mapping.
virtual u32 getChangedID_Vertex() const
Get the currently used ID for identification of changes.
Template implementation of the IMeshBuffer interface.
virtual void setHardwareMappingHint(E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
set the hardware mapping hint, for driver
virtual u32 getChangedID_Index() const
Get the currently used ID for identification of changes.
virtual core::vector3df & getNormal(u32 i)
returns normal of vertex i
void reallocate(u32 new_size, bool canShrink=true)
Reallocates the array, make it bigger or smaller.
virtual void setBoundingBox(const core::aabbox3df &box)
Set the axis aligned bounding box.
video::SMaterial Material
Material for this meshbuffer.
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
get the current hardware mapping hint
core::array< u16 > Indices
Indices into the vertices of this buffer.
E_HARDWARE_MAPPING MappingHint_Vertex
hardware mapping hint
CMeshBuffer< video::S3DVertex > SMeshBuffer
Standard meshbuffer.
const T * const_pointer() const
Gets a const pointer to the array.
virtual video::E_VERTEX_TYPE getVertexType() const
Get type of vertex data stored in this buffer.
virtual void append(const IMeshBuffer *const other)
Append the meshbuffer to the current buffer.
Everything in the Irrlicht Engine can be found in this namespace.
virtual core::vector3df & getPosition(u32 i)
returns position of vertex i
Don't store on the hardware.
virtual const core::vector2df & getTCoords(u32 i) const
returns texture coord of vertex i
void reset(T x, T y, T z)
Resets the bounding box to a one-point box.
void push_back(const T &element)
Adds an element at back of array.
bool empty() const
Check if array is empty.
unsigned short u16
16 bit unsigned variable.
virtual u16 * getIndices()
Get pointer to indices.
virtual u32 getVertexCount() const
Get number of vertices.
Struct for holding a mesh with a single material.
virtual const void * getVertices() const
Get pointer to vertices.
virtual void append(const void *const vertices, u32 numVertices, const u16 *const indices, u32 numIndices)
Append the vertices and indices to the current buffer.
unsigned int u32
32 bit unsigned variable.
virtual void * getVertices()
Get pointer to vertices.
Change both vertex and index mapping to the same value.
E_HARDWARE_MAPPING MappingHint_Index
virtual u32 getIndexCount() const
Get number of indices.
u32 size() const
Get number of occupied elements of the array.
core::aabbox3d< f32 > BoundingBox
Bounding box of this meshbuffer.
virtual video::E_INDEX_TYPE getIndexType() const
Get type of index data which is stored in this meshbuffer.
CMeshBuffer< video::S3DVertex2TCoords > SMeshBufferLightMap
Meshbuffer with two texture coords per vertex, e.g. for lightmaps.
virtual void recalculateBoundingBox()
Recalculate the bounding box.
virtual const core::aabbox3d< f32 > & getBoundingBox() const
Get the axis aligned bounding box.
Change the index mapping.
void addInternalPoint(const vector3d< T > &p)
Adds a point to the bounding box.
void setDebugName(const c8 *newName)
Sets the debug name of the object.
core::array< T > Vertices
Vertices of this buffer.
virtual const core::vector3df & getPosition(u32 i) const
returns position of vertex i
virtual video::SMaterial & getMaterial()
Get material of this meshbuffer.
virtual const video::SMaterial & getMaterial() const
Get material of this meshbuffer.
E_VERTEX_TYPE
Enumeration for all vertex types there are.
CMeshBuffer< video::S3DVertexTangents > SMeshBufferTangents
Meshbuffer with vertices having tangents stored, e.g. for normal mapping.
virtual const u16 * getIndices() const
Get pointer to indices.
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index() const
get the current hardware mapping hint
Struct for holding parameters for a material renderer.
T * pointer()
Gets a pointer to the array.
virtual core::vector2df & getTCoords(u32 i)
returns texture coord of vertex i
CMeshBuffer()
Default constructor for empty meshbuffer.
virtual void setDirty(E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX)
flags the mesh as changed, reloads hardware buffers