NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
dBaseActor_c Class Reference

#include <game/bases/d_base_actor.hpp>

Inheritance diagram for dBaseActor_c:
[legend]

Description

The minimum required implementation for an actor base.

dBaseActor_c allows placing bases in either 2D or 3D space, by implementing the basic concepts of translation, scale, rotation and visibility. It also comes with a barebones physics engine and a few other properties. All actor bases (including sub-implementations) use fActorProfile_c for their profile, and their instances are added to a dedicated list in addition to the default ones.

The class is used directly when the only purpose of the base is displaying a 3D model. For more complex behaviour, it's recommended to use one of the available sub-implementations:

  • dActor_c, the minimum required implementation for a stage actor.
  • dWmActor_c, the minimum required implementation for a worldmap actor.
  • dMdActor_c, the minimum required implementation for a cutscene actor.

Creating Actors

Actor bases can be created by calling one of the two construct methods, which define two additional arguments to provide the starting position and rotation. A parent base can optionally be provided.

Hint:
If using a sub-implementation, using the provided method overloads is recommended.

Notable Operation Changes

The following operation changes have been made:

  • The execute operation will not run if the game is undergoing a reset procedure.
  • The finalUpdate step has been added to the execute operation. See below for more details.

finalUpdate

finalUpdate is an additional step that runs after every actor's main execute operation steps have been completed. It's only used in stages, and appears to have been introduced to address some model positioning issues by delaying the execution of the related code.

Hint:
If an actor's model is being unwantedly repositioned, moving its model updating code to this function may resolve the issue, particularly if the actor exhibits any of the following behaviours:
  • The actor can be carried (e.g. POW Block, Barrel);
  • The actor can be frozen and carried (e.g. Goomba, Spiny);
  • The actor is thrown by an actor that can be frozen and carried (e.g. Hammer, Boomerang).

It is currently unknown why this fix is necessary, but incorrect base execution order is a likely suspect.

Positioning

Actor positions are stored as 3-dimensional floating point vectors. The current position can be modified manually, while the previous position and the position delta are updated automatically after the execute operation.

Hint:
The game uses a right-handed coordinate system, with the Y axis used as height and the Z axis used as depth.

Notes for Stage Actors

  • The position vector generally does not represent the center of the actor. To get the centered position, use the getCenterPos function.
  • In stages, the origin point is placed in the top left corner, therefore Y values must be negated.
  • Tiles have a length and height of 16.0 .

Moving an Actor

You can move an actor by calling the posMove function. A translation vector can optionally be provided, otherwise the actor will be moved by its current speed.

Hint:
Many subclasses will call this function automatically. Make sure to research this to avoid unexpected behaviour!

Speed and Acceleration

Each axis has a dedicated speed value, which can be used to move the actor by a certain distance in its direction. Acceleration can be applied linearly to the X/Y axes (and Z in a limited fashion) to increase/decrease the actor's speed in said direction. More complex acceleration curves can be utilized by modifying the acceleration value through other libraries.

Speed on the X/Y axes can also be limited. However, the limits act as a target speed rather than a hard cap: should the current speed on a given axis exceed the corresponding limit, the actor will linearly decelerate until the limit is reached. Numerous functions are provided to update speed values, and their behaviour is summarised into the table below:

Function Supports Speed Value Source(s) Speed Value Destination(s) Acceleration(s) Applied Speed Limit(s) Checked Usage Notes
calcSpeedF All Actors F mSpeedF mSpeedF mAccelF mMaxSpeedF
  • This function cannot be used on its own to update horizontal speed, as the result is not placed into the mSpeed vector.
  • It is unknown what "F" stands for. Guesses are either Facing or Forward.
calcSpeed 3D Actors X mSpeedF mSpeed.x none none
  • mSpeedF is applied into the direction the actor is facing.
  • Combine this with calcSpeedF to implement acceleration and limiting on the X/Z axes.
Y mSpeed.y mSpeed.y mAccelY mMaxFallSpeed
Z mSpeedF mSpeed.z none none
calcSpeedX 2D Actors X mSpeed.x mSpeed.x mAccelF mSpeedMax.x
calcSpeedY 2D Actors Y mSpeed.y mSpeed.y mAccelY mSpeedMax.y
  • This function is intended to be used with negative speed values, but will also work with positive ones.
  • Unlike all the other functions, this one treats the provided limit as a hard cap, so ensure it is used properly to prevent unintentional breakage.
