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