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

One of the avatars the game can draw at a time, lent to the AvatarPartSet that shows. More...

#include <avatar.h>

Classes

class  Anim
 The position in one of the anims of the avatar entry of the "db" section. More...

Public Member Functions

 Avatar (int nIndex)
 Build an avatar and its part models.
 ~Avatar ()
 Delete the part models.
void SetPose (const char *pszPose, bool bImmediate)
 Change the pose, and with it the model of the instrument.
void SetBaseAnim (const char *pszAnim, bool bOneShot, bool bImmediate)
 Change the body animation.
void Reset ()
 Return to the idle animation with no pose.
AvatarPart * GetPart (int nPart)
 Report the model of a part.
void Draw (const Rect *pScreenRect)
 Pose the part models at sTime and draw them with the shared camera.
void CatchGem (int nKey, int bRestartPose)
 React to a gem the player of the avatar caught.
void SetUser (AvatarPartSet *pUser)
 Set mUser.
int GetIndex () const
AvatarPartSet * GetUser ()

Static Public Member Functions

static void Init ()
 Read the avatar entry of the "db" section, load the base model, and build the avatars.
static void Terminate ()
 Delete the avatars and the loader of the base model.
static int NumAvatars ()
 Report the number of avatars.
static Avatar * GetAvatar (int nIndex)
 Report an avatar.
static void Poll (float fTime)
 Advance every avatar to a time.
static void DrawCamera ()
 Draw the shared camera alone, and restore the current camera and environment.
static void GetDepthRange (float *pfNear, float *pfFar)
 Report the depth range the shared camera draws into.
static void SetDepthRange (float fNear, float fFar)
 Set the depth range the shared camera draws into.
static void SetViewAngles (float fTilt, float fTurn)
 Turn the avatars in front of the shared camera.
static void SetFreqSize (int nFreqSize, bool bSnap)
 Choose the camera for a size of the avatar display.
static bool IsShown ()
 Report whether the avatar display is shown at all.
static void SetCamera (const char *pszCam)
 Blend the shared camera to one of the cams, unless it already heads there.
static void SnapCamera (const char *pszCam)
 Move the shared camera to one of the cams at once, with no blend.
static const char * GetNone ()
static RndTex * GetTargetTex ()

Static Public Attributes

static constexpr float kNever = 1.0e7f
 The time a blend that never started or already ended records.

Detailed Description

One of the avatars the game can draw at a time, lent to the AvatarPartSet that shows.

The RTTI includes the name. The object is 0x84 bytes. The num_avatars of the avatar entry of the "db" section sets the number of avatars, and every avatar shares one camera. An avatar plays a body animation, blended from the one it replaces, and a pose that also selects the model of its instrument.

Constructor & Destructor Documentation

◆ Avatar()

Avatar::Avatar ( int nIndex)
explicit

Build an avatar and its part models.

Parameters
nIndexThe index of the avatar, which selects its files.
Ghidra address:
NTSC-U/C: 0x0026f9b8
Ghidra address:
PAL: 0x00279558

◆ ~Avatar()

Avatar::~Avatar ( )

Delete the part models.

Ghidra address:
NTSC-U/C: 0x0026fbc8
Ghidra address:
PAL: 0x00279768

Member Function Documentation

◆ Init()

void Avatar::Init ( )
static

Read the avatar entry of the "db" section, load the base model, and build the avatars.

Ghidra address:
NTSC-U/C: 0x0026f5c0
Ghidra address:
PAL: 0x00279160

◆ Terminate()

void Avatar::Terminate ( )
static

Delete the avatars and the loader of the base model.

sAvatars retains its size, with every avatar released.

Ghidra address:
NTSC-U/C: 0x0026f8c8
Ghidra address:
PAL: 0x00279468

◆ NumAvatars()

int Avatar::NumAvatars ( )
static

Report the number of avatars.

Returns
The size of sAvatars.
Ghidra address:
NTSC-U/C: 0x0026f980
Ghidra address:
PAL: 0x00279520

◆ GetAvatar()

Avatar * Avatar::GetAvatar ( int nIndex)
static

Report an avatar.

Parameters
nIndexThe index.
Returns
The avatar.
Ghidra address:
NTSC-U/C: 0x0026f9a0
Ghidra address:
PAL: 0x00279540

◆ Poll()

void Avatar::Poll ( float fTime)
static

Advance every avatar to a time.

The routine builds the instrument model of at most one avatar a call, and moves the shared camera while it blends between two of the cams. The name is inferred.

Parameters
fTimeThe time in milliseconds.
Ghidra address:
NTSC-U/C: 0x00270fe8
Ghidra address:
PAL: 0x0027ab88

◆ DrawCamera()

void Avatar::DrawCamera ( )
static

Draw the shared camera alone, and restore the current camera and environment.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x002707a8
Ghidra address:
PAL: 0x0027a348

◆ GetDepthRange()

void Avatar::GetDepthRange ( float * pfNear,
float * pfFar )
static

Report the depth range the shared camera draws into.

The name is inferred.

Parameters
pfNearReceives the near end of the range.
pfFarReceives the far end of the range.
Ghidra address:
NTSC-U/C: 0x00270810
Ghidra address:
PAL: 0x0027a3b0

◆ SetDepthRange()

void Avatar::SetDepthRange ( float fNear,
float fFar )
static