calcFallSpeed 2D Actors Y mSpeed.y mSpeed.y mAccelY mMaxFallSpeed In order for this function to work correctly, the acceleration value must be negated (so downwards acceleration is achieved with positive values and viceversa).
calcSpeedXY 2D Actors X mSpeedF mSpeed.x mAccelF mMaxSpeedF This function combines calcSpeedF (with the correct destination value) and calcFallSpeed, so make sure to read the notes for each of the two functions to ensure proper functionality.
Y mSpeed.y mSpeed.y mAccelY mMaxFallSpeed

Scaling

An actor base' scale can be controlled through the mScale vector. Depending on the base's implementation, the effects may only be visual or there may be no change at all.

Rotation

Actor rotations are stored as 3-dimensional short vectors. There are two vectors: mAngle, which is used by 2D actors, and mAngle3D, which is used by 3D actors. A small number of bases ignore these conventions and employ the unused vector either as a backup or as a delta value.

Just like for scaling, the effects of a rotation change also depend on the base's implementation.

Visibility

The actor's visibility can be controlled through the mVisible attribute. The actor won't be drawn if said property is set to false .

Actor Properties

mActorProperties is a bitfield storing various properties, which are later interpreted by inheriting classes. They are copied from the corresponding field in fActorProfile_c when the base is constructed.

Specialties

Drawing Models Over 2D Layouts

The draw2D function can replace the draw operation to allow 3D models to be drawn over the game's interface (the mVisible attribute in this case is ignored). This feature can only be used in the following scenes:

  • Main Menu (dScGameSetup_c)
  • Multiplayer Level Select (dScMulti_c)
  • Multiplayer Results (dScResult_c)
  • World 9 Unlock Cutscene (dScWorld9DeMo_c)
  • World Map (dScWMap_c)

The world map scene also supports an additional function (draw2D_lyt2), which is executed in a later draw pass.

Hint:
To use this feature in other scenes, simply call draw2DActorOnLyt1 (and optionally draw2DActorOnLyt2) from the scene's paint function (do so before the LinkScene call for the respective draw pass).

Profile Counting

The number of actor bases using a given profile can be obtained by calling GetProfNameActorNum.

Map Actor Types

The GetActorType function offers basic type information about map actors. See ACTOR_KIND_e for details.

Unused Content

  • The Z component of mSpeedMax is never used, despite being set to zero by various actors.
  • ACTOR_KIND_e type UNK_6 is not used anywhere, and presumably identifies a now-deleted actor.
Todo
Add missing links (especially the dGraph bit to avoid confusing terminology). Find the official name of LinkScene and link it.

Definition at line 250 of file d_base_actor.hpp.

Public Types

enum  ACTOR_KIND_e {
  ACTOR_MAP_GENERIC ,
  ACTOR_MAP_DEMO ,
  ACTOR_MAP_OBJECT ,
  ACTOR_MAP_ENEMY ,
  ACTOR_MAP_PLAYER ,
  ACTOR_MAP_STOP ,
  ACTOR_UNK_6 ,
  ACTOR_MENU_PLAYER ,
  ACTOR_GENERIC
}
 An identifier that represents the actor's kind. More...
 
- Public Types inherited from fBase_c
enum  LIFECYCLE_e {
  CREATING ,
  ACTIVE ,
  DELETING
}
 The possible lifecycle states. More...
 
enum  GROUP_TYPE_e {
  OTHER ,
  SCENE ,
  ACTOR
}
 The possible group types. More...
 
enum  MAIN_STATE_e {
  CANCELED ,
  ERROR ,
  SUCCESS ,
  WAITING
}
 The possible operation results. More...
 
enum  PACK_RESULT_e {
  NOT_READY ,
  SUCCEEDED ,
  FAILED
}
 The possible operation step results. More...
 
enum  PROC_DISABLE_e {
  ROOT_DISABLE_EXECUTE = BIT_FLAG(0) ,
  DISABLE_EXECUTE = BIT_FLAG(1) ,
  ROOT_DISABLE_DRAW = BIT_FLAG(2) ,
  DISABLE_DRAW = BIT_FLAG(3)
}
 Controls if the execute and draw operations should be skipped. More...
 

