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::AttachmentNode Class Reference

#include <AttachmentNode.h>

Inherits EMotionFX::Attachment.

Public Types

enum  { TYPE_ID = 0x00000001 }
 

Public Member Functions

uint32 GetType () const override
 
const char * GetTypeString () const override
 
bool GetIsInfluencedByMultipleJoints () const override final
 
size_t GetAttachToNodeIndex () const
 
bool GetIsManagedExternally () const
 
void SetIsManagedExternally (bool managedExternally)
 
void Update () override
 
- Public Member Functions inherited from EMotionFX::Attachment
virtual void UpdateJointTransforms (Pose &outPose)
 
ActorInstanceGetAttachmentActorInstance () const
 
ActorInstanceGetAttachToActorInstance () 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 AttachmentNodeCreate (ActorInstance *attachToActorInstance, size_t attachToNodeIndex, ActorInstance *attachment, bool managedExternally=false)
 

Protected Member Functions

 AttachmentNode (ActorInstance *attachToActorInstance, size_t attachToNodeIndex, ActorInstance *attachment, bool managedExternally=false)
 
virtual ~AttachmentNode ()
 
- Protected Member Functions inherited from EMotionFX::Attachment
 Attachment (ActorInstance *attachToActorInstance, ActorInstance *attachment)
 
virtual ~Attachment ()
 
- Protected Member Functions inherited from MCore::RefCounted
virtual void Delete ()
 

Protected Attributes

size_t m_attachedToNode
 
bool m_isManagedExternally
 
- Protected Attributes inherited from EMotionFX::Attachment
ActorInstancem_attachment
 
ActorInstancem_actorInstance
 

Detailed Description

A regular node attachment. With node we mean that this attachment is only influenced by one given node in the ActorInstance it is attached to. An example of this could be a gun attached to the hand node of a character. Please keep in mind that the actor instance you attach can be a fully animated character as well. It is just being influenced by one single node of the actor instance you attach it to.

Constructor & Destructor Documentation

◆ AttachmentNode()

EMotionFX::AttachmentNode::AttachmentNode ( ActorInstance attachToActorInstance,
size_t  attachToNodeIndex,
ActorInstance attachment,
bool  managedExternally = false 
)
protected

The constructor for a regular attachment.

Parameters
attachToActorInstanceThe actor instance to attach to (for example a cowboy).
attachToNodeIndexThe node to attach to. This has to be part of the actor where the attachToActorInstance is instanced from.
attachmentThe actor instance that you want to attach to this node (for example a gun).
managedExternallySpecify whether the parent transform (where we are attached to) propagates into the attachment actor instance.

◆ ~AttachmentNode()

virtual EMotionFX::AttachmentNode::~AttachmentNode ( )
protectedvirtual

The destructor. This does NOT delete the actor instance used by the attachment.

Member Function Documentation

◆ Create()

static AttachmentNode* EMotionFX::AttachmentNode::Create ( ActorInstance attachToActorInstance,
size_t  attachToNodeIndex,
ActorInstance attachment,
bool  managedExternally = false 
)
static

Create an attachment that is attached to a single node.

Parameters
attachToActorInstanceThe actor instance to attach to, for example the main character in the game.
attachToNodeIndexThe node to attach to. This has to be part of the actor where the attachToActorInstance is instanced from.
attachmentThe actor instance that you want to attach to this node (for example a gun).
managedExternallySpecify whether the parent transform (where we are attached to) propagates into the attachment actor instance.

◆ GetAttachToNodeIndex()

size_t EMotionFX::AttachmentNode::GetAttachToNodeIndex ( ) const

Get the node where we attach something to. This node is part of the actor from which the actor instance returned by GetAttachToActorInstance() is created.

Returns
The node index where we will attach this attachment to.

◆ GetIsInfluencedByMultipleJoints()

bool EMotionFX::AttachmentNode::GetIsInfluencedByMultipleJoints ( ) const
inlinefinaloverridevirtual

Check if this attachment is being influenced by multiple joints or not. This is the case for attachments such as clothing items which get influenced by multiple joints inside the actor instance they are attached to.

Returns
Returns true if it is influenced by multiple joints, otherwise false is returned.

Implements EMotionFX::Attachment.

◆ GetIsManagedExternally()

bool EMotionFX::AttachmentNode::GetIsManagedExternally ( ) const

Check whether the transformations of the attachment are modified by using a parent-child relationship in forward kinematics. When external management is disbled (which it is on default), then the parent actor instance's global transform is forwarded into the attachment's actor instance. When external management is disabled, this will not happen.

Returns
Returns true when this attachments transforms are managed externally.

◆ GetType()

uint32 EMotionFX::AttachmentNode::GetType ( ) const
inlineoverridevirtual

Get the attachment type ID. Every class inherited from this base class should have some type ID.

Returns
The type ID of this attachment class.

Implements EMotionFX::Attachment.

◆ GetTypeString()

const char* EMotionFX::AttachmentNode::GetTypeString ( ) const
inlineoverridevirtual

Get the attachment type string. Every class inherited from this base class should have some type ID string, which should be equal to the class name really.

Returns
The type string of this attachment class, which should be the class name.

Implements EMotionFX::Attachment.

◆ SetIsManagedExternally()

void EMotionFX::AttachmentNode::SetIsManagedExternally ( bool  managedExternally)

Specify whether the transformations of the attachment are modified by using a parent-child relationship in forward kinematics. When external management is disbled (which it is on default), then the parent actor instance's global transform is forwarded into the attachment's actor instance. When external management is disabled, this will not happen.

Parameters
managedExternallyWhen set to true, the parent transformation will not propagate into the attachment's actor instance transformation.

◆ Update()

void EMotionFX::AttachmentNode::Update ( )
overridevirtual

The main update method.

Reimplemented from EMotionFX::Attachment.

Member Data Documentation

◆ m_attachedToNode

size_t EMotionFX::AttachmentNode::m_attachedToNode
protected

The node where the attachment is linked to.

◆ m_isManagedExternally

bool EMotionFX::AttachmentNode::m_isManagedExternally
protected

Is this attachment basically managed (transformation wise) by something else? (like an Attachment component). The default is false.


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