Saga3D API Documentation
1.0-RC4
|
Implementation of the CPU IMeshBuffer interface. More...
#include <CGPUMeshBuffer.h>
Public Member Functions | |
CGPUMeshBuffer () | |
Default constructor for empty meshbuffer. More... | |
virtual bool | isGPUBuffer () const override |
virtual | ~CGPUMeshBuffer () |
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... | |
void | setVertexBuffer (const video::ShaderBufferHandle buffer) |
Set a shader buffer as MeshBuffer. More... | |
auto | getVertexBuffer () const |
Get GPU mesh buffer. More... | |
virtual void | setVertexCount (const size_t count) override |
Set number of vertices. More... | |
virtual std::size_t | getVertexCount () const override |
Get number of vertices. More... | |
void | setIndexBuffer (const video::ShaderBufferHandle buffer) |
Set a shader buffer as vertex buffer. More... | |
auto | getIndexBuffer () const |
Get GPU index buffer. More... | |
virtual void | setIndexCount (const std::uint32_t count) |
Set number of indices. More... | |
virtual const std::uint32_t * | getIndices () const override |
Get pointer to indices. More... | |
virtual std::uint32_t * | getIndices () 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 | getIndexCount () const override |
Get 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 |
video::ShaderBufferHandle | VertexBuffer = video::NULL_GPU_RESOURCE_HANDLE |
std::size_t | VertexCount = 0 |
video::ShaderBufferHandle | IndexBuffer = video::NULL_GPU_RESOURCE_HANDLE |
std::uint32_t | IndexCount = 0 |
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 12 of file CGPUMeshBuffer.h.
|
inline |
Default constructor for empty meshbuffer.
Definition at line 16 of file CGPUMeshBuffer.h.
|
inlinevirtual |
Definition at line 24 of file CGPUMeshBuffer.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 131 of file CGPUMeshBuffer.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 116 of file CGPUMeshBuffer.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 123 of file CGPUMeshBuffer.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 28 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
returns bi-tangent of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 109 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get the axis aligned bounding box.
Implements saga::scene::IMeshBuffer.
Definition at line 85 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to GPU staging buffer.
Implements saga::scene::IMeshBuffer.
Definition at line 36 of file CGPUMeshBuffer.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 26 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
returns vertex index at this offset
Implements saga::scene::IMeshBuffer.
Definition at line 77 of file CGPUMeshBuffer.h.
|
inline |
Get GPU index buffer.
Return GPU index buffer handle (ie: bind for rendering)
Definition at line 63 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get number of indices.
Implements saga::scene::IMeshBuffer.
Definition at line 81 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to indices.
Implements saga::scene::IMeshBuffer.
Definition at line 70 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to indices.
Implements saga::scene::IMeshBuffer.
Definition at line 74 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
returns normal of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 100 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
returns position of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 97 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get size of GPU staging buffer.
Implements saga::scene::IMeshBuffer.
Definition at line 40 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
returns tangent of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 106 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
returns texture coord of vertex i
Implements saga::scene::IMeshBuffer.
Definition at line 103 of file CGPUMeshBuffer.h.
|
inline |
Get GPU mesh buffer.
Return GPU mesh buffer handle (ie: bind for rendering)
Definition at line 48 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get number of vertices.
Implements saga::scene::IMeshBuffer.
Definition at line 55 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Get pointer to vertices.
Implements saga::scene::IMeshBuffer.
Definition at line 32 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Implements saga::scene::IMeshBuffer.
Definition at line 22 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Recalculate the bounding box.
should be called if the mesh changed.
Implements saga::scene::IMeshBuffer.
Definition at line 94 of file CGPUMeshBuffer.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 90 of file CGPUMeshBuffer.h.
|
inline |
Set a shader buffer as vertex buffer.
For rendering from a buffer manipulated by shaders
Definition at line 59 of file CGPUMeshBuffer.h.
|
inlinevirtual |
Set number of indices.
Implements saga::scene::IMeshBuffer.
Definition at line 66 of file CGPUMeshBuffer.h.
|
inline |
Set a shader buffer as MeshBuffer.
For rendering from a buffer manipulated by shaders
Definition at line 44 of file CGPUMeshBuffer.h.
|
inlineoverridevirtual |
Set number of vertices.
Implements saga::scene::IMeshBuffer.
Definition at line 51 of file CGPUMeshBuffer.h.
const std::uint64_t saga::scene::CGPUMeshBuffer::ID |
Definition at line 133 of file CGPUMeshBuffer.h.
video::ShaderBufferHandle saga::scene::CGPUMeshBuffer::IndexBuffer = video::NULL_GPU_RESOURCE_HANDLE |
Definition at line 138 of file CGPUMeshBuffer.h.
std::uint32_t saga::scene::CGPUMeshBuffer::IndexCount = 0 |
Definition at line 139 of file CGPUMeshBuffer.h.
video::ShaderBufferHandle saga::scene::CGPUMeshBuffer::VertexBuffer = video::NULL_GPU_RESOURCE_HANDLE |
Definition at line 135 of file CGPUMeshBuffer.h.
std::size_t saga::scene::CGPUMeshBuffer::VertexCount = 0 |
Definition at line 136 of file CGPUMeshBuffer.h.