Loading...
Searching...
No Matches
irr::scene::IMeshBuffer Class Referenceabstract

Struct for holding a mesh with a single material. More...

`#include <IMeshBuffer.h>`

Inheritance diagram for irr::scene::IMeshBuffer:

## Public Member Functions

virtual void | append (const IMeshBuffer *const other)=0
| Append the meshbuffer to the current buffer.
virtual void | append (const void *const vertices, u32 numVertices, const u16 *const indices, u32 numIndices)=0
| Append the vertices and indices to the current buffer.
virtual const core::aabbox3df & | getBoundingBox () const =0
| Get the axis aligned bounding box of this meshbuffer.
virtual u32 | getChangedID_Index () const =0
| Get the currently used ID for identification of changes.
virtual u32 | getChangedID_Vertex () const =0
| Get the currently used ID for identification of changes.
virtual E_HARDWARE_MAPPING | getHardwareMappingHint_Index () const =0
| get the current hardware mapping hint
virtual E_HARDWARE_MAPPING | getHardwareMappingHint_Vertex () const =0
| get the current hardware mapping hint
virtual u32 | getIndexCount () const =0
| Get amount of indices in this meshbuffer.
virtual video::E_INDEX_TYPE | getIndexType () const =0
| Get type of index data which is stored in this meshbuffer.
virtual const u16 * | getIndices () const =0
| Get access to Indices.
virtual u16 * | getIndices ()=0
| Get access to Indices.
virtual const video::SMaterial & | getMaterial () const =0
| Get the material of this meshbuffer.
virtual video::SMaterial & | getMaterial ()=0
| Get the material of this meshbuffer.
virtual const core::vector3df & | getNormal (u32 i) const =0
| returns normal of vertex i
virtual core::vector3df & | getNormal (u32 i)=0
| returns normal of vertex i
virtual const core::vector3df & | getPosition (u32 i) const =0
| returns position of vertex i
virtual core::vector3df & | getPosition (u32 i)=0
| returns position of vertex i
virtual const core::vector2df & | getTCoords (u32 i) const =0
| returns texture coord of vertex i
virtual core::vector2df & | getTCoords (u32 i)=0
| returns texture coord of vertex i
virtual u32 | getVertexCount () const =0
| Get amount of vertices in meshbuffer.
virtual video::E_VERTEX_TYPE | getVertexType () const =0
| Get type of vertex data which is stored in this meshbuffer.
virtual const void * | getVertices () const =0
| Get access to vertex data. The data is an array of vertices.
virtual void * | getVertices ()=0
| Get access to vertex data. The data is an array of vertices.
virtual void | recalculateBoundingBox ()=0
| Recalculates the bounding box. Should be called if the mesh changed.
virtual void | setBoundingBox (const core::aabbox3df &box)=0
| Set axis aligned bounding box.
virtual void | setDirty (E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)=0
| flags the meshbuffer as changed, reloads hardware buffers
virtual void | setHardwareMappingHint (E_HARDWARE_MAPPING newMappingHint, E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)=0
| set the hardware mapping hint, for driver
Public Member Functions inherited from irr::IReferenceCounted
| IReferenceCounted ()
| Constructor.
virtual | ~IReferenceCounted ()
| Destructor.
bool | drop () const
| Drops the object. Decrements the reference counter by one.
const c8 * | getDebugName () const
| Returns the debug name of the object.
s32 | getReferenceCount () const
| Get the reference count.
void | grab () const
| Grabs the object. Increments the reference counter by one.

## Additional Inherited Members

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

## Detailed Description

Struct for holding a mesh with a single material.

A part of an IMesh which has the same material on each face of that group. Logical groups of an IMesh need not be put into separate mesh buffers, but can be. Separately animated parts of the mesh must be put into separate mesh buffers. Some mesh buffer implementations have limitations on the number of vertices the buffer can hold. In that case, logical grouping can help. Moreover, the number of vertices should be optimized for the GPU upload, which often depends on the type of gfx card. Typial figures are 1000-10000 vertices per buffer. SMeshBuffer is a simple implementation of a MeshBuffer, which supports up to 65535 vertices.

