Isle
Loading...
Searching...
No Matches
LegoAnimNodeData Class Reference

[AI] Holds per-node animation data for a model's animation tree. More...

#include <legoanim.h>

Inheritance diagram for LegoAnimNodeData:
Collaboration diagram for LegoAnimNodeData:

Public Member Functions

 LegoAnimNodeData ()
 [AI] Default-initializes all animation key counts to zero and pointers to NULL. [AI] More...
 
 ~LegoAnimNodeData () override
 [AI] Cleans up all allocated animation key arrays and the node name. [AI] More...
 
LegoResult Read (LegoStorage *p_storage) override
 [AI] Reads all node keyframe arrays, name, and meta from storage. More...
 
LegoResult Write (LegoStorage *p_storage) override
 [AI] Writes all node keyframe arrays, name, and meta to storage. More...
 
void SetName (LegoChar *p_name)
 [AI] Sets the node's name (deep-copies string). More...
 
LegoResult CreateLocalTransform (LegoFloat p_time, Matrix4 &p_matrix)
 [AI] Computes the interpolated local transformation matrix for this node at the given animation time. More...
 
LegoBool FUN_100a0990 (LegoFloat p_time)
 [AI] Evaluates morph keys at the given animation time and returns result (typically affects mesh shape or blend shape state). More...
 
LegoCharGetName ()
 [AI] Name of this animation node (used for lookup/mapping to scene graph). More...
 
LegoU16 GetNumTranslationKeys ()
 [AI] Number of translation keys for this node. More...
 
LegoU16 GetNumRotationKeys ()
 [AI] Number of rotation keys for this node. More...
 
void SetNumRotationKeys (LegoU16 p_numRotationKeys)
 [AI] Sets the number of rotation keys for this node. More...
 
void SetRotationKeys (LegoRotationKey *p_keys)
 [AI] Sets the node's rotation keys array, resets rotation index. More...
 
LegoU32 GetTranslationIndex ()
 [AI] Gets last used/optimized translation index for interpolation. More...
 
LegoU32 GetRotationIndex ()
 [AI] Gets last used/optimized rotation index for interpolation. More...
 
LegoU32 GetScaleIndex ()
 [AI] Gets last used/optimized scale index for interpolation. More...
 
LegoU32 GetMorphIndex ()
 [AI] Gets last used/optimized morph index for interpolation. More...
 
LegoU16 GetUnknown0x20 ()
 [AI] Unknown, used in scene/camera calculations (purpose unclear). More...
 
LegoU16 GetUnknown0x22 ()
 [AI] Unknown, used in scene/camera calculations (purpose unclear). More...
 
LegoRotationKeyGetRotationKey (MxS32 index)
 [AI] Access a pointer to the i-th rotation key. More...
 
void SetTranslationIndex (LegoU32 p_translationIndex)
 [AI] Sets last used translation index. More...
 
void SetRotationIndex (LegoU32 p_rotationIndex)
 [AI] Sets last used rotation index. More...
 
void SetScaleIndex (LegoU32 p_scaleIndex)
 [AI] Sets last used scale index. More...
 
void SetMorphIndex (LegoU32 p_morphIndex)
 [AI] Sets last used morph index. More...
 
LegoMorphKeyGetMorphKeys ()
 [AI] Returns pointer to morph keyframes array. More...
 
void SetMorphKeys (LegoMorphKey *p_morphKeys)
 
void SetNumMorphKeys (LegoU16 p_numMorphKeys)
 [AI] Sets morph key count. More...
 
void SetUnknown0x20 (LegoU16 p_unk0x20)
 [AI] Sets unknown parameter (possibly camera/scene state). More...
 
void SetUnknown0x22 (LegoU16 p_unk0x22)
 [AI] Sets unknown parameter (possibly camera/scene state). More...
 
LegoResult CreateLocalTransform (LegoTime p_time, Matrix4 &p_matrix)
 [AI] Convenience: overloaded CreateLocalTransform for time in integer time units. More...
 
LegoBool FUN_100a0990 (LegoTime p_time)
 [AI] Convenience: evaluate morph state at integer time value. More...
 
- Public Member Functions inherited from LegoTreeNodeData
 LegoTreeNodeData ()
 [AI] Default constructor. More...
 
virtual ~LegoTreeNodeData ()
 [AI] Virtual destructor for safe polymorphic deletion of derived classes. More...
 
virtual LegoResult Read (LegoStorage *p_storage)
 [AI] Virtual function for deserializing node data from a generic LegoStorage device. More...
 
