Saga3D API Documentation
1.0-RC4
|
Implementation of the CPU IMeshBuffer interface. More...
#include <CMeshBuffer.h>
Public Member Functions | |
CMeshBuffer () | |
Default constructor for empty meshbuffer. More... | |
virtual bool | isGPUBuffer () const override |
virtual | ~CMeshBuffer () |
virtual std::uint64_t | getID () const override |
Returns internal ID to identify mesh buffer. More... | |
virtual void | buildBuffer (video::IVideoDriver &driver, const video::PipelineHandle pipeline) override |
Generate GPU-compatible data. More... | |
virtual void * | getVertices () override |
Get pointer to vertices. More... | |
virtual const void * | getData (const video::PipelineHandle pipeline) const override |
Get pointer to GPU staging buffer. More... | |
virtual std::size_t | getSize (const video::PipelineHandle pipeline) const override |
Get size of GPU staging buffer. More... | |
virtual std::size_t | getVertexCount () const override |
Get number of vertices. More... | |
virtual void | setVertexCount (const size_t count) override |
Set number of vertices. More... | |
virtual const std::uint32_t * | getIndices () const override |
Get pointer to indices. More... | |
virtual std::uint32_t | getIndex (std::size_t offset) const override |
returns vertex index at this offset More... | |
virtual std::uint32_t * | getIndices () override |
Get pointer to indices. More... | |
virtual std::uint32_t | getIndexCount () const override |
Get number of indices. More... | |
virtual void | setIndexCount (const std::uint32_t count) override |
Set number of indices. More... | |
virtual const core::aabbox3d< float > & | getBoundingBox () const override |
Get the axis aligned bounding box. More... | |
virtual void | setBoundingBox (const core::aabbox3df &box) override |
Set the axis aligned bounding box. More... | |
virtual void | recalculateBoundingBox () override |
Recalculate the bounding box. More... | |
virtual const glm::vec3 & | getPosition (std::uint32_t i) const override |
returns position of vertex i More... | |
virtual const glm::vec3 & | getNormal (std::uint32_t i) const override |
returns normal of vertex i More... | |
virtual const glm::vec2 & | getTCoords (std::uint32_t i) const override |
returns texture coord of vertex i More... | |
virtual const glm::vec3 & | getTangent (std::uint32_t i) const override |
returns tangent of vertex i More... | |
virtual const glm::vec3 & | getBiTangent (std::uint32_t i) const override |
returns bi-tangent of vertex i More... | |
virtual void | append (std::vector< S3DVertex > &&vertices, std::vector< uint32_t > &&indices) override |
Append the vertices and indices to the current buffer. More... | |
virtual void | appendAttribute (const char *buffer, const size_t size, const size_t stride) override |
Append the custom attribute buffer to the current mesh buffer. More... | |
virtual void | append (const IMeshBuffer *const other) override |
Append the meshbuffer to the current buffer. More... | |
![]() | |
virtual | ~IMeshBuffer () |
void | setPrimitiveType (scene::E_PRIMITIVE_TYPE type) |
Describe what kind of primitive geometry is used by the meshbuffer. More... | |
scene::E_PRIMITIVE_TYPE | getPrimitiveType () const |
Get the kind of primitive geometry which is used by the meshbuffer. More... | |
E_INDEX_TYPE | getIndexType () const |
Get index type. More... | |
void | setIndexType (const E_INDEX_TYPE type) |
Set index type. More... | |
void | setInstanceCount (const size_t count) |
Set buffer binding location. More... | |
std::size_t | getInstanceCount () const |
Get buffer binding location. More... | |
void | setBindingLocation (const int binding) |
Set buffer binding location. More... | |
int | getBindingLocation () const |
Get buffer binding location. More... | |
void | isNull (const bool null) |
bool | isNull () const |
virtual std::uint32_t | getPrimitiveCount () const |
Calculate how many geometric primitives are used by this meshbuffer. More... | |
bool | useIndirectDraw () const |
auto | indirectDrawBuffer () const |
void | setIndirectDrawBuffer (const video::IndirectBufferHandle buffer) |
bool | useIndexedIndirectDraw () const |
auto | indexedIndirectDrawBuffer () const |
void | setIndexedIndirectDrawBuffer (const video::IndexedIndirectBufferHandle buffer) |
Public Attributes | |
const std::uint64_t | ID |
std::vector< glm::vec3 > | PositionBuffer |
std::vector< glm::vec3 > | NormalBuffer |
std::vector< glm::vec4 > | ColorBuffer |
std::vector< glm::vec2 > | TCoordBuffer |
std::vector< glm::vec3 > | TangentBuffer |
std::vector< glm::vec3 > | BiTangentBuffer |
std::vector< glm::vec4 > | BoneWeightBuffer |
std::vector< glm::vec4 > | BoneIDBuffer |
std::vector< std::vector< unsigned char > > | AttributeBuffer |
std::unordered_map< video::PipelineHandle, std::vector< unsigned char > > | GPUBuffers |
GPU staging buffer. More... | |
std::vector< std::uint32_t > | Indices |
Indices into the vertices of this buffer. More... | |
core::aabbox3d< float > | BoundingBox |
Bounding box of this meshbuffer. More... | |
Additional Inherited Members | |
![]() | |
scene::E_PRIMITIVE_TYPE | PrimitiveType = E_PRIMITIVE_TYPE::TRIANGLES |
Primitive type used for rendering (triangles, lines, ...) More... | |
std::size_t | InstanceCount = 1 |
Instance count for rendering multiple objects with this buffer. More... | |
int | Binding = 0 |
Binding location. More... | |
bool | IsNull = false |
Is a null buffer? More... | |
video::IndirectBufferHandle | IndirectDrawBuffer = video::NULL_GPU_RESOURCE_HANDLE |
Indirect draw command buffer for this mesh buffer. More... | |
video::IndexedIndirectBufferHandle | IndexedIndirectDrawBuffer = video::NULL_GPU_RESOURCE_HANDLE |
Indexed indirect draw command buffer for this mesh buffer. More... | |
E_INDEX_TYPE | IndexType = E_INDEX_TYPE::UINT32 |
![]() | |
static MeshBufferID | RootID |
To set ID for mesh buffer when created. More... | |
Implementation of the CPU IMeshBuffer interface.
Definition at line 17 of file CMeshBuffer.h.
|
inline |
Default constructor for empty meshbuffer.
Definition at line 21 of file CMeshBuffer.h.
|
inlinevirtual |
Definition at line 29 of file CMeshBuffer.h.
|
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.
other | Meshbuffer to be appended to this one. |
Implements saga::scene::IMeshBuffer.
Definition at line 333 of file CMeshBuffer.h.
|
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 saga::scene::IMeshBuffer.
Definition at line 285 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Append the custom attribute buffer to the current mesh buffer.
buffer | Pointer to the buffer containing data |
size | Total size of buffer (bytes) |
stride | The custom data size of each vertex (bytes) |
Implements saga::scene::IMeshBuffer.
Definition at line 318 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Generate GPU-compatible data.
Depending on render pass's pipeline layout, this function generates vertex data for that pass
Implements saga::scene::IMeshBuffer.
Definition at line 33 of file CMeshBuffer.h.
|
inlineoverridevirtual |
returns bi-tangent of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 275 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get the axis aligned bounding box.
Implements saga::scene::IMeshBuffer.
Definition at line 222 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to GPU staging buffer.
Implements saga::scene::IMeshBuffer.
Definition at line 168 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Returns internal ID to identify mesh buffer.
Each mesh buffer will be assigned an unique ID in its creation
Implements saga::scene::IMeshBuffer.
Definition at line 31 of file CMeshBuffer.h.
|
inlineoverridevirtual |
returns vertex index at this offset
Implements saga::scene::IMeshBuffer.
Definition at line 198 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get number of indices.
Implements saga::scene::IMeshBuffer.
Definition at line 212 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to indices.
Implements saga::scene::IMeshBuffer.
Definition at line 192 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to indices.
Implements saga::scene::IMeshBuffer.
Definition at line 205 of file CMeshBuffer.h.
|
inlineoverridevirtual |
returns normal of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 257 of file CMeshBuffer.h.
|
inlineoverridevirtual |
returns position of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 251 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get size of GPU staging buffer.
Implements saga::scene::IMeshBuffer.
Definition at line 175 of file CMeshBuffer.h.
|
inlineoverridevirtual |
returns tangent of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 269 of file CMeshBuffer.h.
|
inlineoverridevirtual |
returns texture coord of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 263 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get number of vertices.
Implements saga::scene::IMeshBuffer.
Definition at line 182 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to vertices.
Implements saga::scene::IMeshBuffer.
Definition at line 161 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Implements saga::scene::IMeshBuffer.
Definition at line 27 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Recalculate the bounding box.
should be called if the mesh changed.
Implements saga::scene::IMeshBuffer.
Definition at line 237 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Set the axis aligned bounding box.
box | New axis aligned bounding box for this buffer. set user axis aligned bounding box |
Implements saga::scene::IMeshBuffer.
Definition at line 230 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Set number of indices.
Implements saga::scene::IMeshBuffer.
Definition at line 218 of file CMeshBuffer.h.
|
inlineoverridevirtual |
Set number of vertices.
Implements saga::scene::IMeshBuffer.
Definition at line 188 of file CMeshBuffer.h.
std::vector<std::vector<unsigned char> > saga::scene::CMeshBuffer::AttributeBuffer |
Definition at line 367 of file CMeshBuffer.h.
std::vector<glm::vec3> saga::scene::CMeshBuffer::BiTangentBuffer |
Definition at line 364 of file CMeshBuffer.h.
std::vector<glm::vec4> saga::scene::CMeshBuffer::BoneIDBuffer |
Definition at line 366 of file CMeshBuffer.h.
std::vector<glm::vec4> saga::scene::CMeshBuffer::BoneWeightBuffer |
Definition at line 365 of file CMeshBuffer.h.
core::aabbox3d<float> saga::scene::CMeshBuffer::BoundingBox |
Bounding box of this meshbuffer.
Definition at line 374 of file CMeshBuffer.h.
std::vector<glm::vec4> saga::scene::CMeshBuffer::ColorBuffer |
Definition at line 361 of file CMeshBuffer.h.
std::unordered_map<video::PipelineHandle, std::vector<unsigned char> > saga::scene::CMeshBuffer::GPUBuffers |
GPU staging buffer.
Definition at line 370 of file CMeshBuffer.h.
const std::uint64_t saga::scene::CMeshBuffer::ID |
Definition at line 357 of file CMeshBuffer.h.
std::vector<std::uint32_t> saga::scene::CMeshBuffer::Indices |
Indices into the vertices of this buffer.
Definition at line 372 of file CMeshBuffer.h.
std::vector<glm::vec3> saga::scene::CMeshBuffer::NormalBuffer |
Definition at line 360 of file CMeshBuffer.h.
std::vector<glm::vec3> saga::scene::CMeshBuffer::PositionBuffer |
Definition at line 359 of file CMeshBuffer.h.
std::vector<glm::vec3> saga::scene::CMeshBuffer::TangentBuffer |
Definition at line 363 of file CMeshBuffer.h.
std::vector<glm::vec2> saga::scene::CMeshBuffer::TCoordBuffer |
Definition at line 362 of file CMeshBuffer.h.