Saga3D API Documentation
1.0-RC4
|
Go to the documentation of this file. 1 #ifndef __I_MESH_BUFFER_H_INCLUDED__
2 #define __I_MESH_BUFFER_H_INCLUDED__
52 virtual std::uint64_t
getID()
const = 0;
80 virtual const std::uint32_t*
getIndices()
const = 0;
106 virtual const glm::vec3&
getPosition(std::uint32_t i)
const = 0;
109 virtual const glm::vec3&
getNormal(std::uint32_t i)
const = 0;
112 virtual const glm::vec2&
getTCoords(std::uint32_t i)
const = 0;
115 virtual const glm::vec3&
getTangent(std::uint32_t i)
const = 0;
118 virtual const glm::vec3&
getBiTangent(std::uint32_t i)
const = 0;
121 virtual std::uint32_t
getIndex(std::size_t offset)
const = 0;
127 virtual void append(std::vector<S3DVertex>&& vertices, std::vector<uint32_t>&& indices) = 0;
139 virtual void appendAttribute(
const char* buffer,
const size_t size,
const size_t stride) = 0;
virtual const glm::vec3 & getBiTangent(std::uint32_t i) const =0
returns bi-tangent of vertex i
void setPrimitiveType(scene::E_PRIMITIVE_TYPE type)
Describe what kind of primitive geometry is used by the meshbuffer.
virtual void setVertexCount(const size_t count)=0
Set number of vertices.
@ POINTS
All vertices are non-connected points.
@ LINE_LOOP
Just as LINE_STRIP, but the last and the first vertex is also connected.
constexpr SGPUResource::HandleType NULL_GPU_RESOURCE_HANDLE
virtual const void * getData(const video::PipelineHandle pipeline) const =0
Get pointer to GPU staging buffer.
@ TRIANGLES
Explicitly set all vertices for each triangle.
virtual const core::aabbox3df & getBoundingBox() const =0
Get the axis aligned bounding box of this meshbuffer.
void setIndexedIndirectDrawBuffer(const video::IndexedIndirectBufferHandle buffer)
void setBindingLocation(const int binding)
Set buffer binding location.
virtual const std::uint32_t * getIndices() const =0
Get access to indices.
virtual bool isGPUBuffer() const =0
scene::E_PRIMITIVE_TYPE PrimitiveType
Primitive type used for rendering (triangles, lines, ...)
SGPUResource::HandleType PipelineHandle
virtual void appendAttribute(const char *buffer, const size_t size, const size_t stride)=0
Append the custom attribute buffer to the current mesh buffer.
virtual const glm::vec3 & getTangent(std::uint32_t i) const =0
returns tangent of vertex i
int getBindingLocation() const
Get buffer binding location.
void isNull(const bool null)
@ POINT_SPRITES
The single vertices are expanded to quad billboards on the GPU.
virtual void append(std::vector< S3DVertex > &&vertices, std::vector< uint32_t > &&indices)=0
Append the vertices and indices to the current buffer.
bool useIndirectDraw() const
SGPUResource::HandleType IndirectBufferHandle
virtual const glm::vec2 & getTCoords(std::uint32_t i) const =0
returns texture coord of vertex i
video::IndirectBufferHandle IndirectDrawBuffer
Indirect draw command buffer for this mesh buffer.
E_INDEX_TYPE getIndexType() const
Get index type.
Struct for holding a mesh with a single material.
virtual std::uint64_t getID() const =0
Returns internal ID to identify mesh buffer.
SGPUResource::HandleType IndexedIndirectBufferHandle
virtual void buildBuffer(video::IVideoDriver &driver, const video::PipelineHandle pipeline)=0
Generate GPU-compatible data.
std::size_t getInstanceCount() const
Get buffer binding location.
virtual void setBoundingBox(const core::aabbox3df &box)=0
Set axis aligned bounding box.
virtual void * getVertices()=0
Get access to vertex data. The data is an array of vertices.
void setIndirectDrawBuffer(const video::IndirectBufferHandle buffer)
int Binding
Binding location.
bool useIndexedIndirectDraw() const
virtual void setIndexCount(const std::uint32_t count)=0
Set number of indices.
virtual std::size_t getVertexCount() const =0
Get amount of vertices in meshbuffer.
@ LINES
Every two vertices are connected creating n/2 lines.
virtual void recalculateBoundingBox()=0
Recalculates the bounding box. Should be called if the mesh changed.
virtual std::uint32_t getPrimitiveCount() const
Calculate how many geometric primitives are used by this meshbuffer.
video::IndexedIndirectBufferHandle IndexedIndirectDrawBuffer
Indexed indirect draw command buffer for this mesh buffer.
std::size_t InstanceCount
Instance count for rendering multiple objects with this buffer.
bool IsNull
Is a null buffer?
@ LINE_STRIP
All vertices form a single connected line.
scene::E_PRIMITIVE_TYPE getPrimitiveType() const
Get the kind of primitive geometry which is used by the meshbuffer.
virtual std::uint32_t getIndex(std::size_t offset) const =0
returns vertex index at this offset
virtual const glm::vec3 & getNormal(std::uint32_t i) const =0
returns normal of vertex i
auto indirectDrawBuffer() const
void setInstanceCount(const size_t count)
Set buffer binding location.
auto indexedIndirectDrawBuffer() const
virtual std::uint32_t getIndexCount() const =0
Get amount of indices in this meshbuffer.
E_PRIMITIVE_TYPE
Enumeration for all primitive types there are.
virtual std::size_t getSize(const video::PipelineHandle pipeline) const =0
Get size of GPU staging buffer.
std::uint32_t MeshBufferID
static MeshBufferID RootID
To set ID for mesh buffer when created.
void setIndexType(const E_INDEX_TYPE type)
Set index type.
virtual const glm::vec3 & getPosition(std::uint32_t i) const =0
returns position of vertex i