Public Member Functions

 dBaseActor_c ()
 Constructs a new actor.
 
void calcSpeed ()
 Updates the actor's speed (3D actors). See here for details.
 
void calcSpeedXY ()
 Updates the actor's speed (2D actors). See here for details.
 
void calcSpeedX ()
 Updates the actor's X speed. See here for details.
 
void calcFallSpeed ()
 Updates the actor's falling speed. See here for details.
 
void calcSpeedY ()
 Updates the actor's Y speed. See here for details.
 
void calcSpeedF ()
 Updates the actor's forward speed. See here for details.
 
void makeMtx ()
 Generates a partial transformation matrix for the actor and stores it in mMatrix.
 
mVec3_c getCenterPos () const
 Gets the actor's centered position.
 
void posMove (mVec3_c &delta)
 Moves the actor by the given delta.
 
void posMove ()
 Moves the actor by its speed.
 
int GetProfNameActorNum (ProfileName profile)
 Counts the instances of the given actor profile.
 
- Public Member Functions inherited from dBase_c
 dBase_c ()
 Constructs a new base.
 
virtual ~dBase_c ()
 Destroys the base.
 
virtual const char * getKindString () const
 Gets the base's kind string.
 
- Public Member Functions inherited from fBase_c
 fBase_c ()
 Constructs a new base.
 
void deleteRequest ()
 Requests deletion of the base.
 
fBase_cgetConnectParent () const
 Gets the base's parent.
 
fBase_cgetConnectChild () const
 Gets the base's first child.
 
fBase_cgetConnectBrNext () const
 Gets the base's next sibling.
 
bool checkChildProcessCreateState () const
 Checks if the base has at least one child in the CREATING state.
 
- Public Member Functions inherited from cOwnerSetMg_c
 cOwnerSetMg_c ()
 Constructs a new set container.
 
 ~cOwnerSetMg_c ()
 Destroys the set.
 
void add (cOwnerSetNd_c *nd, void *owner)
 Adds a node to the set.
 
void remove (cOwnerSetNd_c *nd, void *owner)
 Removes a node from the set.
 

Static Public Member Functions

static void draw2DActorOnLyt1 ()
 Calls draw2D on every actor.
 
static void draw2DActorOnLyt2 ()
 Calls draw2D_lyt2 on every actor.
 
static dBaseActor_cconstruct (ProfileName profName, unsigned long param, const mVec3_c *position, const mAng3_c *rotation)
 Creates an actor without a parent.
 
static dBaseActor_cconstruct (ProfileName profName, dBase_c *parent, unsigned long param, const mVec3_c *position, const mAng3_c *rotation)
 Creates a child actor with the given parent.
 
- Static Public Member Functions inherited from dBase_c
static dBase_csearchBaseByProfName (ProfileName profile, const dBase_c *parent)
 Searches for a base with a given profile name, optionally under a given parent.
 
static void initLoader ()
 [Unused]. Sets the callbacks for the scrapped relocatable profile system.
 
static dBase_ccreateBase (ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType)
 Creates a child base under the given parent.
 
static dBase_ccreateRoot (ProfileName profName, unsigned long param, u8 groupType)
 Creates a root base.
 
- Static Public Member Functions inherited from fBase_c
static void * operator new (size_t)
 new operator override for all bases.
 
static void operator delete (void *)
 delete operator override for all bases.
 
static fBase_ccreateChild (ProfileName profName, fBase_c *parent, unsigned long param, u8 groupType)
 Creates a child base under the given parent.
 
static fBase_ccreateRoot (ProfileName profName, unsigned long param, u8 groupType)
 Creates a root base.
 

Public Attributes

mMtx_c mMatrix
 The actor's partial transformation matrix. See makeMtx for details.
 
mVec3_c mPos
 The actor's position.
 
mVec3_c mLastPos
 The actor's position in the previous frame.
 
mVec3_c mPosDelta
 The actor's position delta since the previous frame.
 
mVec3_c mCenterOffs
 The offset from the position to the center of the actor (defaults to 0).
 
mVec3_c mScale
 The actor's scale (defaults to 1).
 
mVec3_c mSpeed
 The actor's speed.
 
mVec3_c mSpeedMax
 The actor's maximum speed.
 
mAng3_c mAngle
 The actor's rotation (for 2D actors).
 
mAng3_c mAngle3D
 The actor's rotation (for 3D actors).
 
float mSpeedF
 The actor's horizontal speed.
 
float mMaxSpeedF
 The actor's maximum horizontal speed.
 
float mAccelY
 The actor's vertical acceleration.
 
float mMaxFallSpeed
 The actor's maximum fall speed.
 
float mAccelF
 The actor's horizontal acceleration.
 
u32 mActorProperties
 The actor's properties. See fProfile::fActorProfile_c::mActorProperties.
 
bool mVisible
 Whether the actor should be visible or not. Defaults to true .
 
- Public Attributes inherited from fBase_c
fBaseID_e mUniqueID
 The base's unique identifier.
 
u32 mParam
 A bitfield that configures the base's behaviour. Its usage varies from profile to profile.
 
ProfileName mProfName
 The base's profile name.
 

Protected Member Functions

virtual int preCreate ()
 pre method for the create operation.
 
virtual void postCreate (fBase_c::MAIN_STATE_e status)
 post method for the create operation.
 
virtual int preDelete ()
 pre method for the delete operation.
 
virtual void postDelete (fBase_c::MAIN_STATE_e status)
 post method for the delete operation.
 
virtual int preExecute ()
 pre method for the execute operation.
 
virtual void postExecute (fBase_c::MAIN_STATE_e status)
 post method for the execute operation.
 
virtual int preDraw ()
 pre method for the draw operation.
 
virtual void postDraw (fBase_c::MAIN_STATE_e status)
 post method for the draw operation.
 
virtual ~dBaseActor_c ()
 Destroys the actor.
 
virtual void draw2D ()
 Alternate drawing function used to draw 3D models in front of 2D graphics (first draw pass).
 
virtual void draw2D_lyt2 ()
 Alternate drawing function used to draw 3D models in front of 2D graphics (second draw pass).
 
virtual int GetActorType ()
 Gets the actor kind. See ACTOR_KIND_e.
 
virtual void finalUpdate ()
 Code to be executed after all actors' execute operation has run.
 
- Protected Member Functions inherited from fBase_c
bool isProcControlFlag (u8 flag) const
 Checks if a flag is set in mProcControl.
 
void setProcControlFlag (u8 flag)
 Sets a flag in mProcControl.
 
void clearProcControlFlag (u8 flag)
 Clears a flag in mProcControl.
 
virtual int create ()
 do method for the create operation.
 
virtual int doDelete ()
 do method for the delete operation.
 
virtual int execute ()
 do method for the execute operation.
 
virtual int draw ()
 do method for the draw operation.
 
virtual void deleteReady ()
 Informs the base that it's about to be deleted.
 
virtual bool entryFrmHeap (unsigned long size, EGG::Heap *parentHeap)
 [Unused]. Creates a heap of the given size for the base.
 
virtual bool entryFrmHeapNonAdjust (unsigned long size, EGG::Heap *parentHeap)
 [Unused]. Creates a heap of the given size for the base.
 
virtual bool createHeap ()
 [Unused]. [Does nothing].
 
virtual ~fBase_c ()
 Destroys the base.
 

Static Private Member Functions

static void setTmpCtData (const mVec3_c *position, const mAng3_c *rotation)
 Sets temporary data to be used for the next actor's construction.
 

Private Attributes

fLiNdBa_c mLinkActor
 The node in m_actorManage.
 

Static Private Attributes

static const mVec3_cm_tmpCtPosP
 Temporary storage for the next constructed actor's position. See mPos.
 
static const mAng3_cm_tmpCtAngleP
 Temporary storage for the next constructed actor's rotation. See mAngle.
 
static fLiMgBa_c m_actorManage
 A list of all actor bases.
 

Additional Inherited Members

- Protected Attributes inherited from fBase_c
u8 mLifecycleState
 The base's lifecycle state. Value is a LIFECYCLE_e.
 
bool mDeleteRequested
 If deletion of the base was requested, but the delete operation has not been scheduled yet.
 