virtual LegoResult Write (LegoStorage *p_storage)
 [AI] Virtual function for serializing node data to a generic LegoStorage device. More...
 

Static Public Member Functions

static void GetTranslation (LegoU16 p_numTranslationKeys, LegoTranslationKey *p_translationKeys, LegoFloat p_time, Matrix4 &p_matrix, LegoU32 &p_old_index)
 [AI] Computes interpolated translation for a node at specified time, filling p_matrix. More...
 
static void GetRotation (LegoU16 p_numRotationKeys, LegoRotationKey *p_rotationKeys, LegoFloat p_time, Matrix4 &p_matrix, LegoU32 &p_old_index)
 [AI] Computes interpolated rotation at a given time, filling p_matrix. More...
 
static void GetScale (LegoU16 p_numScaleKeys, LegoScaleKey *p_scaleKeys, LegoFloat p_time, Matrix4 &p_matrix, LegoU32 &p_old_index)
 [AI] Computes interpolated scaling on a node at given time, updating p_matrix. More...
 
static LegoFloat Interpolate (LegoFloat p_time, LegoAnimKey &p_key1, LegoFloat p_value1, LegoAnimKey &p_key2, LegoFloat p_value2)
 [AI] Performs linear interpolation between two key values for the given time. More...
 
static LegoAnimKeyGetKey (LegoU32 p_i, LegoAnimKey *p_keys, LegoU32 p_size)
 [AI] Retrieves a reference to the p_i-th LegoAnimKey of given size. More...
 
static LegoU32 FindKeys (LegoFloat p_time, LegoU32 p_numKeys, LegoAnimKey *p_keys, LegoU32 p_size, LegoU32 &p_new_index, LegoU32 &p_old_index)
 [AI] Finds surrounding key(s) for interpolation at p_time. More...
 

Protected Attributes

LegoCharm_name
 [AI] Animation node name. More...
 
LegoU16 m_numTranslationKeys
 [AI] Number of translation keyframes. More...
 
LegoU16 m_numRotationKeys
 [AI] Number of rotation keyframes. More...
 
LegoU16 m_numScaleKeys
 [AI] Number of scale keyframes. More...
 
LegoU16 m_numMorphKeys
 [AI] Number of morph keyframes. More...
 
LegoTranslationKeym_translationKeys
 [AI] Array of translation keyframes. More...
 
LegoRotationKeym_rotationKeys
 [AI] Array of rotation keyframes. More...
 
LegoScaleKeym_scaleKeys
 [AI] Array of scale keyframes. More...
 
LegoMorphKeym_morphKeys
 [AI] Array of morph keyframes. More...
 
LegoU16 m_unk0x20
 [AI] Unknown, used in camera/scene morph/rotation (purpose unclear). More...
 
LegoU16 m_unk0x22
 [AI] Unknown, used in camera/scene morph/rotation (purpose unclear). More...
 
LegoU32 m_translationIndex
 [AI] Index cache for optimized translation lookup/interpolation. More...
 
LegoU32 m_rotationIndex
 [AI] Index cache for optimized rotation lookup/interpolation. More...
 
LegoU32 m_scaleIndex
 [AI] Index cache for optimized scale lookup/interpolation. More...
 
LegoU32 m_morphIndex
 [AI] Index cache for optimized morph lookup/interpolation. More...
 

Detailed Description

[AI] Holds per-node animation data for a model's animation tree.

[AI] Contains keyframe arrays for translation, rotation, scale, and morph animations, plus per-node name and anonymous flags. Provides transformation generation for a given time. Inherits from LegoTreeNodeData, fitting into a hierarchical animation structure.

Definition at line 144 of file legoanim.h.

Constructor & Destructor Documentation

◆ LegoAnimNodeData()

LegoAnimNodeData::LegoAnimNodeData ( )

[AI] Default-initializes all animation key counts to zero and pointers to NULL. [AI]

Definition at line 516 of file legoanim.cpp.

◆ ~LegoAnimNodeData()

LegoAnimNodeData::~LegoAnimNodeData ( )
override

[AI] Cleans up all allocated animation key arrays and the node name. [AI]

Definition at line 537 of file legoanim.cpp.

Member Function Documentation

◆ CreateLocalTransform() [1/2]

LegoResult LegoAnimNodeData::CreateLocalTransform ( LegoFloat  p_time,
Matrix4 p_matrix 
)

[AI] Computes the interpolated local transformation matrix for this node at the given animation time.

