Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
dcpp::scene::PDynamicMeshBuffer Class Reference

Implementation of the IMeshBuffer interface for which can work with 16 and 32 bit indices as well as different vertex types. More...

#include <duckcpp/core/engine/PDynamicMeshBuffer.hpp>

Inheritance diagram for dcpp::scene::PDynamicMeshBuffer:
Inheritance graph
Collaboration diagram for dcpp::scene::PDynamicMeshBuffer:
Collaboration graph

Public Member Functions

 PDynamicMeshBuffer (dcpp::video::E_VERTEX_TYPE vertexType, dcpp::video::E_INDEX_TYPE indexType)
 constructor
 
virtual ~PDynamicMeshBuffer ()
 destructor
 
virtual IVertexBuffergetVertexBuffer () const override
 
virtual IIndexBuffergetIndexBuffer () const override
 
virtual void setVertexBuffer (IVertexBuffer *newVertexBuffer) override
 
virtual void setIndexBuffer (IIndexBuffer *newIndexBuffer) override
 
virtual const dcpp::video::SMaterialgetMaterial () const override
 Get Material of this buffer.
 
virtual dcpp::video::SMaterialgetMaterial () override
 Get Material of this buffer.
 
virtual const dcpp::nub::aabbox3dfgetBoundingBox () const override
 Get bounding box.
 
virtual void setBoundingBox (const dcpp::nub::aabbox3df &box) override
 Set bounding box.
 
virtual void recalculateBoundingBox () override
 Recalculate bounding box.
 
virtual void append (const void *const vertices, dcpp::uint32_kt numVertices, const dcpp::uint16_kt *const indices, dcpp::uint32_kt numIndices) override
 Append the vertices and indices to the current buffer.
 
virtual void append (const IMeshBuffer *const other) override
 Append the meshbuffer to the current buffer.
 
virtual void setPrimitiveType (E_PRIMITIVE_TYPE type) override
 Describe what kind of primitive geometry is used by the meshbuffer.
 
virtual E_PRIMITIVE_TYPE getPrimitiveType () const override
 Get the kind of primitive geometry which is used by the meshbuffer.
 
virtual EMESH_BUFFER_TYPE getType () const override
 Returns type of the class implementing the IMeshBuffer.
 
virtual IMeshBuffercreateClone (int cloneFlags) const override
 Create copy of the meshbuffer.
 
- Public Member Functions inherited from dcpp::scene::IDynamicMeshBuffer
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex () const override
 get the current hardware mapping hint
 
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Index () const override
 get the current hardware mapping hint
 
virtual void setHardwareMappingHint (E_HARDWARE_MAPPING NewMappingHint, E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) override
 set the hardware mapping hint, for driver
 
virtual void setDirty (E_BUFFER_TYPE Buffer=EBT_VERTEX_AND_INDEX) override
 flags the mesh as changed, reloads hardware buffers
 
virtual dcpp::uint32_kt getChangedID_Vertex () const override
 Get the currently used ID for identification of changes.
 
virtual dcpp::uint32_kt getChangedID_Index () const override
 Get the currently used ID for identification of changes.
 
virtual dcpp::video::E_VERTEX_TYPE getVertexType () const override
 Get type of vertex data which is stored in this meshbuffer.
 
virtual const void * getVertices () const override
 Get access to vertex data. The data is an array of vertices.
 
virtual void * getVertices () override
 Get access to vertex data. The data is an array of vertices.
 
virtual dcpp::uint32_kt getVertexCount () const override
 Get amount of vertices in meshbuffer.
 
virtual dcpp::video::E_INDEX_TYPE getIndexType () const override
 Get type of index data which is stored in this meshbuffer.
 
virtual const dcpp::uint16_ktgetIndices () const override
 Get access to indices.
 
virtual dcpp::uint16_ktgetIndices () override
 Get access to indices.
 
virtual dcpp::uint32_kt getIndexCount () const override
 Get amount of indices in this meshbuffer.
 
virtual const dcpp::nub::vector3dfgetPosition (dcpp::uint32_kt i) const override
 returns position of vertex i
 
virtual dcpp::nub::vector3dfgetPosition (dcpp::uint32_kt i) override
 returns position of vertex i
 
virtual const dcpp::nub::vector2dfgetTCoords (dcpp::uint32_kt i) const override
 returns texture coords of vertex i
 
virtual dcpp::nub::vector2dfgetTCoords (dcpp::uint32_kt i) override
 returns texture coords of vertex i
 
virtual const dcpp::nub::vector3dfgetNormal (dcpp::uint32_kt i) const override
 returns normal of vertex i
 
virtual dcpp::nub::vector3dfgetNormal (dcpp::uint32_kt i) override
 returns normal of vertex i
 
virtual dcpp::video::SColorgetColor (dcpp::uint32_kt i) override
 returns color of vertex i
 
virtual const dcpp::video::SColorgetColor (dcpp::uint32_kt i) const override
 returns color of vertex i
 
- Public Member Functions inherited from dcpp::scene::IMeshBuffer
virtual dcpp::uint32_kt getPrimitiveCount () const
 Calculate how many geometric primitives are used by this meshbuffer.
 
