Kanzi 4.1.0
kanzi::MeshVertexFormat Struct Reference

Vertex format information. More...

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

Public Member Functions

void expandForShapeCount (unsigned int shapeCount)
 Expand the vertex format for given shape count.
 
 MeshVertexFormat ()=default
 Default constructor.
 
 MeshVertexFormat (const MeshVertexFormat &other)=default
 Copy constructor.
 
 MeshVertexFormat (MeshVertexFormat &&other)=default
 Move constructor.
 
 MeshVertexFormat (unsigned int vertexAttributeCount)
 Default constructor.
 
MeshVertexFormatoperator= (const MeshVertexFormat &other)=default
 Copy operator.
 
MeshVertexFormatoperator= (MeshVertexFormat &&other)=default
 Move operator.
 
void updateSizesAndOffsets ()
 Update sizes and offsets based on existing attributes.
 
void updateSizesAndOffsetsInterleaved ()
 Update sizes and offsets based on existing attributes.
 
void updateStrides (unsigned int strideBytes)
 Override the calculated vertex size with a larger stride.
 
 ~MeshVertexFormat ()=default
 Destructor.
 

Public Attributes

vector< MeshVertexAttributeattributes
 Vertex attributes.
 
unsigned int instanceSize
 Per-instance size.
 
unsigned int vertexSize
 Per-vertex size.
 

Detailed Description

Vertex format information.

Since
Kanzi 4.0.0

Constructor & Destructor Documentation

◆ MeshVertexFormat() [1/4]

kanzi::MeshVertexFormat::MeshVertexFormat ( )
explicitdefault

Default constructor.

◆ ~MeshVertexFormat()

kanzi::MeshVertexFormat::~MeshVertexFormat ( )
default

Destructor.

◆ MeshVertexFormat() [2/4]

kanzi::MeshVertexFormat::MeshVertexFormat ( unsigned int vertexAttributeCount)
inlineexplicit

Default constructor.

Parameters
vertexAttributeCountInitial size for vertex attribute array.

◆ MeshVertexFormat() [3/4]

kanzi::MeshVertexFormat::MeshVertexFormat ( const MeshVertexFormat & other)
default

Copy constructor.

Parameters
otherSource object.

◆ MeshVertexFormat() [4/4]

kanzi::MeshVertexFormat::MeshVertexFormat ( MeshVertexFormat && other)
default

Move constructor.

Parameters
otherSource object.

Member Function Documentation

◆ expandForShapeCount()

void kanzi::MeshVertexFormat::expandForShapeCount ( unsigned int shapeCount)

Expand the vertex format for given shape count.

All information the vertex format must be for exactly one shape before calling this function.

Parameters
shapeCountNumber of shapes.

◆ updateSizesAndOffsets()

void kanzi::MeshVertexFormat::updateSizesAndOffsets ( )

Update sizes and offsets based on existing attributes.

Kanzi calls this function after either loading the vertex from KZB format or generating it manually in code.

◆ updateSizesAndOffsetsInterleaved()

void kanzi::MeshVertexFormat::updateSizesAndOffsetsInterleaved ( )

Update sizes and offsets based on existing attributes.

Kanzi calls this function after either loading the vertex from KZB format or generating it manually in code.

◆ updateStrides()

void kanzi::MeshVertexFormat::updateStrides ( unsigned int strideBytes)
inline

Override the calculated vertex size with a larger stride.

Use this when vertex data is padded beyond the packed format size.

Parameters
strideBytesExplicit vertex size in bytes. Must be at least the packed vertexSize.

◆ operator=() [1/2]

MeshVertexFormat & kanzi::MeshVertexFormat::operator= ( const MeshVertexFormat & other)
default

Copy operator.

Parameters
otherSource object.
Returns
This object.

◆ operator=() [2/2]

MeshVertexFormat & kanzi::MeshVertexFormat::operator= ( MeshVertexFormat && other)
default

Move operator.

Parameters
otherSource object.
Returns
This object.

Member Data Documentation

◆ attributes

vector<MeshVertexAttribute> kanzi::MeshVertexFormat::attributes

Vertex attributes.

◆ vertexSize

unsigned int kanzi::MeshVertexFormat::vertexSize

Per-vertex size.

◆ instanceSize

unsigned int kanzi::MeshVertexFormat::instanceSize

Per-instance size.


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