bool mDeferExecute
 If the create operation was completed, but scheduling the execute and draw operations isn't possible at this time.
 
bool mDeferRetryCreate
 If the create operation has not been completed, and rescheduling it isn't possible at this time.
 
u8 mGroupType
 The base's group type. Value is a GROUP_TYPE_e.
 
u8 mProcControl
 The operations to be skipped. Value is a PROC_DISABLE_e.
 
fManager_c mMng
 The base's process manager.
 
fBaHelper_cmpUnusedHelper
 [Unused]. See Unused Content.
 
fLiMgBa_c mUnusedList
 [Unused]. See Unused Content.
 
EGG::FrmHeapmHeap
 [Unused]. The base's dedicated heap.
 
- Static Protected Attributes inherited from fBase_c
static int(* sLoadAsyncCallback )()
 [Unused]. See Unused Content.
 
static void(* sUnloadCallback )()
 [Unused]. See Unused Content.
 

Member Enumeration Documentation

◆ ACTOR_KIND_e

An identifier that represents the actor's kind.

[This is only used in worldmaps].

Enumerator
ACTOR_MAP_GENERIC 

A generic map actor (dWmActor_c).

ACTOR_MAP_DEMO 

A map actor affected by cutscenes (dWmDemoActor_c).

ACTOR_MAP_OBJECT 

A map object (dWmObjActor_c).

ACTOR_MAP_ENEMY 

A map enemy (dWmEnemy_c).

ACTOR_MAP_PLAYER 

The worldmap player actor (dWmPlayer_c).

ACTOR_MAP_STOP 

[Unused]. The unused map stop actor (daWmStop_c).

ACTOR_UNK_6 

[Unused]. Not used anywhere.

ACTOR_MENU_PLAYER 

The menu player actor (da2DPlayer_c).

ACTOR_GENERIC 

A generic non-map actor.

Definition at line 255 of file d_base_actor.hpp.

Constructor & Destructor Documentation

◆ dBaseActor_c()

dBaseActor_c::dBaseActor_c ( )

Constructs a new actor.

Definition at line 12 of file d_base_actor.cpp.

◆ ~dBaseActor_c()

dBaseActor_c::~dBaseActor_c ( )
protectedvirtual

Destroys the actor.

Definition at line 48 of file d_base_actor.cpp.

Member Function Documentation

◆ preCreate()

int dBaseActor_c::preCreate ( )
protectedvirtual

pre method for the create operation.

Returns
A PACK_RESULT_e value.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 52 of file d_base_actor.cpp.

◆ postCreate()

void dBaseActor_c::postCreate ( fBase_c::MAIN_STATE_e state)
protectedvirtual

post method for the create operation.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 56 of file d_base_actor.cpp.

◆ preDelete()

int dBaseActor_c::preDelete ( )
protectedvirtual

pre method for the delete operation.

Returns
A PACK_RESULT_e value.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 60 of file d_base_actor.cpp.

◆ postDelete()

void dBaseActor_c::postDelete ( fBase_c::MAIN_STATE_e state)
protectedvirtual

post method for the delete operation.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 64 of file d_base_actor.cpp.

◆ preExecute()

int dBaseActor_c::preExecute ( )
protectedvirtual

pre method for the execute operation.

Returns
A PACK_RESULT_e value.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 68 of file d_base_actor.cpp.

◆ postExecute()

void dBaseActor_c::postExecute ( fBase_c::MAIN_STATE_e state)
protectedvirtual

post method for the execute operation.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 84 of file d_base_actor.cpp.

◆ preDraw()

int dBaseActor_c::preDraw ( )
protectedvirtual

pre method for the draw operation.

Returns
A PACK_RESULT_e value.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 93 of file d_base_actor.cpp.

◆ postDraw()

void dBaseActor_c::postDraw ( fBase_c::MAIN_STATE_e state)
protectedvirtual

post method for the draw operation.

Reimplemented from dBase_c.

Reimplemented in dMdActor_c, and dWmActor_c.

Definition at line 101 of file d_base_actor.cpp.

◆ draw2D()

void dBaseActor_c::draw2D ( )
protectedvirtual

Alternate drawing function used to draw 3D models in front of 2D graphics (first draw pass).

This feature is not used in stages. See here for details.

