Kanzi 4.0.0-beta2
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)
 Copy constructor.
 
 MeshVertexFormat (MeshVertexFormat &&other)
 Move constructor.
 
 MeshVertexFormat (unsigned int vertexAttributeCount)
 Default constructor.
 
MeshVertexFormatoperator= (const MeshVertexFormat &other)
 Copy operator.
 
MeshVertexFormatoperator= (MeshVertexFormat &&other)
 Move operator.
 
void updateSizesAndOffsets ()
 Update sizes and offsets based on existing attributes.
 
void updateStrides ()
 Update strides based on vertex and instance sizes.
 
void updateStrides (unsigned int strideBytes)
 Set stride explicitly and update the attribute strides.
 
 ~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)
inline

Copy constructor.

Parameters
otherSource object.

◆ MeshVertexFormat() [4/4]

kanzi::MeshVertexFormat::MeshVertexFormat ( MeshVertexFormat && other)
inline

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.

◆ updateStrides() [1/2]

void kanzi::MeshVertexFormat::updateStrides ( )
inline

Update strides based on vertex and instance sizes.

This function is not part of updateSizesAndOffsets() since manual stride setting may overriden calculated size.

◆ updateStrides() [2/2]

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

Set stride explicitly and update the attribute strides.

◆ operator=() [1/2]

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

Copy operator.

Parameters
otherSource object.
Returns
This object.

◆ operator=() [2/2]

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

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: