NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_base_actor.hpp
1#pragma once
2#include <types.h>
3#include <game/bases/d_base.hpp>
4#include <game/cLib/c_list.hpp>
5#include <game/framework/f_list_mg.hpp>
6#include <game/mLib/m_angle.hpp>
7#include <game/mLib/m_mtx.hpp>
8#include <game/mLib/m_vec.hpp>
9
250class dBaseActor_c : public dBase_c {
251public:
252
266
267 dBaseActor_c();
268
269protected:
270 virtual int preCreate();
271 virtual void postCreate(fBase_c::MAIN_STATE_e status);
272
273 virtual int preDelete();
274 virtual void postDelete(fBase_c::MAIN_STATE_e status);
275
276 virtual int preExecute();
277 virtual void postExecute(fBase_c::MAIN_STATE_e status);
278
279 virtual int preDraw();
280 virtual void postDraw(fBase_c::MAIN_STATE_e status);
281
282 virtual ~dBaseActor_c();
283
287 virtual void draw2D();
288
292 virtual void draw2D_lyt2();
293
294 virtual int GetActorType();
295
296 virtual void finalUpdate();
297
298public:
300 void calcSpeed();
301
303 void calcSpeedXY();
304
305 void calcSpeedX();
306 void calcFallSpeed();
307 void calcSpeedY();
308 void calcSpeedF();
309
312 void makeMtx();
313
314 mVec3_c getCenterPos() const;
315 void posMove(mVec3_c &delta);
316 void posMove();
317
318 // [why is this not static?]
319 int GetProfNameActorNum(ProfileName profile);
320
321 static void draw2DActorOnLyt1();
322 static void draw2DActorOnLyt2();
323
335 static dBaseActor_c *construct(ProfileName profName, unsigned long param, const mVec3_c *position, const mAng3_c *rotation);
336
347 static dBaseActor_c *construct(ProfileName profName, dBase_c *parent, unsigned long param, const mVec3_c *position, const mAng3_c *rotation);
348
349private:
356 static void setTmpCtData(const mVec3_c *position, const mAng3_c *rotation);
357
359
360public:
362
366
371
374
375 float mSpeedF;
377 float mAccelY;
379 float mAccelF;
380
382 bool mVisible;
383
384private:
385 static const mVec3_c *m_tmpCtPosP;
386 static const mAng3_c *m_tmpCtAngleP;
388};
The minimum required implementation for an actor base.
bool mVisible
Whether the actor should be visible or not. Defaults to true .
mAng3_c mAngle3D
The actor's rotation (for 3D actors).
void calcSpeedXY()
Updates the actor's speed (2D actors). See here for details.
int GetProfNameActorNum(ProfileName profile)
Counts the instances of the given actor profile.
mMtx_c mMatrix
The actor's partial transformation matrix. See makeMtx for details.
virtual int preDraw()
pre method for the draw operation.
mVec3_c mScale
The actor's scale (defaults to 1).
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.
virtual void draw2D_lyt2()
Alternate drawing function used to draw 3D models in front of 2D graphics (second draw pass).
mVec3_c mSpeedMax
The actor's maximum speed.
void makeMtx()
Generates a partial transformation matrix for the actor and stores it in mMatrix.
virtual void postExecute(fBase_c::MAIN_STATE_e status)
post method for the execute operation.
virtual void postDraw(fBase_c::MAIN_STATE_e status)
post method for the draw operation.
static const mVec3_c * m_tmpCtPosP
Temporary storage for the next constructed actor's position. See mPos.
virtual void finalUpdate()
Code to be executed after all actors' execute operation has run.
void calcSpeedX()
Updates the actor's X speed. See here for details.
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()
Updates the actor's falling speed. See here for details.
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()
pre method for the delete operation.
float mSpeedF
The actor's horizontal speed.
virtual void postDelete(fBase_c::MAIN_STATE_e status)
post method for the delete operation.
void posMove()
Moves the actor by its speed.
virtual void draw2D()
Alternate drawing function used to draw 3D models in front of 2D graphics (first draw pass).
virtual int GetActorType()
Gets the actor kind. See ACTOR_KIND_e.
float mMaxFallSpeed
The actor's maximum fall speed.
void calcSpeed()
Updates the actor's speed (3D actors). See here for details.
mVec3_c getCenterPos() const
Gets the actor's centered position.
static const mAng3_c * m_tmpCtAngleP
Temporary storage for the next constructed actor's rotation. See mAngle.
void calcSpeedF()
Updates the actor's forward speed. See here for details.
static fLiMgBa_c m_actorManage
A list of all actor bases.
mAng3_c mAngle
The actor's rotation (for 2D actors).
static void draw2DActorOnLyt2()
Calls draw2D_lyt2 on every actor.
virtual ~dBaseActor_c()
Destroys the actor.
virtual void postCreate(fBase_c::MAIN_STATE_e status)
post method for the create operation.
u32 mActorProperties
The actor's properties. See fProfile::fActorProfile_c::mActorProperties.
float mAccelY
The actor's vertical acceleration.
float mMaxSpeedF
The actor's maximum horizontal speed.
void calcSpeedY()
Updates the actor's Y speed. See here for details.
virtual int preExecute()
pre method for the execute operation.
virtual int preCreate()
pre method for the create operation.
static void draw2DActorOnLyt1()
Calls draw2D on every actor.
ACTOR_KIND_e
An identifier that represents the actor's kind.
@ ACTOR_MAP_STOP
[Unused]. The unused map stop actor (daWmStop_c).
@ ACTOR_MAP_ENEMY
A map enemy (dWmEnemy_c).
@ ACTOR_MAP_GENERIC
A generic map actor (dWmActor_c).
@ ACTOR_MAP_OBJECT
A map object (dWmObjActor_c).
@ ACTOR_MAP_DEMO
A map actor affected by cutscenes (dWmDemoActor_c).
@ ACTOR_UNK_6
[Unused]. Not used anywhere.
@ ACTOR_MAP_PLAYER
The worldmap player actor (dWmPlayer_c).
@ ACTOR_GENERIC
A generic non-map actor.
@ ACTOR_MENU_PLAYER
The menu player actor (da2DPlayer_c).
dBaseActor_c()
Constructs a new actor.
The minimum required implementation for a base.
Definition d_base.hpp:41
MAIN_STATE_e
The possible operation results.
Definition f_base.hpp:137
A base list, made of fLiNdBa_c nodes.
Definition f_list_mg.hpp:13
A base list node.
Definition f_list_nd.hpp:11
A three-dimensional short angle vector.
Definition m_angle.hpp:60
A 3x4 matrix.
Definition m_mtx.hpp:9
A three-dimensional floating point vector.
Definition m_vec.hpp:100
u16 ProfileName
The name of a profile. Value is a fProfile::PROFILE_NAME_e.
Definition f_profile.hpp:32