Definition at line 105 of file d_base_actor.cpp.

◆ draw2D_lyt2()

void dBaseActor_c::draw2D_lyt2 ( )
protectedvirtual

Alternate drawing function used to draw 3D models in front of 2D graphics (second draw pass).

This feature is not used in stages. See here for details.

Definition at line 107 of file d_base_actor.cpp.

◆ GetActorType()

virtual int dBaseActor_c::GetActorType ( )
protectedvirtual

Gets the actor kind. See ACTOR_KIND_e.

Reimplemented in dMdActor_c, and dWmActor_c.

◆ finalUpdate()

virtual void dBaseActor_c::finalUpdate ( )
protectedvirtual

Code to be executed after all actors' execute operation has run.

◆ calcSpeed()

void dBaseActor_c::calcSpeed ( )

Updates the actor's speed (3D actors). See here for details.

Definition at line 143 of file d_base_actor.cpp.

◆ calcSpeedXY()

void dBaseActor_c::calcSpeedXY ( )

Updates the actor's speed (2D actors). See here for details.

Definition at line 173 of file d_base_actor.cpp.

◆ calcSpeedX()

void dBaseActor_c::calcSpeedX ( )

Updates the actor's X speed. See here for details.

Definition at line 179 of file d_base_actor.cpp.

◆ calcFallSpeed()

void dBaseActor_c::calcFallSpeed ( )

Updates the actor's falling speed. See here for details.

Definition at line 219 of file d_base_actor.cpp.

◆ calcSpeedY()

void dBaseActor_c::calcSpeedY ( )

Updates the actor's Y speed. See here for details.

Definition at line 199 of file d_base_actor.cpp.

◆ calcSpeedF()

void dBaseActor_c::calcSpeedF ( )

Updates the actor's forward speed. See here for details.

Definition at line 209 of file d_base_actor.cpp.

◆ makeMtx()

void dBaseActor_c::makeMtx ( )

Generates a partial transformation matrix for the actor and stores it in mMatrix.

The transformation matrix only contains the translation and the rotation on the Y axis.

Definition at line 155 of file d_base_actor.cpp.

◆ getCenterPos()

mVec3_c dBaseActor_c::getCenterPos ( ) const

Gets the actor's centered position.

Definition at line 229 of file d_base_actor.cpp.

◆ posMove() [1/2]

void dBaseActor_c::posMove ( mVec3_c & delta)

Moves the actor by the given delta.

Definition at line 165 of file d_base_actor.cpp.

◆ posMove() [2/2]

void dBaseActor_c::posMove ( )

Moves the actor by its speed.

Definition at line 169 of file d_base_actor.cpp.

◆ GetProfNameActorNum()

int dBaseActor_c::GetProfNameActorNum ( ProfileName profile)

Counts the instances of the given actor profile.

Definition at line 233 of file d_base_actor.cpp.

◆ draw2DActorOnLyt1()

void dBaseActor_c::draw2DActorOnLyt1 ( )
static

Calls draw2D on every actor.

Definition at line 122 of file d_base_actor.cpp.

◆ draw2DActorOnLyt2()

void dBaseActor_c::draw2DActorOnLyt2 ( )
static

Calls draw2D_lyt2 on every actor.

Definition at line 130 of file d_base_actor.cpp.

◆ construct() [1/2]

dBaseActor_c * dBaseActor_c::construct ( ProfileName profName,
unsigned long param,
const mVec3_c * position,
const mAng3_c * rotation )
static

Creates an actor without a parent.

The actor is created as a child of the current scene actor, so that all actors can be deleted on a scene change, acting as a garbage collection mechanism.

Parameters
profNameThe actor's profile name.
paramThe actor's parameters.
positionThe actor's position.
rotationThe actor's rotation.
Returns
A pointer to the instantiated actor, or nullptr .

Definition at line 114 of file d_base_actor.cpp.

◆ construct() [2/2]

dBaseActor_c * dBaseActor_c::construct ( ProfileName profName,
dBase_c * parent,
unsigned long param,
const mVec3_c * position,
const mAng3_c * rotation )
static

Creates a child actor with the given parent.

Parameters
profNameThe actor's profile name.
parentThe actor's parent. Must not be nullptr .
paramThe actor's parameters.
positionThe actor's position.
rotationThe actor's rotation.
Returns
A pointer to the instantiated actor, or nullptr .

