Duckcpp 2.1.0
Duckcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
dcpp::scene::PMeshBuffer< T > Class Template Reference

Template implementation of the IMeshBuffer interface for 16-bit buffers. More...

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

Inheritance diagram for dcpp::scene::PMeshBuffer< T >:
Inheritance graph
Collaboration diagram for dcpp::scene::PMeshBuffer< T >:
Collaboration graph

Public Member Functions

 PMeshBuffer ()
 Default constructor for empty meshbuffer.
 
virtual const dcpp::video::SMaterialgetMaterial () const override
 Get material of this meshbuffer.
 
virtual dcpp::video::SMaterialgetMaterial () override
 Get material of this meshbuffer.
 
virtual const void * getVertices () const override
 Get pointer to vertices.
 
virtual void * getVertices () override
 Get pointer to vertices.
 
virtual dcpp::uint32_kt getVertexCount () const override
 Get number of vertices.
 
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 pointer to indices.
 
virtual dcpp::uint16_ktgetIndices () override
 Get pointer to indices.
 
virtual dcpp::uint32_kt getIndexCount () const override
 Get number of indices.
 
virtual const dcpp::nub::aabbox3dfgetBoundingBox () const override
 Get the axis aligned bounding box.
 
virtual void setBoundingBox (const dcpp::nub::aabbox3df &box) override
 Set the axis aligned bounding box.
 
virtual void recalculateBoundingBox () override
 Recalculate the bounding box.
 
virtual dcpp::video::E_VERTEX_TYPE getVertexType () const override
 Get type of vertex data stored in this buffer.
 
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::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 const dcpp::nub::vector2dfgetTCoords (dcpp::uint32_kt i) const override
 returns texture coord of vertex i
 
virtual dcpp::nub::vector2dfgetTCoords (dcpp::uint32_kt i) override
 returns texture coord 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
 
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 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 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 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 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.
 
EMESH_BUFFER_TYPE getTypeT () const
 Returns type of the class implementing the IMeshBuffer for template specialization.
 
EMESH_BUFFER_TYPE getTypeT () const
 partial specialization to return types
 
EMESH_BUFFER_TYPE getTypeT () const
 
EMESH_BUFFER_TYPE getTypeT () const
 
- 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::uint32_kt ChangedID_Vertex
 
dcpp::uint32_kt ChangedID_Index
 
E_HARDWARE_MAPPING MappingHint_Vertex
 hardware mapping hint
 
E_HARDWARE_MAPPING MappingHint_Index
 
dcpp::video::SMaterial Material
 Material for this meshbuffer.
 
dcpp::nub::array< T > Vertices
 Vertices of this buffer.
 
dcpp::nub::array< dcpp::uint16_ktIndices
 Indices into the vertices of this buffer.
 
dcpp::nub::aabbox3df BoundingBox
 Bounding box of this meshbuffer.
 
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

template<class T>
class dcpp::scene::PMeshBuffer< T >

Template implementation of the IMeshBuffer interface for 16-bit buffers.

Member Function Documentation

◆ append() [1/2]

template<class T >
virtual void dcpp::scene::PMeshBuffer< T >::append ( const IMeshBuffer *const  other)
inlineoverridevirtual

Append the meshbuffer to the current buffer.

Only works for compatible types, i.e. either the same type or the main buffer is of standard type. Otherwise, behavior is undefined.

Parameters
otherMeshBuffer to be appended to this one.

Implements dcpp::scene::IMeshBuffer.

◆ append() [2/2]

template<class T >
virtual void dcpp::scene::PMeshBuffer< T >::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 types, i.e. either the same type or the main buffer is of standard type. Otherwise, behavior is undefined.

Implements dcpp::scene::IMeshBuffer.

◆ createClone()

template<class T >
virtual IMeshBuffer * dcpp::scene::PMeshBuffer< T >::createClone ( int  cloneFlags) const
inlineoverridevirtual

Create copy of the meshbuffer.

Implements dcpp::scene::IMeshBuffer.

◆ getBoundingBox()

template<class T >
virtual const dcpp::nub::aabbox3df & dcpp::scene::PMeshBuffer< T >::getBoundingBox ( ) const
inlineoverridevirtual

Get the axis aligned bounding box.

Returns
Axis aligned bounding box of this buffer.