Parameters
p_timeTime to evaluate animation at [AI]
p_matrixResulting local transformation matrix [AI]

Definition at line 728 of file legoanim.cpp.

◆ CreateLocalTransform() [2/2]

LegoResult LegoAnimNodeData::CreateLocalTransform ( LegoTime  p_time,
Matrix4 p_matrix 
)
inline

[AI] Convenience: overloaded CreateLocalTransform for time in integer time units.

Parameters
p_timeAnimation time (integer) [AI]
p_matrixResult matrix [AI]

Definition at line 206 of file legoanim.h.

◆ FindKeys()

LegoU32 LegoAnimNodeData::FindKeys ( LegoFloat  p_time,
LegoU32  p_numKeys,
LegoAnimKey p_keys,
LegoU32  p_size,
LegoU32 p_new_index,
LegoU32 p_old_index 
)
static

[AI] Finds surrounding key(s) for interpolation at p_time.

Parameters
p_timeCurrent animation time [AI]
p_numKeysNumber of keys in array [AI]
p_keysKey array [AI]
p_sizeStride/size of keys [AI]
p_new_indexResulting key index [AI]
p_old_indexKey search starting index (in/out) [AI]
Returns
Number of keys found: 0 (none), 1 (exact), or 2 (between) [AI]

Definition at line 946 of file legoanim.cpp.

◆ FUN_100a0990() [1/2]

LegoBool LegoAnimNodeData::FUN_100a0990 ( LegoFloat  p_time)

[AI] Evaluates morph keys at the given animation time and returns result (typically affects mesh shape or blend shape state).

Parameters
p_timeTime to evaluate morph at [AI]

Definition at line 923 of file legoanim.cpp.

◆ FUN_100a0990() [2/2]

LegoBool LegoAnimNodeData::FUN_100a0990 ( LegoTime  p_time)
inline

[AI] Convenience: evaluate morph state at integer time value.

Definition at line 212 of file legoanim.h.

◆ GetKey()

LegoAnimKey & LegoAnimNodeData::GetKey ( LegoU32  p_i,
LegoAnimKey p_keys,
LegoU32  p_size 
)
inlinestatic

[AI] Retrieves a reference to the p_i-th LegoAnimKey of given size.

Parameters
p_iArray index [AI]
p_keysStart of keyframe array [AI]
p_sizeStride/size of each keyframe [AI]

Definition at line 1007 of file legoanim.cpp.

◆ GetMorphIndex()

LegoU32 LegoAnimNodeData::GetMorphIndex ( )
inline

[AI] Gets last used/optimized morph index for interpolation.

Definition at line 178 of file legoanim.h.

◆ GetMorphKeys()

LegoMorphKey * LegoAnimNodeData::GetMorphKeys ( )
inline

[AI] Returns pointer to morph keyframes array.

Definition at line 192 of file legoanim.h.

◆ GetName()

LegoChar * LegoAnimNodeData::GetName ( )
inline

[AI] Name of this animation node (used for lookup/mapping to scene graph).

Definition at line 163 of file legoanim.h.

◆ GetNumRotationKeys()

LegoU16 LegoAnimNodeData::GetNumRotationKeys ( )
inline

[AI] Number of rotation keys for this node.

Definition at line 165 of file legoanim.h.

◆ GetNumTranslationKeys()

LegoU16 LegoAnimNodeData::GetNumTranslationKeys ( )
inline

[AI] Number of translation keys for this node.

Definition at line 164 of file legoanim.h.

◆ GetRotation()

void LegoAnimNodeData::GetRotation ( LegoU16  p_numRotationKeys,
LegoRotationKey p_rotationKeys,
LegoFloat  p_time,
Matrix4 p_matrix,
LegoU32 p_old_index 
)
static

[AI] Computes interpolated rotation at a given time, filling p_matrix.

Parameters
p_numRotationKeysCount of rotation keys [AI]
p_rotationKeysRotation keys array [AI]
p_timeAnimation time [AI]
p_matrixMatrix to set [AI]
p_old_indexKey search starting index (pass in/out) [AI]

Definition at line 829 of file legoanim.cpp.

◆ GetRotationIndex()

LegoU32 LegoAnimNodeData::GetRotationIndex ( )
inline

[AI] Gets last used/optimized rotation index for interpolation.

Definition at line 176 of file legoanim.h.

◆ GetRotationKey()

LegoRotationKey * LegoAnimNodeData::GetRotationKey ( MxS32  index)
inline

[AI] Access a pointer to the i-th rotation key.

Parameters
indexArray index (0-based) [AI]