Definition at line 138 of file d_base_actor.cpp.

◆ setTmpCtData()

void dBaseActor_c::setTmpCtData ( const mVec3_c * position,
const mAng3_c * rotation )
staticprivate

Sets temporary data to be used for the next actor's construction.

Parameters
positionThe actor's position.
rotationThe actor's rotation.

Definition at line 109 of file d_base_actor.cpp.

Member Data Documentation

◆ mLinkActor

fLiNdBa_c dBaseActor_c::mLinkActor
private

The node in m_actorManage.

Definition at line 358 of file d_base_actor.hpp.

◆ mMatrix

mMtx_c dBaseActor_c::mMatrix

The actor's partial transformation matrix. See makeMtx for details.

Definition at line 361 of file d_base_actor.hpp.

◆ mPos

mVec3_c dBaseActor_c::mPos

The actor's position.

Definition at line 363 of file d_base_actor.hpp.

◆ mLastPos

mVec3_c dBaseActor_c::mLastPos

The actor's position in the previous frame.

Definition at line 364 of file d_base_actor.hpp.

◆ mPosDelta

mVec3_c dBaseActor_c::mPosDelta

The actor's position delta since the previous frame.

Definition at line 365 of file d_base_actor.hpp.

◆ mCenterOffs

mVec3_c dBaseActor_c::mCenterOffs

The offset from the position to the center of the actor (defaults to 0).

Definition at line 367 of file d_base_actor.hpp.

◆ mScale

mVec3_c dBaseActor_c::mScale

The actor's scale (defaults to 1).

Definition at line 368 of file d_base_actor.hpp.

◆ mSpeed

mVec3_c dBaseActor_c::mSpeed

The actor's speed.

Definition at line 369 of file d_base_actor.hpp.

◆ mSpeedMax

mVec3_c dBaseActor_c::mSpeedMax

The actor's maximum speed.

Definition at line 370 of file d_base_actor.hpp.

◆ mAngle

mAng3_c dBaseActor_c::mAngle

The actor's rotation (for 2D actors).

Definition at line 372 of file d_base_actor.hpp.

◆ mAngle3D

mAng3_c dBaseActor_c::mAngle3D

The actor's rotation (for 3D actors).

Definition at line 373 of file d_base_actor.hpp.

◆ mSpeedF

float dBaseActor_c::mSpeedF

The actor's horizontal speed.

Definition at line 375 of file d_base_actor.hpp.

◆ mMaxSpeedF

float dBaseActor_c::mMaxSpeedF

The actor's maximum horizontal speed.

Definition at line 376 of file d_base_actor.hpp.

◆ mAccelY

float dBaseActor_c::mAccelY

The actor's vertical acceleration.

Definition at line 377 of file d_base_actor.hpp.

◆ mMaxFallSpeed

float dBaseActor_c::mMaxFallSpeed

The actor's maximum fall speed.

Definition at line 378 of file d_base_actor.hpp.

◆ mAccelF

float dBaseActor_c::mAccelF

The actor's horizontal acceleration.

Definition at line 379 of file d_base_actor.hpp.

◆ mActorProperties

u32 dBaseActor_c::mActorProperties

The actor's properties. See fProfile::fActorProfile_c::mActorProperties.

Definition at line 381 of file d_base_actor.hpp.

◆ mVisible

bool dBaseActor_c::mVisible

Whether the actor should be visible or not. Defaults to true .

Definition at line 382 of file d_base_actor.hpp.

◆ m_tmpCtPosP

const mVec3_c * dBaseActor_c::m_tmpCtPosP
staticprivate

Temporary storage for the next constructed actor's position. See mPos.

Definition at line 385 of file d_base_actor.hpp.

◆ m_tmpCtAngleP

const mAng3_c * dBaseActor_c::m_tmpCtAngleP
staticprivate

Temporary storage for the next constructed actor's rotation. See mAngle.

Definition at line 386 of file d_base_actor.hpp.

◆ m_actorManage

fLiMgBa_c dBaseActor_c::m_actorManage
staticprivate

A list of all actor bases.

Definition at line 387 of file d_base_actor.hpp.