Implements dcpp::scene::IMeshBuffer.

◆ getChangedID_Index()

template<class T >
virtual dcpp::uint32_kt dcpp::scene::PMeshBuffer< T >::getChangedID_Index ( ) const
inlineoverridevirtual

Get the currently used ID for identification of changes.

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

Implements dcpp::scene::IMeshBuffer.

◆ getChangedID_Vertex()

template<class T >
virtual dcpp::uint32_kt dcpp::scene::PMeshBuffer< T >::getChangedID_Vertex ( ) const
inlineoverridevirtual

Get the currently used ID for identification of changes.

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

Implements dcpp::scene::IMeshBuffer.

◆ getColor() [1/2]

template<class T >
virtual const dcpp::video::SColor & dcpp::scene::PMeshBuffer< T >::getColor ( dcpp::uint32_kt  i) const
inlineoverridevirtual

returns color of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getColor() [2/2]

template<class T >
virtual dcpp::video::SColor & dcpp::scene::PMeshBuffer< T >::getColor ( dcpp::uint32_kt  i)
inlineoverridevirtual

returns color of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getHardwareMappingHint_Index()

template<class T >
virtual E_HARDWARE_MAPPING dcpp::scene::PMeshBuffer< T >::getHardwareMappingHint_Index ( ) const
inlineoverridevirtual

get the current hardware mapping hint

Implements dcpp::scene::IMeshBuffer.

◆ getHardwareMappingHint_Vertex()

template<class T >
virtual E_HARDWARE_MAPPING dcpp::scene::PMeshBuffer< T >::getHardwareMappingHint_Vertex ( ) const
inlineoverridevirtual

get the current hardware mapping hint

Implements dcpp::scene::IMeshBuffer.

◆ getIndexCount()

template<class T >
virtual dcpp::uint32_kt dcpp::scene::PMeshBuffer< T >::getIndexCount ( ) const
inlineoverridevirtual

Get number of indices.

Returns
Number of indices.

Implements dcpp::scene::IMeshBuffer.

◆ getIndexType()

template<class T >
virtual dcpp::video::E_INDEX_TYPE dcpp::scene::PMeshBuffer< T >::getIndexType ( ) const
inlineoverridevirtual

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

Returns
Index type of this buffer.

Implements dcpp::scene::IMeshBuffer.

◆ getIndices() [1/2]

template<class T >
virtual const dcpp::uint16_kt * dcpp::scene::PMeshBuffer< T >::getIndices ( ) const
inlineoverridevirtual

Get pointer to indices.

Returns
Pointer to indices.

Implements dcpp::scene::IMeshBuffer.

◆ getIndices() [2/2]

template<class T >
virtual dcpp::uint16_kt * dcpp::scene::PMeshBuffer< T >::getIndices ( )
inlineoverridevirtual

Get pointer to indices.

Returns
Pointer to indices.

Implements dcpp::scene::IMeshBuffer.

◆ getMaterial() [1/2]

template<class T >
virtual const dcpp::video::SMaterial & dcpp::scene::PMeshBuffer< T >::getMaterial ( ) const
inlineoverridevirtual

Get material of this meshbuffer.

Returns
Material of this buffer

Implements dcpp::scene::IMeshBuffer.

◆ getMaterial() [2/2]

template<class T >
virtual dcpp::video::SMaterial & dcpp::scene::PMeshBuffer< T >::getMaterial ( )
inlineoverridevirtual

Get material of this meshbuffer.

Returns
Material of this buffer

Implements dcpp::scene::IMeshBuffer.

◆ getNormal() [1/2]

template<class T >
virtual const dcpp::nub::vector3df & dcpp::scene::PMeshBuffer< T >::getNormal ( dcpp::uint32_kt  i) const
inlineoverridevirtual

returns normal of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getNormal() [2/2]

template<class T >
virtual dcpp::nub::vector3df & dcpp::scene::PMeshBuffer< T >::getNormal ( dcpp::uint32_kt  i)
inlineoverridevirtual

returns normal of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getPosition() [1/2]

template<class T >
virtual const dcpp::nub::vector3df & dcpp::scene::PMeshBuffer< T >::getPosition ( dcpp::uint32_kt  i) const
inlineoverridevirtual

