wavelength 1.0.0
Loading...
Searching...
No Matches
ArmPart Class Reference

The model of an arm of an avatar. More...

#include <armpart.h>

Inheritance diagram for ArmPart:
Collaboration diagram for ArmPart:

Public Member Functions

 ~ArmPart () override=default
 Destroy the object.
 ArmPart (int nPart, int nParent, Avatar *pAvatar)
 Construct the model of an arm.
void SetFrame (float fFrame) override
 Pose the arm at one frame of its animations.
void SetFrames (float fFrom, float fTo, float fBlend) override
 Pose the arm between two frames of its animations.
void Update () override
 Hang the upper arm, the forearm, and the hand from the joint of the torso.
void SetType (const char *pszType) override
 Start loading the files of a choice of the left arm.
bool Rebuild () override
 Build the meshes of the arm and measure its bones.
Public Member Functions inherited from AvatarPart
 AvatarPart (int nPart, int nParent, Avatar *pAvatar)
 Construct the model of a part from its entry of the parts array of the avatar entry of the "db" section.
virtual ~AvatarPart ()
 Delete the animations and the loaders of the model.
virtual void ReleaseType ()
 Abandon the loads SetType() started and return to the choice the meshes show.
void Draw ()
 Draw the model, when it has a mesh.
void SetBlend (float fBlend)
 Set the alpha of the material of the model, when it has one.
void SetColor (const Color *pColor)
 Colour the model.
const char * GetType () const
const char * GetPendingType () const
void SetPendingType (const char *pszType)
 Set the choice SetType() last requested.
void SetMat (RndMat *pMat)
 Set the material of the model.
RndMesh * GetTransRoot ()
const std::vector< std::unique_ptr< RndTransAnim > > & GetAnims () const

Additional Inherited Members

Protected Member Functions inherited from AvatarPart
void SetMatTree (RndMesh *pMesh)
 Give a mesh and every mesh drawn under it the material of the model.
void FindJoint ()
 Find the joint mesh the model hangs from, avatar<n>_<trans_root>_joint.mesh.
Static Protected Member Functions inherited from AvatarPart
static void RotationAt (const RndTransAnim *pAnim, float fFrame, Quat &out)
 Interpolate the rotation keys of an animation at a frame.
static void BlendRotation (const RndTransAnim *pAnim, float fFrom, float fTo, float fBlend, Quat &out)
 Blend the rotations of an animation at two frames.
static void BlendTranslation (const RndTransAnim *pAnim, float fFrom, float fTo, float fBlend, Vector3 &out)
 Blend the translations of an animation at two frames.
static RndMesh * FindMesh (const char *pszName)
 Find a mesh by name.
static void ResetLocalXfm (RndMesh *pMesh)
 Set the local transform of a mesh to the identity and mark it out of date.
Protected Attributes inherited from AvatarPart
Callback mCallback
DataArray * mData
const char * mType
const char * mPendingType
Color mColor
RndMesh * mMesh
RndMesh * mTransRoot
RndMesh * mJoint
RndMat * mMat
std::vector< std::unique_ptr< RndTransAnim > > mAnims
 The animations of the bones the anims array lists, in its order, deleted with the part.
AvatarPart * mParent
Avatar * mAvatar
std::unique_ptr< RndLoader > mLoader
std::unique_ptr< RndLoader > mPendingLoader
 The load of the first file of mPendingType, or null.
std::unique_ptr< RndLoader > mPendingExtraLoader
 The load of the second file of mPendingType, or null.

Detailed Description

The model of an arm of an avatar.

The RTTI includes the name and records AvatarPart as the base. The object is 0x80 bytes. The arm reaches for the instrument. Its first two animations place the elbow and the hand on the instrument, and the upper arm and the forearm are posed between the shoulder and the hand by two bone inverse kinematics. The right arm takes its choice and its material from the left arm.

Constructor & Destructor Documentation

◆ ~ArmPart()

ArmPart::~ArmPart ( )
overridedefault

Destroy the object.

Ghidra address:
NTSC-U/C: 0x003a3588
Ghidra address:
PAL: 0x00412268

◆ ArmPart()

ArmPart::ArmPart ( int nPart,
int nParent,
Avatar * pAvatar )

Construct the model of an arm.

Parameters
nPartThe arm, AvatarPartSet::kPartLeftArm or AvatarPartSet::kPartRightArm.
nParentThe part the model hangs from.
pAvatarThe avatar the part belongs to.
Ghidra address:
NTSC-U/C: 0x00274c30
Ghidra address:
PAL: 0x0027e750

Member Function Documentation

◆ SetFrame()

void ArmPart::SetFrame ( float fFrame)
overridevirtual

Pose the arm at one frame of its animations.

The name follows the base.

Parameters
fFrameThe frame.
Ghidra address:
NTSC-U/C: 0x00274c70
Ghidra address:
PAL: 0x0027e790

Reimplemented from AvatarPart.

◆ SetFrames()

void ArmPart::SetFrames ( float fFrom,
float fTo,
float fBlend )
overridevirtual

Pose the arm between two frames of its animations.

The name follows the base.

Parameters
fFromThe frame blended from.
fToThe frame blended to.
fBlendThe weight of fTo, 0 to 1.
Ghidra address:
NTSC-U/C: 0x00274fa8
Ghidra address:
PAL: 0x0027eac8

Reimplemented from AvatarPart.

◆ Update()

void ArmPart::Update ( )
overridevirtual

Hang the upper arm, the forearm, and the hand from the joint of the torso.

The name follows the base.

Ghidra address:
NTSC-U/C: 0x00276868
Ghidra address:
PAL: 0x00280388

Reimplemented from AvatarPart.

◆ SetType()

void ArmPart::SetType ( const char * pszType)
overridevirtual

Start loading the files of a choice of the left arm.

The right arm ignores the call.

The name follows the base.

Parameters
pszTypeThe choice, a symbol.
Ghidra address:
NTSC-U/C: 0x00276558
Ghidra address:
PAL: 0x00280078

Reimplemented from AvatarPart.

◆ Rebuild()

bool ArmPart::Rebuild ( )
overridevirtual

Build the meshes of the arm and measure its bones.

The forearm and the hand are detached from the upper arm. The left arm then rebuilds the right arm with the same choice and material. The name follows the base.

Returns
False while a file is still loading, otherwise true.
Ghidra address:
NTSC-U/C: 0x002765a0
Ghidra address:
PAL: 0x002800c0

Reimplemented from AvatarPart.


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