Definition at line 185 of file legoanim.h.

◆ GetScale()

void LegoAnimNodeData::GetScale ( LegoU16  p_numScaleKeys,
LegoScaleKey p_scaleKeys,
LegoFloat  p_time,
Matrix4 p_matrix,
LegoU32 p_old_index 
)
inlinestatic

[AI] Computes interpolated scaling on a node at given time, updating p_matrix.

Parameters
p_numScaleKeysNumber of scale keys [AI]
p_scaleKeysScale keys array [AI]
p_timeAnimation time [AI]
p_matrixMatrix to update [AI]
p_old_indexKey search starting index (pass in/out) [AI]

Definition at line 892 of file legoanim.cpp.

◆ GetScaleIndex()

LegoU32 LegoAnimNodeData::GetScaleIndex ( )
inline

[AI] Gets last used/optimized scale index for interpolation.

Definition at line 177 of file legoanim.h.

◆ GetTranslation()

void LegoAnimNodeData::GetTranslation ( LegoU16  p_numTranslationKeys,
LegoTranslationKey p_translationKeys,
LegoFloat  p_time,
Matrix4 p_matrix,
LegoU32 p_old_index 
)
inlinestatic

[AI] Computes interpolated translation for a node at specified time, filling p_matrix.

Parameters
p_numTranslationKeysCount of translation keys in array [AI]
p_translationKeysTranslation keys array [AI]
p_timeAnimation time [AI]
p_matrixMatrix to be set [AI]
p_old_indexKey search starting index (pass in/out optimized for playback) [AI]

Definition at line 765 of file legoanim.cpp.

◆ GetTranslationIndex()

LegoU32 LegoAnimNodeData::GetTranslationIndex ( )
inline

[AI] Gets last used/optimized translation index for interpolation.

Definition at line 175 of file legoanim.h.

◆ GetUnknown0x20()

LegoU16 LegoAnimNodeData::GetUnknown0x20 ( )
inline

[AI] Unknown, used in scene/camera calculations (purpose unclear).

Definition at line 180 of file legoanim.h.

◆ GetUnknown0x22()

LegoU16 LegoAnimNodeData::GetUnknown0x22 ( )
inline

[AI] Unknown, used in scene/camera calculations (purpose unclear).

Definition at line 181 of file legoanim.h.

◆ Interpolate()

LegoFloat LegoAnimNodeData::Interpolate ( LegoFloat  p_time,
LegoAnimKey p_key1,
LegoFloat  p_value1,
LegoAnimKey p_key2,
LegoFloat  p_value2 
)
inlinestatic

[AI] Performs linear interpolation between two key values for the given time.

Parameters
p_timeCurrent animation time [AI]
p_key1First keyframe [AI]
p_value1Value at first keyframe [AI]
p_key2Second keyframe [AI]
p_value2Value at second keyframe [AI]

Definition at line 996 of file legoanim.cpp.

◆ Read()

LegoResult LegoAnimNodeData::Read ( LegoStorage p_storage)
overridevirtual

[AI] Reads all node keyframe arrays, name, and meta from storage.

Parameters
p_storageStorage to read from. [AI]

Reimplemented from LegoTreeNodeData.

Definition at line 558 of file legoanim.cpp.

◆ SetMorphIndex()

void LegoAnimNodeData::SetMorphIndex ( LegoU32  p_morphIndex)
inline

[AI] Sets last used morph index.

Definition at line 190 of file legoanim.h.

◆ SetMorphKeys()

void LegoAnimNodeData::SetMorphKeys ( LegoMorphKey p_morphKeys)
inline

Definition at line 193 of file legoanim.h.

◆ SetName()

void LegoAnimNodeData::SetName ( LegoChar p_name)

[AI] Sets the node's name (deep-copies string).

Definition at line 717 of file legoanim.cpp.

◆ SetNumMorphKeys()

void LegoAnimNodeData::SetNumMorphKeys ( LegoU16  p_numMorphKeys)
inline

[AI] Sets morph key count.

Definition at line 199 of file legoanim.h.

◆ SetNumRotationKeys()

void LegoAnimNodeData::SetNumRotationKeys ( LegoU16  p_numRotationKeys)
inline

[AI] Sets the number of rotation keys for this node.

Definition at line 166 of file legoanim.h.

◆ SetRotationIndex()

void LegoAnimNodeData::SetRotationIndex ( LegoU32  p_rotationIndex)
inline

[AI] Sets last used rotation index.

Definition at line 188 of file legoanim.h.

