NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
d_a_obj_center2.hpp
1#pragma once
2
3#include <game/bases/d_actor_state.hpp>
4
5/// @brief A controller for rotating objects around a center point.
6/// @statetable
7/// @paramtable
8/// @ingroup bases
10public:
11 /// @brief The possible rotation modes of the controller.
13 MODE_BACK_AND_FORTH, ///< Move to the stop target when active, move back when inactive.
14 MODE_PERMANENT, ///< Permamently rotate in one direction.
15 MODE_WHILE_ACTIVE ///< Rotate by TargetRotationOffset when the linked event is active.
16 };
17
18 daObjCenter2_c() {} ///< @copydoc dActorState_c::dActorState_c
19 ~daObjCenter2_c() {} ///< @copydoc dActorState_c::~dActorState_c
20
21 virtual int create() override;
22 virtual int execute() override;
23
24 STATE_FUNC_DECLARE(daObjCenter2_c, ReturnHome); ///< Returning to the home rotation.
25 STATE_FUNC_DECLARE(daObjCenter2_c, GoAim); ///< Rotating to the stop rotation.
26 STATE_FUNC_DECLARE(daObjCenter2_c, Move); ///< Rotating in one direction.
27
28 void coinSE(); ///< Plays a coin sound effect if the actor is configured to do so.
29 short getAngle(); ///< Returns the home rotation angle of this rotation controller.
30 void tryPlayCoinSE(); ///< Plays a coin sound effect if it has not been played yet for the current rotation.
31
32 int mAngDelta; ///< The incremental change in rotation per frame.
33 u8 mPad[4]; ///< @unused
34 short mRotationSpeed; ///< The angular speed of the rotation.
35 short mHomeRotation; ///< The starting rotation.
36 short mTargetRotation; ///< The current rotation the controller is targeting.
37 bool mCoinSoundReady; ///< Whether the coin sound is ready to be played.
38 bool mCoinSoundPlayed; ///< Whether the coin sound has been played.
39 u8 mRotationMode; ///< The rotation mode. See RotationMode_e.
40 u8 mRotDir; ///< The rotation direction. See DIRECTION_LR_e (right = clockwise, left = counter-clockwise).
41 u8 mRotationID; ///< The rotation ID to be set on the affected objects.
42 u8 mZoomControl; ///< Whether the zoom level is controlled by the rotation controller. [Unknown what 1 and 2 mean].
43
44 ACTOR_PARAM_CONFIG(RotID, 0, 8); ///< @copydoc mRotationID
45 ACTOR_PARAM_CONFIG(RotateShock, 8, 1); ///< Shakes the screen when the rotation is complete.
46 ACTOR_PARAM_CONFIG(RotateCoinSE, 9, 1); ///< Enables playing a coin sound effect at the end of a rotation.
47 ACTOR_PARAM_CONFIG(ZoomControl, 10, 2); ///< @copydoc mZoomControl
48 ACTOR_PARAM_CONFIG(IsCCW, 12, 1); ///< The rotation direction, 0 for clockwise, 1 for counter-clockwise.
49 ACTOR_PARAM_CONFIG(RotationMode, 16, 2); ///< @copydoc mRotationMode
50 ACTOR_PARAM_CONFIG(RotationSpeed, 20, 3); ///< The angular speed of the rotation. See l_RotSpeed in create() for the possible values.
51 ACTOR_PARAM_CONFIG(TargetRotationOffset, 24, 4); ///< The target rotation offset for #MODE_BACK_AND_FORTH and #MODE_WHILE_ACTIVE.
52 ACTOR_PARAM_CONFIG(InitialRotation, 28, 4); ///< The starting rotation.
53};
dActorState_c()
Constructs a new actor.
~daObjCenter2_c()
Destroys the actor.
ACTOR_PARAM_CONFIG(TargetRotationOffset, 24, 4)
The target rotation offset for MODE_BACK_AND_FORTH and MODE_WHILE_ACTIVE.
ACTOR_PARAM_CONFIG(RotateShock, 8, 1)
Shakes the screen when the rotation is complete.
ACTOR_PARAM_CONFIG(InitialRotation, 28, 4)
The starting rotation.
u8 mZoomControl
Whether the zoom level is controlled by the rotation controller. [Unknown what 1 and 2 mean].
daObjCenter2_c()
Constructs a new actor.
int mAngDelta
The incremental change in rotation per frame.
short getAngle()
Returns the home rotation angle of this rotation controller.
void tryPlayCoinSE()
Plays a coin sound effect if it has not been played yet for the current rotation.
ACTOR_PARAM_CONFIG(RotID, 0, 8)
The rotation ID to be set on the affected objects.
u8 mRotationID
The rotation ID to be set on the affected objects.
virtual int create() override
do method for the create operation.
short mHomeRotation
The starting rotation.
virtual int execute() override
do method for the execute operation.
RotationMode_e
The possible rotation modes of the controller.
@ MODE_WHILE_ACTIVE
Rotate by TargetRotationOffset when the linked event is active.
@ MODE_PERMANENT
Permamently rotate in one direction.
@ MODE_BACK_AND_FORTH
Move to the stop target when active, move back when inactive.
ACTOR_PARAM_CONFIG(IsCCW, 12, 1)
The rotation direction, 0 for clockwise, 1 for counter-clockwise.
bool mCoinSoundReady
Whether the coin sound is ready to be played.
u8 mRotationMode
The rotation mode. See RotationMode_e.
bool mCoinSoundPlayed
Whether the coin sound has been played.
ACTOR_PARAM_CONFIG(RotationMode, 16, 2)
The rotation mode. See RotationMode_e.
ACTOR_PARAM_CONFIG(ZoomControl, 10, 2)
Whether the zoom level is controlled by the rotation controller. [Unknown what 1 and 2 mean].
short mTargetRotation
The current rotation the controller is targeting.
u8 mRotDir
The rotation direction. See DIRECTION_LR_e (right = clockwise, left = counter-clockwise).
short mRotationSpeed
The angular speed of the rotation.
void coinSE()
Plays a coin sound effect if the actor is configured to do so.
ACTOR_PARAM_CONFIG(RotateCoinSE, 9, 1)
Enables playing a coin sound effect at the end of a rotation.
ACTOR_PARAM_CONFIG(RotationSpeed, 20, 3)
The angular speed of the rotation. See l_RotSpeed in create() for the possible values.
#define STATE_FUNC_DECLARE(class, name)
Declares a state.
Definition s_State.hpp:12