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