◆ SetRotationKeys()

void LegoAnimNodeData::SetRotationKeys ( LegoRotationKey p_keys)
inline

[AI] Sets the node's rotation keys array, resets rotation index.

Definition at line 169 of file legoanim.h.

◆ SetScaleIndex()

void LegoAnimNodeData::SetScaleIndex ( LegoU32  p_scaleIndex)
inline

[AI] Sets last used scale index.

Definition at line 189 of file legoanim.h.

◆ SetTranslationIndex()

void LegoAnimNodeData::SetTranslationIndex ( LegoU32  p_translationIndex)
inline

[AI] Sets last used translation index.

Definition at line 187 of file legoanim.h.

◆ SetUnknown0x20()

void LegoAnimNodeData::SetUnknown0x20 ( LegoU16  p_unk0x20)
inline

[AI] Sets unknown parameter (possibly camera/scene state).

Definition at line 200 of file legoanim.h.

◆ SetUnknown0x22()

void LegoAnimNodeData::SetUnknown0x22 ( LegoU16  p_unk0x22)
inline

[AI] Sets unknown parameter (possibly camera/scene state).

Definition at line 201 of file legoanim.h.

◆ Write()

LegoResult LegoAnimNodeData::Write ( LegoStorage p_storage)
overridevirtual

[AI] Writes all node keyframe arrays, name, and meta to storage.

Parameters
p_storageStorage to write to. [AI]

Reimplemented from LegoTreeNodeData.

Definition at line 650 of file legoanim.cpp.

Member Data Documentation

◆ m_morphIndex

LegoU32 LegoAnimNodeData::m_morphIndex
protected

[AI] Index cache for optimized morph lookup/interpolation.

Definition at line 308 of file legoanim.h.

◆ m_morphKeys

LegoMorphKey* LegoAnimNodeData::m_morphKeys
protected

[AI] Array of morph keyframes.

Definition at line 302 of file legoanim.h.

◆ m_name

LegoChar* LegoAnimNodeData::m_name
protected

[AI] Animation node name.

Definition at line 294 of file legoanim.h.

◆ m_numMorphKeys

LegoU16 LegoAnimNodeData::m_numMorphKeys
protected

[AI] Number of morph keyframes.

Definition at line 298 of file legoanim.h.

◆ m_numRotationKeys

LegoU16 LegoAnimNodeData::m_numRotationKeys
protected

[AI] Number of rotation keyframes.

Definition at line 296 of file legoanim.h.

◆ m_numScaleKeys

LegoU16 LegoAnimNodeData::m_numScaleKeys
protected

[AI] Number of scale keyframes.

Definition at line 297 of file legoanim.h.

◆ m_numTranslationKeys

LegoU16 LegoAnimNodeData::m_numTranslationKeys
protected

[AI] Number of translation keyframes.

Definition at line 295 of file legoanim.h.

◆ m_rotationIndex

LegoU32 LegoAnimNodeData::m_rotationIndex
protected

[AI] Index cache for optimized rotation lookup/interpolation.

Definition at line 306 of file legoanim.h.

◆ m_rotationKeys

LegoRotationKey* LegoAnimNodeData::m_rotationKeys
protected

[AI] Array of rotation keyframes.

Definition at line 300 of file legoanim.h.

◆ m_scaleIndex

LegoU32 LegoAnimNodeData::m_scaleIndex
protected

[AI] Index cache for optimized scale lookup/interpolation.

Definition at line 307 of file legoanim.h.

◆ m_scaleKeys

LegoScaleKey* LegoAnimNodeData::m_scaleKeys
protected

[AI] Array of scale keyframes.

Definition at line 301 of file legoanim.h.

◆ m_translationIndex

LegoU32 LegoAnimNodeData::m_translationIndex
protected

[AI] Index cache for optimized translation lookup/interpolation.

Definition at line 305 of file legoanim.h.

◆ m_translationKeys

LegoTranslationKey* LegoAnimNodeData::m_translationKeys
protected

[AI] Array of translation keyframes.

Definition at line 299 of file legoanim.h.

◆ m_unk0x20

LegoU16 LegoAnimNodeData::m_unk0x20
protected

[AI] Unknown, used in camera/scene morph/rotation (purpose unclear).

Definition at line 303 of file legoanim.h.

◆ m_unk0x22

LegoU16 LegoAnimNodeData::m_unk0x22
protected

[AI] Unknown, used in camera/scene morph/rotation (purpose unclear).

Definition at line 304 of file legoanim.h.


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