Since meshbuffers are used for drawing, and hence will be exposed to the driver, chances are high that they are grab()'ed from somewhere. It's therefore required to dynamically allocate meshbuffers which are passed to a video driver and only drop the buffer once it's not used in the current code block anymore.

Definition at line 39 of file IMeshBuffer.h.

## Member Function Documentation

## append() [1/2]

virtual void irr::scene::IMeshBuffer::append | ( | const IMeshBuffer *const | other | ) |

pure virtual

Append the meshbuffer to the current buffer.

Only works for compatible vertex types

Parameters

  other | Buffer to append to this one.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## append() [2/2]

virtual void irr::scene::IMeshBuffer::append | ( | const void *const | vertices,
|  | u32 | numVertices,
|  | const u16 *const | indices,
|  | u32 | numIndices )

pure virtual

Append the vertices and indices to the current buffer.

Only works for compatible vertex types.

Parameters

  vertices | Pointer to a vertex array.
  numVertices | Number of vertices in the array.
  indices | Pointer to index array.
  numIndices | Number of indices in array.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getBoundingBox()

virtual const core::aabbox3df & irr::scene::IMeshBuffer::getBoundingBox | ( |  | ) | const

pure virtual

Get the axis aligned bounding box of this meshbuffer.

Returns
  Axis aligned bounding box of this buffer.

Implemented in irr::scene::CDynamicMeshBuffer, irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

Referenced by irr::scene::IMeshManipulator::apply().

## getChangedID_Index()

virtual u32 irr::scene::IMeshBuffer::getChangedID_Index | ( |  | ) | const

pure virtual

Get the currently used ID for identification of changes.

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

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getChangedID_Vertex()

virtual u32 irr::scene::IMeshBuffer::getChangedID_Vertex | ( |  | ) | const

pure virtual

Get the currently used ID for identification of changes.

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

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getHardwareMappingHint_Index()

virtual E_HARDWARE_MAPPING irr::scene::IMeshBuffer::getHardwareMappingHint_Index | ( |  | ) | const

pure virtual

get the current hardware mapping hint

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getHardwareMappingHint_Vertex()

virtual E_HARDWARE_MAPPING irr::scene::IMeshBuffer::getHardwareMappingHint_Vertex | ( |  | ) | const

pure virtual

get the current hardware mapping hint

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getIndexCount()

virtual u32 irr::scene::IMeshBuffer::getIndexCount | ( |  | ) | const

pure virtual

Get amount of indices in this meshbuffer.

Returns
  Number of indices in this buffer.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getIndexType()

virtual video::E_INDEX_TYPE irr::scene::IMeshBuffer::getIndexType | ( |  | ) | const

pure virtual

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

Returns
  Index type of this buffer.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getIndices() [1/2]

virtual const u16 * irr::scene::IMeshBuffer::getIndices | ( |  | ) | const

pure virtual

Get access to Indices.

Returns
  Pointer to indices array.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getIndices() [2/2]

virtual u16 * irr::scene::IMeshBuffer::getIndices | ( |  | ) |

pure virtual

Get access to Indices.

Returns
  Pointer to indices array.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getMaterial() [1/2]

virtual const video::SMaterial & irr::scene::IMeshBuffer::getMaterial | ( |  | ) | const

pure virtual

Get the material of this meshbuffer.

Returns
  Material of this buffer.

Implemented in irr::scene::CDynamicMeshBuffer, irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getMaterial() [2/2]

virtual video::SMaterial & irr::scene::IMeshBuffer::getMaterial | ( |  | ) |

pure virtual

Get the material of this meshbuffer.

Returns
  Material of this buffer.

Implemented in irr::scene::CDynamicMeshBuffer, irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getNormal() [1/2]

virtual const core::vector3df & irr::scene::IMeshBuffer::getNormal | ( | u32 | i | ) | const

pure virtual

returns normal of vertex i

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getNormal() [2/2]

