Kanzi  3.9.9
Kanzi Engine C++ API
kanzi::MeshVertexAttribute Class Reference

MeshVertexAttribute describes how Kanzi stores mesh vertex and instance data in memory. More...

#include <kanzi/core.ui/graphics3d/graphics_enums.hpp>

Inheritance diagram for kanzi::MeshVertexAttribute:
[legend]

Public Member Functions

 MeshVertexAttribute ()
 Constructor. More...
 
 MeshVertexAttribute (string_view name, Semantic semantic, unsigned int semanticIndex, GraphicsDataType dataType, unsigned int dimension, unsigned int offset)
 Constructor. More...
 
- Public Member Functions inherited from kanzi::VertexAttribute
 VertexAttribute ()=default
 Constructor. More...
 
 VertexAttribute (string_view name, Semantic semantic, unsigned int semanticIndex)
 Constructor. More...
 

Public Attributes

GraphicsDataType dataType
 Attribute data type. More...
 
unsigned int dimension
 Attribute dimension. More...
 
unsigned int divisor
 Attribute divisor. More...
 
unsigned int offset
 Attribute offset. This equals to offset of previous attribute + the size of it. More...
 
unsigned int stride
 Attribute stride. More...
 
- Public Attributes inherited from kanzi::VertexAttribute
string name
 Name of the attribute. Not currently used. More...
 
Semantic semantic
 Attribute semantic. More...
 
unsigned int semanticIndex
 Semantic index. More...
 

Friends

bool operator!= (const MeshVertexAttribute &attribute1, const MeshVertexAttribute &attribute2)
 
bool operator== (const MeshVertexAttribute &attribute1, const MeshVertexAttribute &attribute2)
 
void swap (MeshVertexAttribute &attribute1, MeshVertexAttribute &attribute2)
 

Additional Inherited Members

- Public Types inherited from kanzi::VertexAttribute
enum  Semantic {
  SemanticPosition, SemanticNormal, SemanticTangent, SemanticTextureCoordinate,
  SemanticColor, SemanticWeight, SemanticMatrixPalette, SemanticBitangent,
  SemanticCount, SemanticCustom, SemanticInvalid
}
 Specifies the available vertex attributes. More...
 

Detailed Description

MeshVertexAttribute describes how Kanzi stores mesh vertex and instance data in memory.

Since MeshVertexAttribute is derived from VertexAttribute, it has a name, a semantic, and a semantic index. Each mesh attribute also has:

  • Data type
  • Dimension
  • Offset
  • Stride
  • Divisor

Together these specify how vertex data is formatted in memory.

Instance attributes are similar to vertex attributes, but have a divisor set to a non-zero value, and are shared by all vertices of an instance. The divisor value indicates how many instances share the same attribute values. Value 1 means that every instance gets a new value. Value 2 means that two instances share the values and every other instance gets new values, and so on.

Constructor & Destructor Documentation

kanzi::MeshVertexAttribute::MeshVertexAttribute ( )
inlineexplicit

Constructor.

kanzi::MeshVertexAttribute::MeshVertexAttribute ( string_view  name,
Semantic  semantic,
unsigned int  semanticIndex,
GraphicsDataType  dataType,
unsigned int  dimension,
unsigned int  offset 
)
inlineexplicit

Constructor.

Note
Stride is not valid after constructor, and should be set afterwards.
Parameters
nameName of vertex attribute.
semanticSemantic of vertex attribute.
semanticIndexSemantic index of vertex attribute.
dataTypeDatatype of vertex attribute.
dimensionDimension of vertex attribute.
offsetOffset of vertex attribute.

Friends And Related Function Documentation

void swap ( MeshVertexAttribute attribute1,
MeshVertexAttribute attribute2 
)
friend
bool operator== ( const MeshVertexAttribute attribute1,
const MeshVertexAttribute attribute2 
)
friend
bool operator!= ( const MeshVertexAttribute attribute1,
const MeshVertexAttribute attribute2 
)
friend

Member Data Documentation

GraphicsDataType kanzi::MeshVertexAttribute::dataType

Attribute data type.

unsigned int kanzi::MeshVertexAttribute::dimension

Attribute dimension.

unsigned int kanzi::MeshVertexAttribute::offset

Attribute offset. This equals to offset of previous attribute + the size of it.

unsigned int kanzi::MeshVertexAttribute::stride

Attribute stride.

unsigned int kanzi::MeshVertexAttribute::divisor

Attribute divisor.

Value 0 for vertex attributes, 1+ for instance attributes.

Since
Kanzi 3.9.6

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