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

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

#include <C:/Projects/skylicht-engine/Projects/Irrlicht/Include/IMeshBuffer.h>

Inheritance diagram for irr::scene::IMeshBuffer:
irr::IReferenceCounted irr::scene::CMeshBuffer< video::S3DVertex2TCoords > irr::scene::CMeshBuffer< video::S3DVertex > irr::scene::CMeshBuffer< T >

Public Member Functions

 IMeshBuffer (video::IVertexDescriptor *vertexDescriptor)
virtual video::IVertexDescriptorgetVertexDescriptor () const =0
virtual bool setVertexDescriptor (video::IVertexDescriptor *vertexDescriptor)=0
virtual bool addVertexBuffer (IVertexBuffer *vertexBuffer)=0
virtual IVertexBuffergetVertexBuffer (u32 id=0) const =0
virtual u32 getVertexBufferCount () const =0
virtual void removeVertexBuffer (u32 id)=0
virtual bool setVertexBuffer (IVertexBuffer *vertexBuffer, u32 id=0)=0
bool isVertexBufferCompatible () const
 Inform if stored vertex buffers have the same vertex descriptors.
virtual IIndexBuffergetIndexBuffer () const =0
virtual bool setIndexBuffer (IIndexBuffer *indexBuffer)=0
u32 getPrimitiveCount () const
 Get primitive count.
E_PRIMITIVE_TYPE getPrimitiveType () const
 Get primitive type.
void setPrimitiveType (E_PRIMITIVE_TYPE primitiveType)
 Set primitive type.
virtual video::E_VERTEX_TYPE getVertexType () const =0
virtual video::SMaterialgetMaterial ()=0
 Get the material of this meshbuffer.
virtual const video::SMaterialgetMaterial () const =0
 Get the material of this meshbuffer.
virtual const core::aabbox3dfgetBoundingBox () const =0
 Get the axis aligned bounding box of this meshbuffer.
virtual core::aabbox3dfgetBoundingBox ()=0
 Get the axis aligned bounding box of this meshbuffer.
virtual void boundingBoxNeedsRecalculated ()=0
 Call this after changing the positions of any vertex.
virtual void recalculateBoundingBox ()=0
 Recalculates the bounding box. Should be called if the mesh changed.
virtual void append (IVertexBuffer *vertexBuffer, u32 vertexBufferID, IIndexBuffer *indexBuffer)=0
virtual void append (IMeshBuffer *meshBuffer)=0
 Append the meshbuffer to the current buffer.
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex (u32 id=0) const =0
 get the current hardware mapping hint
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index () const =0
 get the current hardware mapping hint
virtual void setHardwareMappingHint (E_HARDWARE_MAPPING pMappingHint, E_BUFFER_TYPE type=EBT_VERTEX_AND_INDEX, u32 id=0)=0
 set the hardware mapping hint, for driver
virtual void setDirty (E_BUFFER_TYPE type=EBT_VERTEX_AND_INDEX, u32 id=0)=0
 flags the meshbuffer as changed, reloads hardware buffers
virtual u32 getChangedID_Vertex (u32 id=0) const =0
 Get the currently used ID for identification of changes.
virtual u32 getChangedID_Index () const =0
 Get the currently used ID for identification of changes.
virtual core::matrix4getTransformation ()=0
virtual void setUseForHardwareInstancing (bool b)=0
virtual bool useForHardwareInstancing ()=0
Public Member Functions inherited from irr::IReferenceCounted
 IReferenceCounted ()
 Constructor.
virtual ~IReferenceCounted ()
 Destructor.
void grab () const
 Grabs the object. Increments the reference counter by one.
bool drop () const
 Drops the object. Decrements the reference counter by one.
s32 getReferenceCount () const
 Get the reference count.
const c8getDebugName () const
 Returns the debug name of the object.

Protected Attributes

video::IVertexDescriptorVertexDescriptor
 Vertex descriptor.
bool VertexBufferCompatible
core::array< scene::IVertexBuffer * > VertexBuffer
 Vertex buffer array.
scene::IIndexBufferIndexBuffer
 Index buffer.
E_PRIMITIVE_TYPE PrimitiveType
video::SMaterial Material
 Material.
bool BoundingBoxNeedsRecalculated
core::aabbox3d< f32BoundingBox
 Bounding box.
core::matrix4 Transformation
bool UseForHardwareInstancing

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.

Member Function Documentation

◆ append() [1/2]

virtual void irr::scene::IMeshBuffer::append ( IMeshBuffer * meshBuffer)
pure virtual

Append the meshbuffer to the current buffer.

Only works for compatible vertex types

Parameters
meshBufferBuffer to append to this one.

Implemented in irr::scene::CMeshBuffer< T >.

◆ append() [2/2]

virtual void irr::scene::IMeshBuffer::append ( IVertexBuffer * vertexBuffer,
u32 vertexBufferID,
IIndexBuffer * indexBuffer )
pure virtual

◆ boundingBoxNeedsRecalculated()

virtual void irr::scene::IMeshBuffer::boundingBoxNeedsRecalculated ( )
pure virtual

◆ getBoundingBox() [1/2]

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::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, and irr::scene::CMeshBuffer< video::S3DVertex2TCoords >.

◆ getBoundingBox() [2/2]

virtual core::aabbox3df & irr::scene::IMeshBuffer::getBoundingBox ( )
pure virtual

Get the axis aligned bounding box of this meshbuffer.

Returns
Axis aligned bounding box of this buffer.

Implemented in irr::scene::CMeshBuffer< T >.

◆ 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 >, and irr::scene::CMeshBuffer< video::S3DVertex2TCoords >.

◆ getChangedID_Vertex()

virtual u32 irr::scene::IMeshBuffer::getChangedID_Vertex ( u32 id = 0) 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 >, and irr::scene::CMeshBuffer< video::S3DVertex2TCoords >.

◆ getHardwareMappingHint_Index()

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

◆ getHardwareMappingHint_Vertex()

virtual E_HARDWARE_MAPPING irr::scene::IMeshBuffer::getHardwareMappingHint_Vertex ( u32 id = 0) const
pure virtual

◆ 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::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, and irr::scene::CMeshBuffer< video::S3DVertex2TCoords >.

◆ 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::CMeshBuffer< T >.

◆ recalculateBoundingBox()

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

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

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, and irr::scene::CMeshBuffer< video::S3DVertex2TCoords >.

◆ setDirty()

virtual void irr::scene::IMeshBuffer::setDirty ( E_BUFFER_TYPE type = EBT_VERTEX_AND_INDEX,
u32 id = 0 )
pure virtual

flags the meshbuffer as changed, reloads hardware buffers

Implemented in irr::scene::CMeshBuffer< T >, irr::scene::CMeshBuffer< video::S3DVertex >, and irr::scene::CMeshBuffer< video::S3DVertex2TCoords >.

◆ setHardwareMappingHint()

virtual void irr::scene::IMeshBuffer::setHardwareMappingHint ( E_HARDWARE_MAPPING pMappingHint,
E_BUFFER_TYPE type = EBT_VERTEX_AND_INDEX,
u32 id = 0 )
pure virtual

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