returns position of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getPosition() [2/2]

template<class T >
virtual dcpp::nub::vector3df & dcpp::scene::PMeshBuffer< T >::getPosition ( dcpp::uint32_kt  i)
inlineoverridevirtual

returns position of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getPrimitiveType()

template<class T >
virtual E_PRIMITIVE_TYPE dcpp::scene::PMeshBuffer< T >::getPrimitiveType ( ) const
inlineoverridevirtual

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

Implements dcpp::scene::IMeshBuffer.

◆ getTCoords() [1/2]

template<class T >
virtual const dcpp::nub::vector2df & dcpp::scene::PMeshBuffer< T >::getTCoords ( dcpp::uint32_kt  i) const
inlineoverridevirtual

returns texture coord of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getTCoords() [2/2]

template<class T >
virtual dcpp::nub::vector2df & dcpp::scene::PMeshBuffer< T >::getTCoords ( dcpp::uint32_kt  i)
inlineoverridevirtual

returns texture coord of vertex i

Implements dcpp::scene::IMeshBuffer.

◆ getType()

template<class T >
virtual EMESH_BUFFER_TYPE dcpp::scene::PMeshBuffer< T >::getType ( ) const
inlineoverridevirtual

Returns type of the class implementing the IMeshBuffer.

Reimplemented from dcpp::scene::IMeshBuffer.

◆ getVertexCount()

template<class T >
virtual dcpp::uint32_kt dcpp::scene::PMeshBuffer< T >::getVertexCount ( ) const
inlineoverridevirtual

Get number of vertices.

Returns
Number of vertices.

Implements dcpp::scene::IMeshBuffer.

◆ getVertexType()

template<class T >
virtual dcpp::video::E_VERTEX_TYPE dcpp::scene::PMeshBuffer< T >::getVertexType ( ) const
inlineoverridevirtual

Get type of vertex data stored in this buffer.

Returns
Type of vertex data.

Implements dcpp::scene::IMeshBuffer.

◆ getVertices() [1/2]

template<class T >
virtual const void * dcpp::scene::PMeshBuffer< T >::getVertices ( ) const
inlineoverridevirtual

Get pointer to vertices.

Returns
Pointer to vertices.

Implements dcpp::scene::IMeshBuffer.

◆ getVertices() [2/2]

template<class T >
virtual void * dcpp::scene::PMeshBuffer< T >::getVertices ( )
inlineoverridevirtual

Get pointer to vertices.

Returns
Pointer to vertices.

Implements dcpp::scene::IMeshBuffer.

◆ recalculateBoundingBox()

template<class T >
virtual void dcpp::scene::PMeshBuffer< T >::recalculateBoundingBox ( )
inlineoverridevirtual

Recalculate the bounding box.

should be called if the mesh changed.

Implements dcpp::scene::IMeshBuffer.

◆ setBoundingBox()

template<class T >
virtual void dcpp::scene::PMeshBuffer< T >::setBoundingBox ( const dcpp::nub::aabbox3df box)
inlineoverridevirtual

Set the axis aligned bounding box.

Parameters
boxNew axis aligned bounding box for this buffer. set user axis aligned bounding box

Implements dcpp::scene::IMeshBuffer.

◆ setDirty()

template<class T >
virtual void dcpp::scene::PMeshBuffer< T >::setDirty ( E_BUFFER_TYPE  Buffer = EBT_VERTEX_AND_INDEX)
inlineoverridevirtual

flags the mesh as changed, reloads hardware buffers

Implements dcpp::scene::IMeshBuffer.

◆ setHardwareMappingHint()

template<class T >
virtual void dcpp::scene::PMeshBuffer< T >::setHardwareMappingHint ( E_HARDWARE_MAPPING  NewMappingHint,
E_BUFFER_TYPE  Buffer = EBT_VERTEX_AND_INDEX 
)
inlineoverridevirtual

set the hardware mapping hint, for driver

Implements dcpp::scene::IMeshBuffer.

◆ setPrimitiveType()

template<class T >
virtual void dcpp::scene::PMeshBuffer< T >::setPrimitiveType ( E_PRIMITIVE_TYPE  type)
inlineoverridevirtual

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

Implements dcpp::scene::IMeshBuffer.


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

Duckcpp    @cppfx.xyz