Contains morph weights for a morph.
More...
#include <kanzi/core.ui/graphics3d/morph_runtime.hpp>
|
bool | insertSelectedWeight (size_t index, size_t numMorphs, size_t maxMorphs, float currentWeight, size_t currentMorph) |
| Insert a weight coupled with morph index into a correct location in selected weights and morphs arrays. More...
|
|
| MorphRuntime ()=default |
| Constructor. More...
|
|
| MorphRuntime (const Morph &morph) |
| Constructor. More...
|
|
bool | tryInsertSelectedWeight (size_t numMorphs, size_t maxMorphs, float currentWeight, size_t currentMorph) |
| Tries to insert a weight coupled with morph index into the selected arrays of weights and morphs. More...
|
|
Contains morph weights for a morph.
kanzi::MorphRuntime::MorphRuntime |
( |
| ) |
|
|
explicitprotecteddefault |
kanzi::MorphRuntime::MorphRuntime |
( |
const Morph & |
morph | ) |
|
|
explicitprotected |
Constructor.
- Parameters
-
morph | Source morph to copy. |
Creates a morph runtime.
- Returns
- Uninitialized morph runtime.
- Since
- Kanzi 3.9.6 return type changed to MorphRuntimePtr.
Creates a morph runtime.
- Parameters
-
morph | The morph from which to acquire information when preparing the morph runtime. |
- Returns
- Initialized morph runtime.
- Since
- Kanzi 3.9.6 return type changed to MorphRuntimePtr.
void kanzi::MorphRuntime::initialize |
( |
const Morph & |
morph | ) |
|
Initializes the morph runtime from a morph.
- Parameters
-
morph | The morph from which to acquire information when preparing the morph runtime. |
void kanzi::MorphRuntime::updateSelectedMorphs |
( |
size_t |
maxMorphsFromShader | ) |
|
Updates the selected weights with the most weighted morph targets.
This reorders the selected morph array based on the heaviest morph weights. If the shader can use more morph weights than are available, Kanzi initializes the remaining channels to zero. If the weights have not been modified, this function is NOP.
- Parameters
-
maxMorphsFromShader | Maximum number of morph targets that the shader can use. |
- Since
- Kanzi 3.9.6
-
Kanzi 3.9.7 Removed the return value, changed the type of the maxMorphsFromShader parameter to size_t.
size_t kanzi::MorphRuntime::getTargetCount |
( |
| ) |
const |
|
inline |
Gets the size of the morph runtime.
- Returns
- Number of possible morph targets.
- Since
- Kanzi 3.9.6
-
Kanzi 3.9.7 renamed to getTargetCount and changed the type of the return value to size_t.
const float* kanzi::MorphRuntime::getSelectedWeightData |
( |
| ) |
const |
|
inline |
Gets a float data array of morph weights.
Call updateSelectedMorphs() before you access the weight data.
- Returns
- Floating-point array of morph weights.
- Since
- Kanzi 3.9.6
const int* kanzi::MorphRuntime::getSelectedIndexData |
( |
| ) |
const |
|
inline |
Gets an integer data array of morph indices.
Call updateSelectedMorphs() before you access the index data.
- Returns
- Integer array of morph indices.
- Since
- Kanzi 3.9.7
bool kanzi::MorphRuntime::isDirty |
( |
| ) |
const |
|
inline |
Indicates whether the morph weight selection is dirty.
- Returns
- If the morph weights are dirty, true, otherwise false.
- Since
- Kanzi 3.9.6
size_t kanzi::MorphRuntime::getAppliedMorphArraySize |
( |
| ) |
const |
|
inline |
Gets the size of the morph weight array that Kanzi sent to the GPU.
The size cannot be larger than the number of morph targets that the shader can use. Call updateSelectedMorphs() before you use this value.
- Returns
- Size of applied morph weight array.
- Since
- Kanzi 3.9.7
float kanzi::MorphRuntime::getSelectedWeight |
( |
unsigned int |
selectedMorphIndex | ) |
const |
|
inline |
Gets the selected morph weight at a given index.
Call updateSelectedMorphs() before you access the selected morphs.
- Parameters
-
selectedMorphIndex | Index to fetch. |
- Returns
- Weight at given selection index.
- Since
- Kanzi 3.9.6
unsigned int kanzi::MorphRuntime::getSelectedMorph |
( |
unsigned int |
selectedMorphIndex | ) |
const |
|
inline |
Gets the selected morph at a given index.
Call updateSelectedMorphs() before you access the selected morphs.
- Parameters
-
selectedMorphIndex | The index of the morph that you want get. |
- Returns
- Index to the morph referred to at a given selection index.
- Since
- Kanzi 3.9.6
float kanzi::MorphRuntime::getWeight |
( |
unsigned int |
index | ) |
const |
|
inline |
Gets morph weight at given index.
- Parameters
-
index | Index of the weight. |
- Returns
- Weight at index.
- Since
- Kanzi 3.9.6
void kanzi::MorphRuntime::setWeight |
( |
unsigned int |
index, |
|
|
float |
weight |
|
) |
| |
|
inline |
Sets morph weight at given index.
- Parameters
-
index | Index to set. |
weight | Weight to set. |
- Since
- Kanzi 3.9.6
void kanzi::MorphRuntime::resize |
( |
size_t |
channelCount | ) |
|
|
inline |
Resizes the data array for morph weights.
- Parameters
-
channelCount | The new number of weights. |
bool kanzi::MorphRuntime::tryInsertSelectedWeight |
( |
size_t |
numMorphs, |
|
|
size_t |
maxMorphs, |
|
|
float |
currentWeight, |
|
|
size_t |
currentMorph |
|
) |
| |
|
protected |
Tries to insert a weight coupled with morph index into the selected arrays of weights and morphs.
- Parameters
-
numMorphs | Current number of morphs. |
maxMorphs | Maximum number of morphs. |
currentWeight | Weight to check. |
currentMorph | Morph index associated with the weight. |
- Returns
- If inserting the weight succeeds and the number of weights increases, true, otherwise false.
- Since
- Kanzi 3.9.6
-
Kanzi 3.9.7 changed the type of the numMorphs, maxMorps and currentMorph parameters to size_t.
bool kanzi::MorphRuntime::insertSelectedWeight |
( |
size_t |
index, |
|
|
size_t |
numMorphs, |
|
|
size_t |
maxMorphs, |
|
|
float |
currentWeight, |
|
|
size_t |
currentMorph |
|
) |
| |
|
protected |
Insert a weight coupled with morph index into a correct location in selected weights and morphs arrays.
Called by tryInsertSelectedWeight() for an insertion location.
- Parameters
-
index | Index at which to insert the weight. |
numMorphs | Current number of morphs. |
maxMorphs | Maximum number of morphs. |
currentWeight | Weight to insert. |
currentMorph | Morph index associated with the weight. |
- Returns
- If the number of weights increases, true, otherwise false.
- Since
- Kanzi 3.9.6
-
Kanzi 3.9.7 changed the type of the index, numMorphs, maxMorps and currentMorph parameters to size_t.
vector<float> kanzi::MorphRuntime::m_weights |
|
protected |
vector<float> kanzi::MorphRuntime::m_selectedWeights |
|
protected |
Selected largest morph weights.
vector<int> kanzi::MorphRuntime::m_selectedMorphs |
|
protected |
Selected indices for morph weights.
- Since
- Kanzi 3.9.7 changed to vector<int>
size_t kanzi::MorphRuntime::m_appliedMorphWeightArraySize |
|
protected |
Number of valid morph weight channels selected on last update.
- Since
- Kanzi 3.9.7
bool kanzi::MorphRuntime::m_dirty |
|
protected |
Dirty flag for selected weights arrays.
The documentation for this class was generated from the following file: