1#include <dol/bases/d_base_actor.hpp>
2#include <dol/bases/d_reset.hpp>
3#include <dol/bases/d_scene.hpp>
12dBaseActor_c::dBaseActor_c() :
20 m_actorManage.append(&mLinkActor);
23 if (m_tmpCtPosP !=
nullptr) {
25 mLastPos = *m_tmpCtPosP;
28 if (m_tmpCtAngleP !=
nullptr) {
29 mAngle = *m_tmpCtAngleP;
30 mLastAngle = *m_tmpCtAngleP;
48dBaseActor_c::~dBaseActor_c() {
bool remove(cListNd_c *node)
Removes a node from the list.
Basic actor class, supporting positioning, rotation and movement/acceleration.
mAng3_c mLastAngle
The actor's rotation in the previous frame.
bool mVisible
Whether the actor should be visible or not. Defaults to true .
void calcSpeedXY()
Updates the actor's speed (2D actors).
int GetProfNameActorNum(ProfileName profile)
Counts the instances of the given actor profile.
mMtx_c mMatrix
The actor's world matrix.
virtual int preDraw()
Code to be executed before draw.
float mAccelF
The actor's horizontal acceleration.
mVec3_c mSpeed
The actor's speed.
mVec3_c mLastPos
The actor's position in the previous frame.
mVec3_c mPos
The actor's position (top-left corner).
virtual void draw2D_lyt2()
Alternate drawing function for drawing in front of 2D layouts (second draw pass).
mVec3_c mSpeedMax
The actor's maximum speed.
void makeMtx()
Updates the actor's world matrix.
virtual void postExecute(fBase_c::MAIN_STATE_e status)
Code to be executed after execute.
virtual void postDraw(fBase_c::MAIN_STATE_e status)
See dBase_c::postDraw.
static const mVec3_c * m_tmpCtPosP
Temporary storage for the next constructed actor's position. See mPos.
void calcSpeedX()
Applies mAccelF to the actor's X speed, using mSpeedMax as the speed limit.
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).
void calcFallSpeed()
Applies mAccelY to the actor's Y speed, using mMaxFallSpeed as the speed limit.
fLiNdBa_c mLinkActor
The node in m_actorManage.
static void setTmpCtData(const mVec3_c *position, const mAng3_c *rotation)
Sets temporary data to be used for the next actor's construction.
static dBaseActor_c * construct(ProfileName profName, unsigned long param, const mVec3_c *position, const mAng3_c *rotation)
Creates an actor without a parent.
virtual int preDelete()
See dBase_c::preDelete.
float mSpeedF
The actor's horizontal speed.
virtual void postDelete(fBase_c::MAIN_STATE_e status)
See dBase_c::postDelete.
void posMove()
Moves the actor by its speed.
virtual void draw2D()
Alternate drawing function for drawing in front of 2D layouts (first draw pass).
float mMaxFallSpeed
The actor's maximum fall speed.
void calcSpeed()
Updates the actor's speed (3D actors).
mVec3_c getCenterPos() const
Gets the actor's center position.
static const mAng3_c * m_tmpCtAngleP
Temporary storage for the next constructed actor's rotation. See mAngle.
void calcSpeedF()
Applies mAccelF to mSpeedF, using mMaxSpeedF as the speed limit.
static fLiMgBa_c m_actorManage
A list of all the constructed actors.
mAng3_c mAngle
The actor's rotation.
static void draw2DActorOnLyt2()
Calls draw2D_lyt2 on every actor.
virtual void postCreate(fBase_c::MAIN_STATE_e status)
See dBase_c::postCreate.
float mAccelY
The actor's vertical acceleration.
float mMaxSpeedF
The actor's maximum horizontal speed.
void calcSpeedY()
Applies mAccelY to the actor's Y speed, using mSpeedMax as the speed limit.
virtual int preExecute()
Code to be executed before execute.
virtual int preCreate()
See dBase_c::preCreate.
static void draw2DActorOnLyt1()
Calls draw2D on every actor.
An extension of fBase_c with base kind and name strings.
virtual int preDelete()
See fBase_c::preDelete.
virtual void postExecute(fBase_c::MAIN_STATE_e status)
See fBase_c::postExecute.
virtual void postDraw(fBase_c::MAIN_STATE_e status)
See fBase_c::postDraw.
virtual void postCreate(fBase_c::MAIN_STATE_e status)
See fBase_c::postCreate.
virtual int preDraw()
Code to be executed before draw.
virtual void postDelete(fBase_c::MAIN_STATE_e status)
See fBase_c::postDelete.
virtual int preExecute()
Code to be executed before execute.
virtual int preCreate()
See fBase_c::preCreate.
static dBase_c * createBase(ProfileName profName, dBase_c *parent, unsigned long param, u8 groupType)
See fBase_c::createChild.
static dBase_c * searchBaseByProfName(ProfileName profile, const dBase_c *parent)
Searches for a base with a given profile name, optionally under a given parent.
System reset management class.
static dReset::Manage_c * GetInstance()
Gets a pointer to the instance of this class.
int mModeProc
The game's current running state. See Mode_e.
@ SAFETY_WAIT
The game is about to execute the hard reset procedure indicated in mExecMode.
@ SOFT_RESET
The game is being soft reset (from the Home Menu).
int mModeInit
The running state the game's about to switch to. See Mode_e.
static ProfileName m_nowScene
The profile name of the current scene.
MAIN_STATE_e
The possible operation results.
@ SUCCESS
The operation was completed successfully.
@ ACTOR
The base is an actor.
@ NOT_READY
The step could not completed at this time.
A base list, made of fLiNdBa_c nodes.
int countNodeByProfName(ProfileName profName) const
Counts the number of bases using the given profile name.
static fBase_c * searchBaseByGroupType(unsigned char groupType, const fBase_c *parent)
Searches for a base with a given group type, optionally under a given parent.
A three-dimensional short angle vector.
s16 y
The rotation on the Y axis.
void YrotM(mAng angle)
Rotates the matrix on the Y axis by the given angle.
A three-dimensional floating point vector.
float y
The coordinates on the Y axis.
float x
The coordinates on the X axis.
float z
The coordinates on the Z axis.
void PSMTXTrans(Mtx *mtx, float x, float y, float z)
Sets a translation matrix with the given components.
u16 ProfileName
The name of a profile. Value is a fProfile::PROFILE_NAME_e.
const fBaseProfile_c *(* sProfileList)[PROFILE_COUNT]
A list of all profiles.
float fmin(float x, float y)
Gets the minimum float between x and y .
float fmax(float x, float y)
Gets the maximum float between x and y .
float CosS(short ang)
Computes the cosine value.
float SinS(short ang)
Computes the sine value.
A set of basic information needed to construct an actor base.
u32 mActorProperties
Various actor-related properties.
A one-dimensional short angle vector.