Open 3D Engine EMotionFX Gem API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
EMotionFX::Skeleton Class Reference

Inherits MCore::RefCounted.

Public Member Functions

SkeletonClone ()
 
MCORE_INLINE size_t GetNumNodes () const
 
MCORE_INLINE NodeGetNode (size_t index) const
 
void ReserveNodes (size_t numNodes)
 
void AddNode (Node *node)
 
void RemoveNode (size_t nodeIndex, bool delFromMem=true)
 
void RemoveAllNodes (bool delFromMem=true)
 
MCORE_INLINE const PoseGetBindPose () const
 
MCORE_INLINE PoseGetBindPose ()
 
NodeFindNodeByName (const char *name) const
 
NodeFindNodeByName (const AZStd::string &name) const
 
NodeFindNodeAndIndexByName (const AZStd::string &name, size_t &outIndex) const
 
NodeFindNodeByNameNoCase (const char *name) const
 
NodeFindNodeByID (size_t id) const
 
void SetNode (size_t index, Node *node)
 
void SetNumNodes (size_t numNodes)
 
void UpdateNodeIndexValues (size_t startNode=0)
 
MCORE_INLINE size_t GetNumRootNodes () const
 
MCORE_INLINE size_t GetRootNodeIndex (size_t nr) const
 
void ReserveRootNodes (size_t numNodes)
 
void AddRootNode (size_t nodeIndex)
 
void RemoveRootNode (size_t nr)
 
void RemoveAllRootNodes ()
 
void LogNodes ()
 
size_t CalcHierarchyDepthForNode (size_t nodeIndex) const
 
- Public Member Functions inherited from MCore::RefCounted
 RefCounted ()
 
virtual ~RefCounted ()
 
void IncreaseReferenceCount ()
 
void DecreaseReferenceCount ()
 
void Destroy ()
 
uint32 GetReferenceCount () const
 

Static Public Member Functions

static SkeletonCreate ()
 

Additional Inherited Members

- Protected Member Functions inherited from MCore::RefCounted
virtual void Delete ()
 

Member Function Documentation

◆ AddRootNode()

void EMotionFX::Skeleton::AddRootNode ( size_t  nodeIndex)

Add a root node to the actor. This doesn't modify the node itself, but it will add the node to the list of root nodes.

Parameters
nodeIndexThe node number/index to add and mark as root node inside the actor.

◆ FindNodeAndIndexByName()

Node* EMotionFX::Skeleton::FindNodeAndIndexByName ( const AZStd::string &  name,
size_t &  outIndex 
) const

Find a joint's index and pointer by name.

Parameters
nameThe name of the joint, non case sensitive.
outIndexThis will contain the resulting index, or MCORE_INVALIDINDEX32 in case not found.
Returns
This returns a pointer to the joint or nullptr when not found. In case of a nullptr, the outIndex will be set to MCORE_INVALIDINDEX32 as well.

◆ FindNodeByID()

Node* EMotionFX::Skeleton::FindNodeByID ( size_t  id) const

Search for a node on ID. Returns nullptr when no node found. A node ID is based on the name. So all nodes (also inside other actors) with the same name will have the same ID. This can be used for faster searching, compared to searching by name, which uses string compares.

Parameters
idThe ID to search for.
Returns
A pointer to the node, or nullptr when no node with the given ID found.

◆ FindNodeByName()

Node* EMotionFX::Skeleton::FindNodeByName ( const char *  name) const

Search for a node by name (case sensitive).

Parameters
nameThe name of the node (case sensitive).
Returns
A pointer to the node, returns nullptr when not found.

◆ FindNodeByNameNoCase()

Node* EMotionFX::Skeleton::FindNodeByNameNoCase ( const char *  name) const

Search for a node by name (non case sensitive), returns nullptr when no node can be found. Note: when there are two nodes with the same non case sensitive name, the first one is returned. So if there is a node named "Blah" and one named "BLAH" and we search on "blah", the first one ("Blah") is returned.

Parameters
nameThe name of the node, non case sensitive.
Returns
A pointer to the node with the given name, or nullptr when none could be found.

◆ GetNumRootNodes()

MCORE_INLINE size_t EMotionFX::Skeleton::GetNumRootNodes ( ) const
inline

Get the number of root nodes in the actor. A root node is a node without any parent.

Returns
The number of root nodes inside the actor.

◆ GetRootNodeIndex()

MCORE_INLINE size_t EMotionFX::Skeleton::GetRootNodeIndex ( size_t  nr) const
inline

Get the node number/index of a given root node.

Parameters
nrThe root node number, which must be in range of [0..GetNumRootNodes()-1].
Returns
The node index of the given root node.

◆ RemoveAllRootNodes()

void EMotionFX::Skeleton::RemoveAllRootNodes ( )

Removes all root nodes from the actor. This doesn't remove the actual nodes, but it just unregisters them as root nodes, so that the GetNumRootNodes() method will return a value of zero.

◆ RemoveRootNode()

void EMotionFX::Skeleton::RemoveRootNode ( size_t  nr)

Remove a given root node from the list of root nodes stored inside the actor. This doesn't really remove the node itself, but it just unregisters it as root node inside the actor.

Parameters
nrThe root node to remove, which must be in range of [0..GetNumRootNodes()-1].

◆ ReserveRootNodes()

void EMotionFX::Skeleton::ReserveRootNodes ( size_t  numNodes)

Pre-allocate space for the root nodes array. This does not alter the value returned by GetNumRootNodes() though.

Parameters
numNodesThe absolute number of nodes to pre-allocate space for.

◆ SetNode()

void EMotionFX::Skeleton::SetNode ( size_t  index,
Node node 
)

Set the value of a given node.

Parameters
indexThe node number, which must be in range of [0..GetNumNodes()-1].
nodeThe node value to set at this index.

◆ SetNumNodes()

void EMotionFX::Skeleton::SetNumNodes ( size_t  numNodes)

Set the number of nodes. This resizes the array of pointers to nodes, but doesn't actually create the nodes.

Parameters
numNodesThe number of nodes to allocate space for.

◆ UpdateNodeIndexValues()

void EMotionFX::Skeleton::UpdateNodeIndexValues ( size_t  startNode = 0)

Update all the node index values that are returned by the Node::GetNodeIndex() method. When the order or layout of the nodes array changes, for example after removing a node, the index values of the nodes have to be updated. As node number 5 could become node number 4 in the example case.

Parameters
startNodeThe node number to start updating from.

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