#include <SkinningInfoVertexAttributeLayer.h>
Inherits EMotionFX::VertexAttributeLayer.
|
enum | { TYPE_ID = 0x00000003
} |
|
|
uint32 | GetType () const override |
|
const char * | GetTypeString () const override |
|
void | AddInfluence (size_t attributeNr, size_t nodeNr, float weight, size_t boneNr=0) |
|
void | RemoveInfluence (size_t attributeNr, size_t influenceNr) |
|
MCORE_INLINE size_t | GetNumInfluences (size_t attributeNr) |
|
MCORE_INLINE SkinInfluence * | GetInfluence (size_t attributeNr, size_t influenceNr) |
|
MCORE_INLINE MCore::Array2D< SkinInfluence > & | GetArray2D () |
|
AZStd::set< uint16 > | CalcLocalJointIndices (AZ::u32 numOrgVertices) |
|
VertexAttributeLayer * | Clone () override |
|
void | SwapAttributes (uint32 attribA, uint32 attribB) override |
|
void | RemapInfluences (size_t oldNodeNr, size_t newNodeNr) |
|
void | RemoveAttributes (uint32 startAttributeNr, uint32 endAttributeNr) override |
|
void | RemoveAllInfluencesForNode (size_t nodeNr) |
|
void | CollectInfluencedNodes (AZStd::vector< uint32 > &influencedNodes, bool clearInfluencedNodesArray=true) |
|
void | OptimizeMemoryUsage () |
|
void | OptimizeInfluences (float tolerance, size_t maxWeights) |
|
void | ResetToOriginalData () override |
|
void | CollapseInfluences (size_t attributeNr) |
|
virtual uint32 | GetType () const =0 |
|
virtual const char * | GetTypeString () const =0 |
|
virtual VertexAttributeLayer * | Clone ()=0 |
|
virtual void * | GetData () |
|
virtual void * | GetOriginalData () |
|
MCORE_INLINE uint32 | GetNumAttributes () const |
|
MCORE_INLINE bool | GetKeepOriginals () const |
|
virtual void | ResetToOriginalData ()=0 |
|
virtual void | SwapAttributes (uint32 attribA, uint32 attribB)=0 |
|
virtual void | RemoveAttributes (uint32 startAttributeNr, uint32 endAttributeNr)=0 |
|
virtual bool | GetIsAbstractDataClass () const |
|
virtual void | Scale (float scaleFactor) |
|
void | SetName (const char *name) |
|
const char * | GetName () const |
|
const AZStd::string & | GetNameString () const |
|
uint32 | GetNameID () const |
|
| BaseObject () |
|
virtual | ~BaseObject () |
|
| MemoryObject () |
|
virtual | ~MemoryObject () |
|
void | IncreaseReferenceCount () |
|
void | DecreaseReferenceCount () |
|
void | Destroy () |
|
uint32 | GetReferenceCount () const |
|
The vertex attribute layer that contains UV texture coordinates. This layer represents an entire UV mapping channel.
◆ AddInfluence()
void EMotionFX::SkinningInfoVertexAttributeLayer::AddInfluence |
( |
size_t |
attributeNr, |
|
|
size_t |
nodeNr, |
|
|
float |
weight, |
|
|
size_t |
boneNr = 0 |
|
) |
| |
Add a given influence (using a bone and a weight).
- Parameters
-
attributeNr | The attribute/vertex number. |
nodeNr | The node in the actor that will be the bone. |
weight | The weight to use in the influence. |
boneNr | The bone number, used for optimizations inside the softskin deformer. |
◆ CalcLocalJointIndices()
AZStd::set< uint16 > EMotionFX::SkinningInfoVertexAttributeLayer::CalcLocalJointIndices |
( |
AZ::u32 |
numOrgVertices | ) |
|
Collect all unique joint indices used by the skin.
- Parameters
-
numOrgVertices | The number of original vertices in the mesh. |
- Returns
- Vector of unique joint indices used by the skinning info layer.
◆ Clone()
◆ CollapseInfluences()
void EMotionFX::SkinningInfoVertexAttributeLayer::CollapseInfluences |
( |
size_t |
attributeNr | ) |
|
Collapse influences that use the same bones to just one influence. If all influences of the attribute are linked to the same bone, it will collapse these into just one influence with a weight of 1, which will have the same visual results. The advantage of this is that CPU skinning will be much faster for those vertices, as just one influence has to be processed. Please note that this function only works if all influences share the same bone. It does not perform any optimizations when there are say 2 influences using bone A and another two influences using bone B. It only optimizes things when all influences are mapped to bone A.
- Parameters
-
attributeNr | The attribute number (original vertex number) to apply this to. |
◆ CollectInfluencedNodes()
void EMotionFX::SkinningInfoVertexAttributeLayer::CollectInfluencedNodes |
( |
AZStd::vector< uint32 > & |
influencedNodes, |
|
|
bool |
clearInfluencedNodesArray = true |
|
) |
| |
Collect all nodes to which the skinning info refers to.
- Parameters
-
influencedNodes | The array to which the node numbers which are influenced by the skinning info will be added. |
clearInfluencedNodesArray | When set to true the given influenced nodes array will be cleared before filling it. |
◆ Create()
The create method.
- Parameters
-
numAttributes | The number of attributes to store inside this layer. |
allocData | When set to true, it will already allocate space for the amount of attributes. |
◆ GetArray2D()
Get direct access to the jagged 2D array that contains the skinning influence data. This can be used in the importers for fast loading and not having to add influence per influence.
- Returns
- A reference to the 2D array containing all the skinning influences.
◆ GetInfluence()
MCORE_INLINE SkinInfluence * EMotionFX::SkinningInfoVertexAttributeLayer::GetInfluence |
( |
size_t |
attributeNr, |
|
|
size_t |
influenceNr |
|
) |
| |
|
inline |
Get a given influence.
- Parameters
-
attributeNr | The attribute/vertex number. |
influenceNr | The influence number, which must be in range of [0..GetNumInfluences()] |
- Returns
- The given influence.
◆ GetNumInfluences()
MCORE_INLINE size_t EMotionFX::SkinningInfoVertexAttributeLayer::GetNumInfluences |
( |
size_t |
attributeNr | ) |
|
|
inline |
Get the number of influences.
- Parameters
-
attributeNr | The attribute/vertex number. |
- Returns
- The number of influences.
◆ GetType()
uint32 EMotionFX::SkinningInfoVertexAttributeLayer::GetType |
( |
| ) |
const |
|
overridevirtual |
Get the unique layer type. This identifies what type of attributes are stored internally. An example could be the type ID of an UV attribute layer, or a layer with colors or one which identifies a layer that contains softskinning information.
- Returns
- The unique type ID, which identifies what type of data is stored inside this layer. Each class inherited from the VertexAttributeLayer class requires a unique type ID.
Implements EMotionFX::VertexAttributeLayer.
◆ GetTypeString()
const char * EMotionFX::SkinningInfoVertexAttributeLayer::GetTypeString |
( |
| ) |
const |
|
overridevirtual |
Get the description of the vertex attributes or layer. You most likely want this to be the class name.
- Returns
- A pointer to the string containing the name or description of the type of vertex attributes of this layer.
Implements EMotionFX::VertexAttributeLayer.
◆ OptimizeInfluences()
void EMotionFX::SkinningInfoVertexAttributeLayer::OptimizeInfluences |
( |
float |
tolerance, |
|
|
size_t |
maxWeights |
|
) |
| |
Optimize the skinning influences & its memory usage. This function assures that the output weights sum up to a value of 1.
- Parameters
-
tolerance | The minimum weight value of an influence, smaller ones will be removed. |
maxWeights | The maximum number of influences per vertex you want to have in the output. |
◆ OptimizeMemoryUsage()
void EMotionFX::SkinningInfoVertexAttributeLayer::OptimizeMemoryUsage |
( |
| ) |
|
Optimize the skinning informations memory usage. This shrinks the skinning influence data as much as possible. This is automatically being called by the importer.
◆ RemapInfluences()
void EMotionFX::SkinningInfoVertexAttributeLayer::RemapInfluences |
( |
size_t |
oldNodeNr, |
|
|
size_t |
newNodeNr |
|
) |
| |
Remap all influences from an old bone to a new bone. This will overwrite all influences linked to the old node and replace the link to the new node.
- Parameters
-
oldNodeNr | The node to search and replace all influence links. |
newNodeNr | The node with which all found influence links will be replaced with. |
◆ RemoveAllInfluencesForNode()
void EMotionFX::SkinningInfoVertexAttributeLayer::RemoveAllInfluencesForNode |
( |
size_t |
nodeNr | ) |
|
Remove all influences which are linked to the given node and optimize the memory usage of the skinning info afterwards.
- Parameters
-
nodeNr | The node in the actor. All influences linked to this node will be removed from the skinning info. |
◆ RemoveAttributes()
void EMotionFX::SkinningInfoVertexAttributeLayer::RemoveAttributes |
( |
uint32 |
startAttributeNr, |
|
|
uint32 |
endAttributeNr |
|
) |
| |
|
overridevirtual |
Remove a range of attributes.
- Parameters
-
startAttributeNr | The start attribute number. |
endAttributeNr | The end attribute number, which will also be removed. |
Implements EMotionFX::VertexAttributeLayer.
◆ RemoveInfluence()
void EMotionFX::SkinningInfoVertexAttributeLayer::RemoveInfluence |
( |
size_t |
attributeNr, |
|
|
size_t |
influenceNr |
|
) |
| |
Remove the given influence. The influences won't be deleted from memory. To get rid of the not used memory call OptimizeMemoryUsage().
- Parameters
-
attributeNr | The attribute/vertex number. |
influenceNr | The influence number |
◆ ResetToOriginalData()
void EMotionFX::SkinningInfoVertexAttributeLayer::ResetToOriginalData |
( |
| ) |
|
|
overridevirtual |
Reset the layer data to it's original data. This is used to restore for example skinned data back into the data as it is in the base pose. The mesh deformers will use this as a starting point then.
Implements EMotionFX::VertexAttributeLayer.
◆ SwapAttributes()
void EMotionFX::SkinningInfoVertexAttributeLayer::SwapAttributes |
( |
uint32 |
attribA, |
|
|
uint32 |
attribB |
|
) |
| |
|
overridevirtual |
Swap the data for two attributes. You specify two attribute numbers, the data for them should be swapped. This is used for our mesh system and will be called by Mesh::SwapVertex as well.
- Parameters
-
attribA | The first attribute number. |
attribB | The second attribute number. |
Implements EMotionFX::VertexAttributeLayer.
The documentation for this class was generated from the following file:
- Gems/EMotionFX/Code/EMotionFX/Source/SkinningInfoVertexAttributeLayer.h