#include <Actor.h>
Classes | |
struct | Dependency |
struct | NodeMirrorInfo |
Public Member Functions | |
Actor (const char *name) | |
MCORE_INLINE uint32 | GetID () const |
MCORE_INLINE void | SetID (uint32 id) |
void | AddNode (Node *node) |
Node * | AddNode (size_t nodeIndex, const char *name, size_t parentIndex=InvalidIndex) |
void | RemoveNode (size_t nr, bool delMem=true) |
void | DeleteAllNodes () |
AZStd::unique_ptr< Actor > | Clone () const |
void | Scale (float scaleFactor) |
void | ScaleToUnitType (MCore::Distance::EUnitType targetUnitType) |
Node * | FindBestMotionExtractionNode () const |
void | AutoSetMotionExtractionNode () |
void | GenerateUpdatePathToRoot (size_t endNodeIndex, AZStd::vector< size_t > &outPath) const |
void | SetMotionExtractionNode (Node *node) |
void | SetMotionExtractionNodeIndex (size_t nodeIndex) |
Node * | GetMotionExtractionNode () const |
MCORE_INLINE size_t | GetMotionExtractionNodeIndex () const |
bool | CheckIfHasMeshes (size_t lodLevel) const |
bool | CheckIfHasSkinnedMeshes (size_t lodLevel) const |
void | ExtractBoneList (size_t lodLevel, AZStd::vector< size_t > *outBoneList) const |
void | SetPhysicsSetup (const AZStd::shared_ptr< PhysicsSetup > &physicsSetup) |
const AZStd::shared_ptr< PhysicsSetup > & | GetPhysicsSetup () const |
void | SetSimulatedObjectSetup (const AZStd::shared_ptr< SimulatedObjectSetup > &setup) |
const AZStd::shared_ptr< SimulatedObjectSetup > & | GetSimulatedObjectSetup () const |
void | AddLODLevel (bool copyFromLastLODLevel=true) |
void | CopyLODLevel (Actor *copyActor, size_t copyLODLevel, size_t replaceLODLevel, bool copySkeletalLODFlags) |
void | InsertLODLevel (size_t insertAt) |
void | SetNumLODLevels (size_t numLODs, bool adjustMorphSetup=true) |
size_t | GetNumLODLevels () const |
void | RemoveAllNodeMeshes () |
void | CalcMeshTotals (size_t lodLevel, uint32 *outNumPolygons, uint32 *outNumVertices, uint32 *outNumIndices) const |
void | CalcStaticMeshTotals (size_t lodLevel, uint32 *outNumVertices, uint32 *outNumIndices) |
void | CalcDeformableMeshTotals (size_t lodLevel, uint32 *outNumVertices, uint32 *outNumIndices) |
size_t | CalcMaxNumInfluences (size_t lodLevel) const |
size_t | CalcMaxNumInfluences (size_t lodLevel, AZStd::vector< size_t > &outVertexCounts) const |
void | VerifySkinning (AZStd::vector< uint8 > &conflictNodeFlags, size_t skeletalLODLevel, size_t geometryLODLevel) |
void * | GetCustomData () const |
void | SetCustomData (void *dataPointer) |
void | SetName (const char *name) |
const char * | GetName () const |
const AZStd::string & | GetNameString () const |
void | SetFileName (const char *filename) |
const char * | GetFileName () const |
const AZStd::string & | GetFileNameString () const |
void | AddDependency (const Dependency &dependency) |
MCORE_INLINE size_t | GetNumDependencies () const |
MCORE_INLINE Dependency * | GetDependency (size_t nr) |
MCORE_INLINE const Dependency * | GetDependency (size_t nr) const |
void | RecursiveAddDependencies (const Actor *actor) |
MCORE_INLINE MorphSetup * | GetMorphSetup (size_t geomLODLevel) const |
void | RemoveAllMorphSetups (bool deleteMeshDeformers=true) |
void | SetMorphSetup (size_t lodLevel, MorphSetup *setup) |
size_t | GetNumNodeGroups () const |
NodeGroup * | GetNodeGroup (size_t index) const |
void | AddNodeGroup (NodeGroup *newGroup) |
void | RemoveNodeGroup (size_t index, bool delFromMem=true) |
void | RemoveNodeGroup (NodeGroup *group, bool delFromMem=true) |
size_t | FindNodeGroupIndexByName (const char *groupName) const |
size_t | FindNodeGroupIndexByNameNoCase (const char *groupName) const |
NodeGroup * | FindNodeGroupByName (const char *groupName) const |
NodeGroup * | FindNodeGroupByNameNoCase (const char *groupName) const |
void | RemoveAllNodeGroups () |
void | AllocateNodeMirrorInfos () |
void | RemoveNodeMirrorInfos () |
MCORE_INLINE NodeMirrorInfo & | GetNodeMirrorInfo (size_t nodeIndex) |
MCORE_INLINE const NodeMirrorInfo & | GetNodeMirrorInfo (size_t nodeIndex) const |
MCORE_INLINE bool | GetHasMirrorInfo () const |
void | MatchNodeMotionSources (const char *subStringA, const char *subStringB) |
bool | MapNodeMotionSource (const char *sourceNodeName, const char *destNodeName) |
bool | MapNodeMotionSource (uint16 sourceNodeIndex, uint16 targetNodeIndex) |
uint16 | FindBestMatchForNode (const char *nodeName, const char *subStringA, const char *subStringB, bool firstPass=true) const |
void | MatchNodeMotionSourcesGeometrical () |
uint16 | FindBestMirrorMatchForNode (uint16 nodeIndex, Pose &pose) const |
void | SetDirtyFlag (bool dirty) |
bool | GetDirtyFlag () const |
void | SetIsUsedForVisualization (bool flag) |
bool | GetIsUsedForVisualization () const |
size_t | FindFirstActiveParentBone (size_t skeletalLOD, size_t startNodeIndex) const |
void | MakeGeomLODsCompatibleWithSkeletalLODs () |
void | ReinitializeMeshDeformers () |
void | PostCreateInit (bool makeGeomLodsCompatibleWithSkeletalLODs=true, bool convertUnitType=true) |
void | AutoDetectMirrorAxes () |
const AZStd::vector< NodeMirrorInfo > & | GetNodeMirrorInfos () const |
AZStd::vector< NodeMirrorInfo > & | GetNodeMirrorInfos () |
void | SetNodeMirrorInfos (const AZStd::vector< NodeMirrorInfo > &mirrorInfos) |
bool | GetHasMirrorAxesDetected () const |
MCORE_INLINE const AZStd::vector< Transform > & | GetInverseBindPoseTransforms () const |
MCORE_INLINE Pose * | GetBindPose () |
MCORE_INLINE const Pose * | GetBindPose () const |
MCORE_INLINE const Transform & | GetInverseBindPoseTransform (size_t nodeIndex) const |
void | ReleaseTransformData () |
void | ResizeTransformData () |
void | CopyTransformsFrom (const Actor *other) |
const AZ::Aabb & | GetStaticAabb () const |
void | SetStaticAabb (const AZ::Aabb &aabb) |
void | UpdateStaticAabb () |
void | SetThreadIndex (uint32 index) |
uint32 | GetThreadIndex () const |
Mesh * | GetMesh (size_t lodLevel, size_t nodeIndex) const |
MeshDeformerStack * | GetMeshDeformerStack (size_t lodLevel, size_t nodeIndex) const |
void | FindMostInfluencedMeshPoints (const Node *node, AZStd::vector< AZ::Vector3 > &outPoints) const |
MCORE_INLINE Skeleton * | GetSkeleton () const |
MCORE_INLINE size_t | GetNumNodes () const |
void | SetMesh (size_t lodLevel, size_t nodeIndex, Mesh *mesh) |
void | SetMeshDeformerStack (size_t lodLevel, size_t nodeIndex, MeshDeformerStack *stack) |
bool | CheckIfHasMorphDeformer (size_t lodLevel, size_t nodeIndex) const |
bool | CheckIfHasSkinningDeformer (size_t lodLevel, size_t nodeIndex) const |
void | RemoveNodeMeshForLOD (size_t lodLevel, size_t nodeIndex, bool destroyMesh=true) |
void | SetNumNodes (size_t numNodes) |
void | SetUnitType (MCore::Distance::EUnitType unitType) |
MCore::Distance::EUnitType | GetUnitType () const |
void | SetFileUnitType (MCore::Distance::EUnitType unitType) |
MCore::Distance::EUnitType | GetFileUnitType () const |
EAxis | FindBestMatchingMotionExtractionAxis () const |
MCORE_INLINE size_t | GetRetargetRootNodeIndex () const |
MCORE_INLINE Node * | GetRetargetRootNode () const |
void | SetRetargetRootNodeIndex (size_t nodeIndex) |
void | SetRetargetRootNode (Node *node) |
void | AutoSetupSkeletalLODsBasedOnSkinningData (const AZStd::vector< AZStd::string > &alwaysIncludeJoints) |
void | PrintSkeletonLODs () |
void | GenerateOptimizedSkeleton () |
void | SetOptimizeSkeleton (bool optimizeSkeleton) |
bool | GetOptimizeSkeleton () const |
void | SetMeshAssetId (const AZ::Data::AssetId &assetId) |
AZ::Data::AssetId | GetMeshAssetId () const |
const AZ::Data::Asset< AZ::RPI::ModelAsset > & | GetMeshAsset () const |
const AZ::Data::Asset< AZ::RPI::SkinMetaAsset > & | GetSkinMetaAsset () const |
const AZ::Data::Asset< AZ::RPI::MorphTargetMetaAsset > & | GetMorphTargetMetaAsset () const |
const AZStd::unordered_map< AZ::u16, AZ::u16 > & | GetSkinToSkeletonIndexMap () const |
bool | IsReady () const |
void | Finalize (LoadRequirement loadReq=LoadRequirement::AllowAsyncLoad) |
The actor is the representation of a completely animatable object, like a human character or an animal. It represents a (read only) shared data object, from which ActorInstance objects can be created. The actor instance objects are used as characters in the game and can all be controlled individually, while they still share the same data from the Actor class. The Actor contains information about the hierarchy/structure of the characters.
|
explicit |
name | The name of the actor. |
void EMotionFX::Actor::AddDependency | ( | const Dependency & | dependency | ) |
Add a dependency to the actor. Dependencies are used to identify on what other actor objects this actor relies. This can be because this actor uses meshes or transforms that are stored inside the other actor.
dependency | The dependency to add. |
void EMotionFX::Actor::AddLODLevel | ( | bool | copyFromLastLODLevel = true | ) |
Add a LOD level.
[in] | copyFromLastLevelLOD | True in case the new LOD level should contain the same meshes as the last LOD level. In case of false the meshes and everything won't be copied over. |
void EMotionFX::Actor::AddNode | ( | Node * | node | ) |
Add a node to this actor.
node | The node to add. |
Node * EMotionFX::Actor::AddNode | ( | size_t | nodeIndex, |
const char * | name, | ||
size_t | parentIndex = InvalidIndex |
||
) |
Add a node to this actor.
void EMotionFX::Actor::AddNodeGroup | ( | NodeGroup * | newGroup | ) |
Add a node group.
newGroup | The new node group to add. |
void EMotionFX::Actor::AllocateNodeMirrorInfos | ( | ) |
Allocate data for the node motion mirror info. This resizes the array of node motion infos and initializes it on default values.
void EMotionFX::Actor::AutoSetMotionExtractionNode | ( | ) |
Automatically find the best motion extraction node, using FindBestMotionExtractionNode and set it as current motion extraction node.
void EMotionFX::Actor::CalcDeformableMeshTotals | ( | size_t | lodLevel, |
uint32 * | outNumVertices, | ||
uint32 * | outNumIndices | ||
) |
Calculates the total number of vertices and indices of all DEFORMABLE node meshes for the given LOD. With deformable we mean meshes that are being modified by mesh deformers, such as skinning or morphing deformers. The number of faces can be calculated by dividing the resulting number of indices by 3.
lodLevel | The LOD level, where 0 is the highest detail LOD level. This value must be in range of [0..GetNumLODLevels()-1]. |
outNumVertices | The integer to write the number of vertices in. |
outNumIndices | The integer to write the number of indices in. |
size_t EMotionFX::Actor::CalcMaxNumInfluences | ( | size_t | lodLevel | ) | const |
Calculates the maximum number of bone influences. This is calculated by for each vertex checking the number of bone influences, and take the maximum of that amount.
lodLevel | The LOD level, where 0 is the highest detail LOD level. This value must be in range of [0..GetNumLODLevels()-1]. |
size_t EMotionFX::Actor::CalcMaxNumInfluences | ( | size_t | lodLevel, |
AZStd::vector< size_t > & | outVertexCounts | ||
) | const |
Calculates the maximum number of bone influences. Also provides an array containing the number of vertices for each number of influences.
lodLevel | The LOD level, where 0 is the highest detail LOD level. This value must be in range of [0..GetNumLODLevels()-1]. |
vertexCounts | An output array, which will contain for each number of influences, the number of vertices with this number of influences. In other words, the first element of the array will contain the number of vertices, which have 0 influences. The next element in the array will contain the number of vertices, which are influenced by exactly 1 bone, etc. |
lodLevel | The detail level to calculate the results for. A value of 0 is the highest detail. |
void EMotionFX::Actor::CalcMeshTotals | ( | size_t | lodLevel, |
uint32 * | outNumPolygons, | ||
uint32 * | outNumVertices, | ||
uint32 * | outNumIndices | ||
) | const |
Calculates the total number of vertices and indices of all node meshes for the given LOD.
lodLevel | The LOD level, where 0 is the highest detail LOD level. This value must be in range of [0..GetNumLODLevels()-1]. |
outNumPolygons | The integer to write the number of polygons in. |
outNumVertices | The integer to write the number of vertices in. |
outNumIndices | The integer to write the number of indices in. |
void EMotionFX::Actor::CalcStaticMeshTotals | ( | size_t | lodLevel, |
uint32 * | outNumVertices, | ||
uint32 * | outNumIndices | ||
) |
Calculates the total number of vertices and indices of all STATIC node meshes for the given LOD. With static we mean the meshes that are NOT effected by any deformers, so which are completely rigid.
lodLevel | The LOD level, where 0 is the highest detail LOD level. This value must be in range of [0..GetNumLODLevels()-1]. |
outNumVertices | The integer to write the number of vertices in. |
outNumIndices | The integer to write the number of indices in. |
bool EMotionFX::Actor::CheckIfHasMeshes | ( | size_t | lodLevel | ) | const |
Check if this actor contains any nodes that have meshes.
lodLevel | The LOD level to check for. |
bool EMotionFX::Actor::CheckIfHasSkinnedMeshes | ( | size_t | lodLevel | ) | const |
Check if we have skinned meshes.
lodLevel | The LOD level to check for. |
AZStd::unique_ptr< Actor > EMotionFX::Actor::Clone | ( | ) | const |
Clones this actor.
void EMotionFX::Actor::CopyLODLevel | ( | Actor * | copyActor, |
size_t | copyLODLevel, | ||
size_t | replaceLODLevel, | ||
bool | copySkeletalLODFlags | ||
) |
Copy data from a given LOD level to another one. This will copy the skeletal LOD flag for the nodes, copy over the meshes and their deformer stacks, the materials as well as the whole morph setup.
[in] | copyActor | The actor to copy the LOD level from. |
[in] | copyLODLevel | The LOD level from which we get the data from. |
[in] | replaceLODLevel | The LOD level to which we copy the data to. |
[in] | copySkeletalLODFlags | Copy over the skeletal LOD flags in case of true, skip them in case of false. |
[in] | delLODActorFromMem | When set to true, the method will automatically delete the given copyActor from memory. |
void EMotionFX::Actor::DeleteAllNodes | ( | ) |
Remove all nodes from memory.
void EMotionFX::Actor::ExtractBoneList | ( | size_t | lodLevel, |
AZStd::vector< size_t > * | outBoneList | ||
) | const |
Extract a list with nodes that represent bones. Not all nodes inside an actor have to be bones. With bones we mean nodes that appear inside the skinning information of the meshes. So nodes that have vertices linked to them. Extracting this information is not fast, so shouldn't be done inside a loop.
lodLevel | The LOD level, which must be in range of 0..GetNumLODLevels(). |
outBoneList | The array of indices to nodes that will be filled with the nodes that are bones. When the outBoneList array already contains items, the array will first be cleared, so all existing contents will be lost. |
void EMotionFX::Actor::Finalize | ( | LoadRequirement | loadReq = LoadRequirement::AllowAsyncLoad | ) |
Finalize the actor with preload assets (mesh, skinmeta and morph target assets). LoadRequirement - We won't need a blocking load if the actor is part of the actor asset, as that will trigger the preload assets to load and get ready before finalize has been reached. However, if we are calling this on an actor that bypassed the asset system (e.g loading the actor directly from disk), it will require a blocking load. This option is now being used because emfx editor does not fully integrate with the asset system.
uint16 EMotionFX::Actor::FindBestMatchForNode | ( | const char * | nodeName, |
const char * | subStringA, | ||
const char * | subStringB, | ||
bool | firstPass = true |
||
) | const |
Find the best match for a given node, using two substrings. For example, if you use the node name "Right Leg" and you use as subStringA "Right" and as subStringB "Left", then it will result most likely (asssuming that node exists) in the node with the name "Left Leg". You can use this to guess the most most likely match for a given node, when using motion mirroring. Please note that artists can all setup this already. If you want to do it manually you might also want to use the MatchNodeMotionSources function instead.
nodeName | The name of the node to find the counter-mirror-node for. |
subStringA | The first substring, for example "Left". |
subStringB | The second substring, for example "Right". |
firstPass | Basically just set this to true always, which is also its default. |
Node * EMotionFX::Actor::FindBestMotionExtractionNode | ( | ) | const |
Try to find the best motion extraction node automatically. It picks the node with the most number of child nodes down the hierarchy below that node.
size_t EMotionFX::Actor::FindFirstActiveParentBone | ( | size_t | skeletalLOD, |
size_t | startNodeIndex | ||
) | const |
Recursively find the parent bone that is enabled in a given LOD, starting from a given node. For example if you have a finger bone, while the finger bones are disabled in the skeletal LOD, this function will return the index to the hand bone. This is because the hand bone will most likely be the first active bone in that LOD, when moving up the hierarchy.
skeletalLOD | The skeletal LOD level to search in. |
startNodeIndex | The node to start looking at, for example the node index of the finger bone. |
void EMotionFX::Actor::FindMostInfluencedMeshPoints | ( | const Node * | node, |
AZStd::vector< AZ::Vector3 > & | outPoints | ||
) | const |
Finds the mesh points for which the specified node is the node with the highest influence. This is a pretty expensive function which is only intended for use in the editor. The resulting points will be given in model space.
node | The node for which the most heavily influenced mesh points are sought. | |
[out] | outPoints | Container which will be filled with the points for which the node is the heaviest influence. |
NodeGroup * EMotionFX::Actor::FindNodeGroupByName | ( | const char * | groupName | ) | const |
Find a node group by its name.
groupName | The name of the group to search for. This is case sensitive. |
NodeGroup * EMotionFX::Actor::FindNodeGroupByNameNoCase | ( | const char * | groupName | ) | const |
Find a node group by its name, but without case sensitivity.
groupName | The name of the group to search for. This is NOT case sensitive. |
size_t EMotionFX::Actor::FindNodeGroupIndexByName | ( | const char * | groupName | ) | const |
Find a node group index by its name.
groupName | The name of the group to search for. This is case sensitive. |
size_t EMotionFX::Actor::FindNodeGroupIndexByNameNoCase | ( | const char * | groupName | ) | const |
Find a group index by its name, on a non-case sensitive way.
groupName | The name of the group to search for. This is NOT case sensitive. |
void EMotionFX::Actor::GenerateUpdatePathToRoot | ( | size_t | endNodeIndex, |
AZStd::vector< size_t > & | outPath | ||
) | const |
Generate an update path from a given node towards the root. The first element in the array will be the end node index, the next node will be its parent node, etc. So the last node will be the root node.
endNodeIndex | The node index to generate the path to. |
outPath | the array that will contain the path. |
void * EMotionFX::Actor::GetCustomData | ( | ) | const |
Get a pointer to the custom data you stored. Custom data can for example link a game or engine object with this EMotion FX actor object. An example is when EMotion FX triggers a motion event. You know the actor that triggered the event, but you don't know directly what game or engine object is linked to this actor. By using the custom data methods GetCustomData and SetCustomData you can set a pointer to your game or engine object in each actor. The pointer that you specify will not be deleted when the actor object is being destructed.
|
inline |
Get a given dependency.
nr | The dependency number, which must be in range of [0..GetNumDependencies()-1]. |
bool EMotionFX::Actor::GetDirtyFlag | ( | ) | const |
Get the dirty flag which indicates whether the user has made changes to the actor or not. This indicator is set to true when the user changed something like adding a new node group. When the user saves the actor, the indicator is usually set to false.
const char * EMotionFX::Actor::GetFileName | ( | ) | const |
Get the filename of the actor.
const AZStd::string & EMotionFX::Actor::GetFileNameString | ( | ) | const |
Returns the filename of the actor, as a AZStd::string object.
|
inline |
Get the unique identification number for the actor.
|
inline |
Get the inverse bind pose (in world space) transform of a given joint.
jointIndex | The joint number, which must be in range of [0..GetNumNodes()-1]. |
|
inline |
Get the morph setup at a given geometry LOD level.
geomLODLevel | The geometry LOD level, which must be in range of [0..GetNumLODLevels()]. |
Node * EMotionFX::Actor::GetMotionExtractionNode | ( | ) | const |
Get the motion extraction node.
|
inline |
Get the motion extraction node index.
const char * EMotionFX::Actor::GetName | ( | ) | const |
Get the name of the actor.
const AZStd::string & EMotionFX::Actor::GetNameString | ( | ) | const |
Get the name of the actor as a Core string object.
NodeGroup * EMotionFX::Actor::GetNodeGroup | ( | size_t | index | ) | const |
Get a pointer to a given node group.
index | The node group index, which must be in range of [0..GetNumNodeGroups()-1]. |
|
inline |
Get the mirror info for a given node.
nodeIndex | The node index to get the info for. |
|
inline |
Get the mirror info for a given node.
nodeIndex | The node index to get the info for. |
|
inline |
Get the number of dependencies.
size_t EMotionFX::Actor::GetNumLODLevels | ( | ) | const |
Get the number of LOD levels inside this actor.
size_t EMotionFX::Actor::GetNumNodeGroups | ( | ) | const |
Get the number of node groups inside this actor object.
void EMotionFX::Actor::InsertLODLevel | ( | size_t | insertAt | ) |
Insert LOD level at the given position. This function will not copy any meshes, deformer, morph targets or materials but just insert an empty LOD level.
[in] | insertAt | The position to insert the new LOD level. |
|
inline |
Is the actor fully ready?
void EMotionFX::Actor::MakeGeomLODsCompatibleWithSkeletalLODs | ( | ) |
Make the geometry LOD levels compatible with the skinning LOD levels. This means that it modifies the skinning information so that disabled bones are not used by the meshes anymore. Instead, the skinning influences are remapped to the first enabled parent bone. So if you disable all finger bones in a given LOD, it will adjust the skinning influences so that the vertices of the fingers are linked to the hand bone instead.
bool EMotionFX::Actor::MapNodeMotionSource | ( | const char * | sourceNodeName, |
const char * | destNodeName | ||
) |
Map two nodes to eachother for motion mirroring. This could be used to tell to play the motion for the right arm on the left arm. The parameters you would give would be like: "Left Arm" and "Right Arm" in that case.
sourceNodeName | The name of the first node, for example "Left Hand". |
destNodeName | The name of the second node, for example "Right Hand". |
void EMotionFX::Actor::MatchNodeMotionSources | ( | const char * | subStringA, |
const char * | subStringB | ||
) |
Match and map the motion sources of given nodes, based on two substrings. This is used for motion mirroring, where we want to play the motion of the left arm on the right arm for example. If you have nodes named like "Left Leg", "Left Arm" "My Left Foot" and "My Right Foot", "Right Leg" and "Right Arm", then you can use the following substrings as parameters to match everything automatically: subStringA="Left" and subStringB="Right". Nodes that have no mirrored match (for example the spine bones) will mirror their own transforms when mirroring is enabled. It doesn't matter if you put the "left" or "right" substring inside subStringA or subStringB. The order of them doesn't matter. Also please note that artists can already setup all this, so your model is probably already prepared for mirroring once loaded if you are planning to use motion mirroring.
subStringA | The first substring, which could be something like "Left" or "Bip01 " or " L ". |
subStringB | The second substring, which could be something like "Right" or "Bip01 R" or " R ". |
void EMotionFX::Actor::RecursiveAddDependencies | ( | const Actor * | actor | ) |
Recursively add dependencies that this actor has on other actors. This adds the dependencies of the actors on which we currently have dependencies, and that recursively. So after executing this, the current actor contains all dependencies of all the actors it is dependent on.
actor | The actor to create the dependencies for. |
void EMotionFX::Actor::RemoveAllMorphSetups | ( | bool | deleteMeshDeformers = true | ) |
Remove all morph setups. Morph setups contain all morph targtets.
deleteMeshDeformers | When set to true (default), mesh deformers, such as the morphing deformer, will be deleted from all nodes. |
void EMotionFX::Actor::RemoveAllNodeGroups | ( | ) |
Remove all node groups from this actor. This also deletes the groups from memory.
void EMotionFX::Actor::RemoveAllNodeMeshes | ( | ) |
Removes all meshes from all nodes inside this actor. This means all memory will be released and pointers to the meshes will not be valid anymore. Also all mesh deformer stacks will be removed.
void EMotionFX::Actor::RemoveNode | ( | size_t | nr, |
bool | delMem = true |
||
) |
Remove a given node.
nr | The node to remove. |
delMem | If true the allocated memory of the node will be deleted. |
void EMotionFX::Actor::RemoveNodeGroup | ( | NodeGroup * | group, |
bool | delFromMem = true |
||
) |
Remove a given node group by its pointer.
group | The node group to remove. Please keep in mind that this group should really be part of this actor. |
delFromMem | Set to true (default) when you wish to also delete the specified group from memory. Even if this group is not part of this actor and delFromMem is set to true, the group will be deleted from memory. |
void EMotionFX::Actor::RemoveNodeGroup | ( | size_t | index, |
bool | delFromMem = true |
||
) |
Remove a given node group by its index.
index | The node group number to remove. This value must be in range of [0..GetNumNodeGroups()-1]. |
delFromMem | Set to true (default) when you wish to also delete the specified group from memory. |
void EMotionFX::Actor::RemoveNodeMirrorInfos | ( | ) |
Remove memory for the motion node source array. If the motion node source array has not been allocated before it will do nothing at all.
void EMotionFX::Actor::Scale | ( | float | scaleFactor | ) |
Scale all transform and mesh positional data. This is a very slow operation and is used to convert between different unit systems (cm, meters, etc).
scaleFactor | The scale factor to scale the current data by. |
void EMotionFX::Actor::ScaleToUnitType | ( | MCore::Distance::EUnitType | targetUnitType | ) |
Scale to a given unit type. This method does nothing if the actor is already in this unit type. You can check what the current unit type is with the GetUnitType() method.
targetUnitType | The unit type to scale into (meters, centimeters, etc). |
void EMotionFX::Actor::SetCustomData | ( | void * | dataPointer | ) |
Get a pointer to the custom data you stored. Custom data can for example link a game or engine object with this EMotion FX actor object. An example is when EMotion FX triggers a motion event. You know the actor that triggered the event, but you don't know directly what game or engine object is linked to this actor. By using the custom data methods GetCustomData and SetCustomData you can set a pointer to your game or engine object in each actor. The pointer that you specify will not be deleted when the actor object is being destructed.
dataPointer | A void pointer to the custom data, which could for example be your engine or game object that is linked to this actor. |
void EMotionFX::Actor::SetDirtyFlag | ( | bool | dirty | ) |
Set the dirty flag which indicates whether the user has made changes to the actor or not. This indicator is set to true when the user changed something like adding a new node group. When the user saves the actor, the indicator is usually set to false.
dirty | The dirty flag. |
void EMotionFX::Actor::SetFileName | ( | const char * | filename | ) |
Set the filename of the actor.
[in] | filename | The filename of the actor. |
|
inline |
Set the unique identification number for the actor instance.
[in] | id | The unique identification number. |
void EMotionFX::Actor::SetMorphSetup | ( | size_t | lodLevel, |
MorphSetup * | setup | ||
) |
Set the morph setup for a given geometry LOD level. It is possible to set the setup for a given LOD level to nullptr. If the setup is nullptr, no morphing is being processed for the given LOD.
lodLevel | The LOD level, which must be in range of [0..GetNumLODLevels()-1]. |
setup | The morph setup for this LOD. |
void EMotionFX::Actor::SetMotionExtractionNode | ( | Node * | node | ) |
Set the motion extraction node. This is the node from which we filter the motion. Most likely the hips node. The filtered motion of this node is applied to the actor instance. You can set the node to nullptr in case you want to disable motion extraction.
node | The motion extraction node, or nullptr to disable it. |
void EMotionFX::Actor::SetMotionExtractionNodeIndex | ( | size_t | nodeIndex | ) |
Set the motion extraction node index. This is the node from which we filter the motion. Most likely the hips node. The filtered motion of this node is applied to the actor instance. You can set the node to MCORE_INVALIDINDEX32 in case you want to disable motion extraction.
nodeIndex | The motion extraction node, or MCORE_INVALIDINDEX32 to disable it. |
void EMotionFX::Actor::SetName | ( | const char * | name | ) |
Set the name of the actor.
name | The name of the actor. |
void EMotionFX::Actor::SetNumLODLevels | ( | size_t | numLODs, |
bool | adjustMorphSetup = true |
||
) |
Set the number of LOD levels. This will be called by the importer. Do not use manually.
void EMotionFX::Actor::UpdateStaticAabb | ( | ) |
Sets the static aabb and expects to have the model asset ready.
void EMotionFX::Actor::VerifySkinning | ( | AZStd::vector< uint8 > & | conflictNodeFlags, |
size_t | skeletalLODLevel, | ||
size_t | geometryLODLevel | ||
) |
Verify if the skinning will look correctly in the given geometry LOD for a given skeletal LOD level. As the skeletal LOD system can disable nodes entirely the skinning info of a mesh might be linked to a disabled node. This will end up in in an incorrectly deformed mesh.
conflictNodeFlags | The array of flags that indicate whether a node is used by the skinning info of the geometry LOD level but is disabled by the given skeletal LOD level. Nodes which have an enabled state after calling the function will be nodes that are responsible for bad skinning. The size of the array will always be equal to the number of nodes. So if the conflictNodeFlags[myNodeNr] equals 1 you know there is a conflict, while everything is alright if the value is 0. |
skeletalLODLevel | The skeletal LOD level to be verified. The skinning influences will be tested against disabled nodes from the given skeletal LOD level. |
geometryLODLevel | The geometry LOD level to test the skeletal LOD against with. |