- Public Member Functions inherited from dcpp::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.
 
dcpp::int32_kt getReferenceCount () const
 Get the reference count.
 
const dcpp::char_ktgetDebugName () const
 Returns the debug name of the object.
 

Public Attributes

dcpp::video::SMaterial Material
 
dcpp::nub::aabbox3df BoundingBox
 
E_PRIMITIVE_TYPE PrimitiveType
 Primitive type used for rendering (triangles, lines, ...)
 

Additional Inherited Members

- Public Types inherited from dcpp::scene::IMeshBuffer
enum  ECloneFlags { ECF_VERTICES = 1 , ECF_INDICES = 2 }
 Bitflags with options for cloning. More...
 
- Protected Member Functions inherited from dcpp::IReferenceCounted
void setDebugName (const dcpp::char_kt *newName)
 Sets the debug name of the object.
 

Detailed Description

Implementation of the IMeshBuffer interface for which can work with 16 and 32 bit indices as well as different vertex types.

Member Function Documentation

◆ append() [1/2]

virtual void dcpp::scene::PDynamicMeshBuffer::append ( const IMeshBuffer *const  other)
inlineoverridevirtual

Append the meshbuffer to the current buffer.

Only works for compatible vertex types

Parameters
otherBuffer to append to this one.

Implements dcpp::scene::IMeshBuffer.

◆ append() [2/2]

virtual void dcpp::scene::PDynamicMeshBuffer::append ( const void *const  vertices,
dcpp::uint32_kt  numVertices,
const dcpp::uint16_kt *const  indices,
dcpp::uint32_kt  numIndices 
)
inlineoverridevirtual

Append the vertices and indices to the current buffer.

Only works for compatible vertex types.

Parameters
verticesPointer to a vertex array.
numVerticesNumber of vertices in the array.
indicesPointer to index array.
numIndicesNumber of indices in array.

Implements dcpp::scene::IMeshBuffer.

◆ createClone()

virtual IMeshBuffer * dcpp::scene::PDynamicMeshBuffer::createClone ( int  cloneFlags) const
inlineoverridevirtual

Create copy of the meshbuffer.

Implements dcpp::scene::IMeshBuffer.

◆ getBoundingBox()

virtual const dcpp::nub::aabbox3df & dcpp::scene::PDynamicMeshBuffer::getBoundingBox ( ) const
inlineoverridevirtual

Get bounding box.

Implements dcpp::scene::IMeshBuffer.

◆ getIndexBuffer()

virtual IIndexBuffer & dcpp::scene::PDynamicMeshBuffer::getIndexBuffer ( ) const
inlineoverridevirtual

◆ getMaterial() [1/2]

virtual const dcpp::video::SMaterial & dcpp::scene::PDynamicMeshBuffer::getMaterial ( ) const
inlineoverridevirtual

Get Material of this buffer.

Implements dcpp::scene::IMeshBuffer.

◆ getMaterial() [2/2]

virtual dcpp::video::SMaterial & dcpp::scene::PDynamicMeshBuffer::getMaterial ( )
inlineoverridevirtual

Get Material of this buffer.

Implements dcpp::scene::IMeshBuffer.

◆ getPrimitiveType()

virtual E_PRIMITIVE_TYPE dcpp::scene::PDynamicMeshBuffer::getPrimitiveType ( ) const
inlineoverridevirtual

Get the kind of primitive geometry which is used by the meshbuffer.

Implements dcpp::scene::IMeshBuffer.

◆ getType()

virtual EMESH_BUFFER_TYPE dcpp::scene::PDynamicMeshBuffer::getType ( ) const
inlineoverridevirtual

Returns type of the class implementing the IMeshBuffer.

Reimplemented from dcpp::scene::IMeshBuffer.

◆ getVertexBuffer()

virtual IVertexBuffer & dcpp::scene::PDynamicMeshBuffer::getVertexBuffer ( ) const
inlineoverridevirtual

◆ recalculateBoundingBox()

virtual void dcpp::scene::PDynamicMeshBuffer::recalculateBoundingBox ( )
inlineoverridevirtual

Recalculate bounding box.

Implements dcpp::scene::IMeshBuffer.

◆ setBoundingBox()

virtual void dcpp::scene::PDynamicMeshBuffer::setBoundingBox ( const dcpp::nub::aabbox3df box)
inlineoverridevirtual

Set bounding box.

Implements dcpp::scene::IMeshBuffer.

◆ setIndexBuffer()

virtual void dcpp::scene::PDynamicMeshBuffer::setIndexBuffer ( IIndexBuffer newIndexBuffer)
inlineoverridevirtual

◆ setPrimitiveType()

virtual void dcpp::scene::PDynamicMeshBuffer::setPrimitiveType ( E_PRIMITIVE_TYPE  type)
inlineoverridevirtual

Describe what kind of primitive geometry is used by the meshbuffer.

Implements dcpp::scene::IMeshBuffer.

◆ setVertexBuffer()

virtual void dcpp::scene::PDynamicMeshBuffer::setVertexBuffer ( IVertexBuffer newVertexBuffer)
inlineoverridevirtual

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

Duckcpp    @cppfx.xyz