Use Mesh::CreateInfo to describe and create meshes. More...
#include <kanzi/core.ui/graphics3d/mesh_create_info.hpp>
Classes | |
struct | Cluster |
Parameters for Mesh::Cluster creation. More... | |
Public Types | |
typedef vector< PropertyEntry > | PropertyContainer |
typedef pair< AbstractPropertyType, Variant > | PropertyEntry |
Public Member Functions | |
CreateInfo () | |
Default constructor for mesh create info. More... | |
Public Attributes | |
Box | boundingBox |
The bounding box for the mesh in the local coordinates of the mesh. More... | |
vector< Mesh::CreateInfo::Cluster > | clusters |
Clusters. More... | |
GPUBuffer::NativeHandle | instanceBufferHandle |
Native handle to the instance buffer. More... | |
unsigned int | instanceCount |
Number of instances in the mesh. More... | |
vector< byte > | instanceData |
Instance buffer data. More... | |
size_t | instanceSize |
Size of one instance data in bytes. More... | |
MemoryType | memoryType |
Memory type for the texture. More... | |
PropertyContainer | properties |
Properties to copy to the mesh. More... | |
Skeleton | skeleton |
Mesh skeleton for bone animations. More... | |
bool | takeOwnership |
Indicates whether Kanzi destroys the native handles with the Mesh. More... | |
bool | uploadDataAtCreation |
Indicates whether to upload vertex and index data when creating the buffer. More... | |
GPUBuffer::NativeHandle | vertexBufferHandle |
Native handle to the vertex buffer. More... | |
unsigned int | vertexCount |
Number of vertices in the mesh. More... | |
vector< byte > | vertexData |
Vertex buffer data. More... | |
MeshAttributeCollection | vertexFormat |
Mesh vertex attributes. More... | |
size_t | vertexSize |
Size of one vertex in bytes. This is the sum of the sizes of all mesh vertex attributes. More... | |
Use Mesh::CreateInfo to describe and create meshes.
Vertex and index listings define meshes. Indices refer to vertices which define the faces of a mesh.
To define a mesh, you need:
When you render a large number of copies of the same mesh, performing a draw call for each copy consumes GPU time and decreases application performance. Instancing makes it possible to draw multiple copies of a mesh with different attributes, such as position, size, and color, with a single render call. For an example of how to render multiple instances of a cube mesh at different locations and with different colors, see Creating a mesh with instancing.
To enable the Kanzi Studio Preview to visualize the bounding volume of a mesh, set the bounding box for that mesh.
To create a cube mesh:
To create a mesh from native handles:
To create a mesh with instancing:
typedef pair<AbstractPropertyType, Variant> kanzi::Mesh::CreateInfo::PropertyEntry |
typedef vector<PropertyEntry> kanzi::Mesh::CreateInfo::PropertyContainer |
|
explicit |
Default constructor for mesh create info.
MemoryType kanzi::Mesh::CreateInfo::memoryType |
Memory type for the texture.
If Gpu is not included, texture will not be deployed when created. If Ram is not included, texture will not contain images after it has been deployed. Default value is GpuOnly.
vector<Mesh::CreateInfo::Cluster> kanzi::Mesh::CreateInfo::clusters |
Clusters.
Box kanzi::Mesh::CreateInfo::boundingBox |
The bounding box for the mesh in the local coordinates of the mesh.
When you do not set the size of a node with the Node::WidthProperty, Node::HeightProperty, and Node::DepthProperty properties, layout control nodes use the bounding box to determine the size of the node.
The Kanzi Studio Preview uses the bounding box to visualize the bounding volume of the mesh.
MeshAttributeCollection kanzi::Mesh::CreateInfo::vertexFormat |
Mesh vertex attributes.
size_t kanzi::Mesh::CreateInfo::vertexSize |
Size of one vertex in bytes. This is the sum of the sizes of all mesh vertex attributes.
unsigned int kanzi::Mesh::CreateInfo::vertexCount |
Number of vertices in the mesh.
vector<byte> kanzi::Mesh::CreateInfo::vertexData |
Vertex buffer data.
GPUBuffer::NativeHandle kanzi::Mesh::CreateInfo::vertexBufferHandle |
Native handle to the vertex buffer.
size_t kanzi::Mesh::CreateInfo::instanceSize |
Size of one instance data in bytes.
This is the sum of the sizes of all mesh instance attributes.
unsigned int kanzi::Mesh::CreateInfo::instanceCount |
Number of instances in the mesh.
vector<byte> kanzi::Mesh::CreateInfo::instanceData |
Instance buffer data.
GPUBuffer::NativeHandle kanzi::Mesh::CreateInfo::instanceBufferHandle |
Native handle to the instance buffer.
bool kanzi::Mesh::CreateInfo::takeOwnership |
Indicates whether Kanzi destroys the native handles with the Mesh.
If set to false, you must manage the lifecycle of the native handles.
bool kanzi::Mesh::CreateInfo::uploadDataAtCreation |
Indicates whether to upload vertex and index data when creating the buffer.
PropertyContainer kanzi::Mesh::CreateInfo::properties |
Properties to copy to the mesh.
Currently they are not used.