|
NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
|
#include <game/bases/d_rail.hpp>
Manages movement along rails.
Definition at line 7 of file d_rail.hpp.
Public Types | |
| enum | RAIL_FLAGS_e { RAIL_FLAG_LOOP = BIT_FLAG(1) , RAIL_FLAG_DELAYING = BIT_FLAG(2) , RAIL_FLAG_DISABLED = BIT_FLAG(3) } |
| enum | NODE_FLAGS_e { NODE_FLAG_1 = BIT_FLAG(0) } |
Public Member Functions | |
| virtual | ~dRail_c () |
| Destroys the rail handler. | |
| virtual void | calcSpeed () |
| Calculates and applies the new speed based on the current and next node. | |
| bool | set (u8 id, mVec3_c *pos, mVec3_c *speed, float *speedF, u16 startIndex, u8 reverse) |
| Initializes the rail with the specified ID and parameters. | |
| bool | calcNextPoint () |
| Advances the node index to the next target point. | |
| void | calcTargetPos () |
| Calculates the target position based on the next node. | |
| bool | execute () |
| Executes the rail movement logic. Returns whether a target node has been reached. | |
| bool | checkArrive () |
| Checks whether the rail has arrived at the next target node. | |
Static Public Member Functions | |
| static sRailInfoData * | getRailInfoP (u8 id) |
| Gets the rail data for the specified ID. | |
Public Attributes | |
| sRailNodeData * | mpNodes |
| The array of rail nodes. | |
| mVec2_c | mTargetPos |
| The position of the next node. | |
| mVec3_c * | mpPos |
| Reference to the position of the object on the rail. | |
| mVec3_c * | mpSpeed |
| Reference to the speed vector of the object on the rail. | |
| float * | mpSpeedF |
| Reference to the forward speed of the object on the rail. | |
| u16 | mCount |
| The number of nodes in the rail. | |
| short | mIdxCurr |
| The current node index. | |
| short | mIdxNext |
| The next node index. | |
| u16 | mDelayTimer |
| By how many frames to delay before starting movement from a node. | |
| u16 | mAngle |
| The current angle of movement. | |
| u16 | mFlags |
| The rail flags. | |
| u16 | mNodeFlags |
| The current node flags. | |
| u8 | mReverse |
| Whether to go through the rail in reverse. | |
| int | mAngleCalcTimer |
| Cooldown timer for angle recalculation. | |
| bool | mBounce |
| Whether to reverse direction at the ends of the rail (only applicable if not looping). | |
Definition at line 34 of file d_rail.hpp.
Definition at line 41 of file d_rail.hpp.
|
inlinevirtual |
Destroys the rail handler.
Definition at line 9 of file d_rail.hpp.
|
virtual |
Calculates and applies the new speed based on the current and next node.
Definition at line 95 of file d_rail.cpp.
| bool dRail_c::set | ( | u8 | id, |
| mVec3_c * | pos, | ||
| mVec3_c * | speed, | ||
| float * | speedF, | ||
| u16 | startIndex, | ||
| u8 | reverse ) |
Initializes the rail with the specified ID and parameters.
| id | The ID of the rail to use. |
| pos | Pointer to the position vector of the object on the rail. |
| speed | Pointer to the speed vector of the object on the rail. |
| speedF | Pointer to the forward speed of the object on the rail. |
| startIndex | The starting node index on the rail. |
| reverse | Whether the object should travel the rail in reverse. |
Definition at line 16 of file d_rail.cpp.
| bool dRail_c::calcNextPoint | ( | ) |
Advances the node index to the next target point.
Definition at line 53 of file d_rail.cpp.
| void dRail_c::calcTargetPos | ( | ) |
Calculates the target position based on the next node.
Definition at line 85 of file d_rail.cpp.
| bool dRail_c::execute | ( | ) |
Executes the rail movement logic. Returns whether a target node has been reached.
Definition at line 133 of file d_rail.cpp.
| bool dRail_c::checkArrive | ( | ) |
Checks whether the rail has arrived at the next target node.
Definition at line 170 of file d_rail.cpp.
|
static |
Gets the rail data for the specified ID.
Definition at line 4 of file d_rail.cpp.
| sRailNodeData* dRail_c::mpNodes |
The array of rail nodes.
Definition at line 45 of file d_rail.hpp.
| mVec2_c dRail_c::mTargetPos |
The position of the next node.
Definition at line 46 of file d_rail.hpp.
| mVec3_c* dRail_c::mpPos |
Reference to the position of the object on the rail.
Definition at line 47 of file d_rail.hpp.
| mVec3_c* dRail_c::mpSpeed |
Reference to the speed vector of the object on the rail.
Definition at line 48 of file d_rail.hpp.
| float* dRail_c::mpSpeedF |
Reference to the forward speed of the object on the rail.
Definition at line 49 of file d_rail.hpp.
| u16 dRail_c::mCount |
The number of nodes in the rail.
Definition at line 50 of file d_rail.hpp.
| short dRail_c::mIdxCurr |
The current node index.
Definition at line 51 of file d_rail.hpp.
| short dRail_c::mIdxNext |
The next node index.
Definition at line 52 of file d_rail.hpp.
| u16 dRail_c::mDelayTimer |
By how many frames to delay before starting movement from a node.
Definition at line 53 of file d_rail.hpp.
| u16 dRail_c::mAngle |
The current angle of movement.
Definition at line 54 of file d_rail.hpp.
| u16 dRail_c::mFlags |
The rail flags.
Definition at line 55 of file d_rail.hpp.
| u16 dRail_c::mNodeFlags |
The current node flags.
Definition at line 56 of file d_rail.hpp.
| u8 dRail_c::mReverse |
Whether to go through the rail in reverse.
Definition at line 57 of file d_rail.hpp.
| int dRail_c::mAngleCalcTimer |
Cooldown timer for angle recalculation.
Definition at line 58 of file d_rail.hpp.
| bool dRail_c::mBounce |
Whether to reverse direction at the ends of the rail (only applicable if not looping).
Definition at line 59 of file d_rail.hpp.