virtual core::vector3df & irr::scene::IMeshBuffer::getNormal | ( | u32 | i | ) |

pure virtual

returns normal of vertex i

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getPosition() [1/2]

virtual const core::vector3df & irr::scene::IMeshBuffer::getPosition | ( | u32 | i | ) | const

pure virtual

returns position of vertex i

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

Referenced by irr::scene::IMeshManipulator::apply_().

## getPosition() [2/2]

virtual core::vector3df & irr::scene::IMeshBuffer::getPosition | ( | u32 | i | ) |

pure virtual

returns position of vertex i

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getTCoords() [1/2]

virtual const core::vector2df & irr::scene::IMeshBuffer::getTCoords | ( | u32 | i | ) | const

pure virtual

returns texture coord of vertex i

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getTCoords() [2/2]

virtual core::vector2df & irr::scene::IMeshBuffer::getTCoords | ( | u32 | i | ) |

pure virtual

returns texture coord of vertex i

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## getVertexCount()

virtual u32 irr::scene::IMeshBuffer::getVertexCount | ( |  | ) | const

pure virtual

Get amount of vertices in meshbuffer.

Returns
  Number of vertices in this buffer.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

Referenced by irr::scene::IMeshManipulator::apply_().

## getVertexType()

virtual video::E_VERTEX_TYPE irr::scene::IMeshBuffer::getVertexType | ( |  | ) | const

pure virtual

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

Returns
  Vertex type of this buffer.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

Referenced by irr::scene::IMeshManipulator::apply_().

## getVertices() [1/2]

virtual const void * irr::scene::IMeshBuffer::getVertices | ( |  | ) | const

pure virtual

Get access to vertex data. The data is an array of vertices.

Which vertex type is used can be determined by getVertexType().

Returns
  Pointer to array of vertices.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

Referenced by irr::scene::IMeshManipulator::apply_().

## getVertices() [2/2]

virtual void * irr::scene::IMeshBuffer::getVertices | ( |  | ) |

pure virtual

Get access to vertex data. The data is an array of vertices.

Which vertex type is used can be determined by getVertexType().

Returns
  Pointer to array of vertices.

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## recalculateBoundingBox()

virtual void irr::scene::IMeshBuffer::recalculateBoundingBox | ( |  | ) |

pure virtual

Recalculates the bounding box. Should be called if the mesh changed.

Implemented in irr::scene::CDynamicMeshBuffer, irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

## setBoundingBox()

virtual void irr::scene::IMeshBuffer::setBoundingBox | ( | const core::aabbox3df & | box | ) |

pure virtual

Set axis aligned bounding box.

Parameters

  box | User defined axis aligned bounding box to use for this buffer.

Implemented in irr::scene::CDynamicMeshBuffer, irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

Referenced by irr::scene::IMeshManipulator::apply_().

## setDirty()

virtual void irr::scene::IMeshBuffer::setDirty | ( | E_BUFFER_TYPE | buffer = EBT_VERTEX_AND_INDEX | ) |

pure virtual

flags the meshbuffer as changed, reloads hardware buffers

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

References irr::scene::EBT_VERTEX_AND_INDEX.

## setHardwareMappingHint()

virtual void irr::scene::IMeshBuffer::setHardwareMappingHint | ( | E_HARDWARE_MAPPING | newMappingHint,
|  | E_BUFFER_TYPE | buffer = EBT_VERTEX_AND_INDEX )

pure virtual

set the hardware mapping hint, for driver

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, irr::scene::CMeshBuffer< video::S3DVertex2TCoords >, irr::scene::CMeshBuffer< video::S3DVertexTangents >, irr::scene::IDynamicMeshBuffer, irr::scene::SSharedMeshBuffer, and irr::scene::SSkinMeshBuffer.

References irr::scene::EBT_VERTEX_AND_INDEX.

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

- IMeshBuffer.h

- Irrlicht Engine Documentation © 2003-2012 by Nikolaus Gebhardt. Generated on for Irrlicht 3D Engine by Doxygen 1.15.0