Set the depth range the shared camera draws into.

The name is inferred.

Parameters
fNearThe near end of the range.
fFarThe far end of the range.
Ghidra address:
NTSC-U/C: 0x00270830
Ghidra address:
PAL: 0x0027a3d0

◆ SetViewAngles()

void Avatar::SetViewAngles ( float fTilt,
float fTurn )
static

Turn the avatars in front of the shared camera.

The name is inferred.

Parameters
fTiltThe angle about the horizontal axis, in radians.
fTurnThe angle about the vertical axis, in radians.
Ghidra address:
NTSC-U/C: 0x00270860
Ghidra address:
PAL: 0x0027a400

◆ SetFreqSize()

void Avatar::SetFreqSize ( int nFreqSize,
bool bSnap )
static

Choose the camera for a size of the avatar display.

The small display takes game_far, and the large and hidden ones take game_close. The name is inferred.

Parameters
nFreqSizeThe size, one of GameOptions::FreqSize.
bSnapWhether to move the camera at once rather than blend.
Ghidra address:
NTSC-U/C: 0x00270a40
Ghidra address:
PAL: 0x0027a5e0

◆ IsShown()

bool Avatar::IsShown ( )
static

Report whether the avatar display is shown at all.

The name is inferred.

Returns
Whether sFreqSize is not GameOptions::kFreqSizeHidden.
Ghidra address:
NTSC-U/C: 0x00270ae8
Ghidra address:
PAL: 0x0027a688

◆ SetCamera()

void Avatar::SetCamera ( const char * pszCam)
static

Blend the shared camera to one of the cams, unless it already heads there.

The name is inferred. When the camera already heads there, the PAL build also makes it the camera the blend starts from.

Parameters
pszCamThe camera, such as f_maker or bust.
Ghidra address:
NTSC-U/C: 0x00271440
Ghidra address:
PAL: 0x0027afe0

◆ SnapCamera()

void Avatar::SnapCamera ( const char * pszCam)
static

Move the shared camera to one of the cams at once, with no blend.

The name is inferred.

Parameters
pszCamThe camera, such as bust.
Ghidra address:
NTSC-U/C: 0x00271488
Ghidra address:
PAL: 0x0027b038

◆ SetPose()

void Avatar::SetPose ( const char * pszPose,
bool bImmediate )

Change the pose, and with it the model of the instrument.

While a one-shot body animation plays, the pose is only queued. The name is inferred.

Parameters
pszPoseThe pose, or fm_none to follow the body animation.
bImmediateWhether to change at once rather than blend.
Ghidra address:
NTSC-U/C: 0x0026fc70
Ghidra address:
PAL: 0x00279810

◆ SetBaseAnim()

void Avatar::SetBaseAnim ( const char * pszAnim,
bool bOneShot,
bool bImmediate )

Change the body animation.

The name is inferred.

Parameters
pszAnimThe animation.
bOneShotWhether the animation plays once and then gives way to the one it replaced.
bImmediateWhether to change at once rather than blend.
Ghidra address:
NTSC-U/C: 0x0026fdf8
Ghidra address:
PAL: 0x00279998

◆ Reset()

void Avatar::Reset ( )

Return to the idle animation with no pose.

The name is inferred.

Ghidra address:
NTSC-U/C: 0x00270130
Ghidra address:
PAL: 0x00279cd0

◆ GetPart()

AvatarPart * Avatar::GetPart ( int nPart)

Report the model of a part.

Parameters
nPartOne of AvatarPartSet::Part.
Returns
The model.
Ghidra address:
NTSC-U/C: 0x002701d8
Ghidra address:
PAL: 0x00279d78

◆ Draw()

void Avatar::Draw ( const Rect * pScreenRect)

Pose the part models at sTime and draw them with the shared camera.

The name is inferred.

Parameters
pScreenRectThe part of the screen to draw, or null for the target texture of the camera.
Ghidra address:
NTSC-U/C: 0x002701f0
Ghidra address:
PAL: 0x00279d90

◆ CatchGem()

void Avatar::CatchGem ( int nKey,
int bRestartPose )

React to a gem the player of the avatar caught.

The name is inferred.

Parameters
nKeyThe key of the frame range of the pose.
bRestartPoseWhether the pose restarts.
Ghidra address:
NTSC-U/C: 0x00271348
Ghidra address:
PAL: 0x0027aee8

◆ SetUser()

void Avatar::SetUser ( AvatarPartSet * pUser)

Set mUser.

Parameters
pUserThe set that borrows the avatar, or null.
Ghidra address:
NTSC-U/C: 0x002715a0
Ghidra address:
PAL: 0x0027b150

◆ GetIndex()

int Avatar::GetIndex ( ) const
inline
Returns
The index of the avatar.

◆ GetUser()

AvatarPartSet * Avatar::GetUser ( )
inline
Returns
The set that borrows the avatar, or null. Borrowed.

◆ GetNone()

const char * Avatar::GetNone ( )
inlinestatic
Returns
The symbol fm_none.

◆ GetTargetTex()

RndTex * Avatar::GetTargetTex ( )
inlinestatic
Returns
The target texture of the shared camera as Init() found it. Borrowed.

Member Data Documentation

◆ kNever

float Avatar::kNever = 1.0e7f
staticconstexpr

The time a blend that never started or already ended records.


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