2#include <game/bases/d_cd.hpp>
22 bool set(u8
id,
mVec3_c *pos,
mVec3_c *speed,
float *speedF, u16 startIndex, u8 reverse);
35 RAIL_FLAG_LOOP = BIT_FLAG(1),
36 RAIL_FLAG_DELAYING = BIT_FLAG(2),
37 RAIL_FLAG_DISABLED = BIT_FLAG(3)
42 NODE_FLAG_1 = BIT_FLAG(0)
Manages movement along rails.
void calcTargetPos()
Calculates the target position based on the 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.
u16 mFlags
The rail flags.
float * mpSpeedF
Reference to the forward speed of the object on the rail.
mVec3_c * mpSpeed
Reference to the speed vector of the object on the rail.
bool calcNextPoint()
Advances the node index to the next target point.
mVec3_c * mpPos
Reference to the position of the object on the rail.
short mIdxCurr
The current node index.
virtual ~dRail_c()
Destroys the rail handler.
short mIdxNext
The next node index.
u16 mAngle
The current angle of movement.
bool mBounce
Whether to reverse direction at the ends of the rail (only applicable if not looping).
virtual void calcSpeed()
Calculates and applies the new speed based on the current and next node.
bool execute()
Executes the rail movement logic. Returns whether a target node has been reached.
u16 mCount
The number of nodes in the rail.
mVec2_c mTargetPos
The position of the next node.
u8 mReverse
Whether to go through the rail in reverse.
sRailNodeData * mpNodes
The array of rail nodes.
u16 mNodeFlags
The current node flags.
static sRailInfoData * getRailInfoP(u8 id)
Gets the rail data for the specified ID.
int mAngleCalcTimer
Cooldown timer for angle recalculation.
u16 mDelayTimer
By how many frames to delay before starting movement from a node.
bool checkArrive()
Checks whether the rail has arrived at the next target node.
A two-dimensional floating point vector.
A three-dimensional floating point vector.