coastline 0.0.4
Loading...
Searching...
No Matches
vehiclereset.h File Reference
#include "common/vehicle.h"
Include dependency graph for vehiclereset.h:

Go to the source code of this file.

Functions

void ResetVehicleState (Vehicle *vehicle)
 Reset vehicle transforms and apply the selected car's physics.
void InitVehiclePhysics (Vehicle *vehicle)
 Initialise the body, wheels, and force chains for the selected model.
void InitVehicleColorAndPhysics (Vehicle *vehicle)
 Apply release-specific model paint and initialise physics.
void SetVehicleModelSlot (Vehicle *vehicle, s32 slot)
 Bind a model slot and initialise its colour and physics.
void ClearVehicleDamageState (Vehicle *vehicle)
 Clear dents and the dent variation.
void SetupVehicleForRaceStart (Vehicle *vehicle)
 Place the vehicle on the starting grid and initialise race state.
void RespawnVehicle (Vehicle *vehicle)
 Return an overturned or fallen vehicle to its current route point.
void SetVehicleVelocity (Vehicle *vehicle, f32 x, f32 y, f32 z)
 Set velocity in the rigid-body integration states and the recorded placement.
void SetVehiclePosition (Vehicle *vehicle, f32 x, f32 y, f32 z)
 Set the position in the frame, spray origin, and rigid-body integration states.
void InitVehicleOrientationFromAngle (Vehicle *vehicle, f32 angle)
 Initialise the vehicle and integration orientations from a heading in radians.
void SetVehicleFrameMatrix (Vehicle *vehicle, f32(*m)[4])
 Set the frame matrix and copy its orientation to the integration states.
void RotateVehicleByEuler (Vehicle *vehicle, f32 yaw, f32 pitch, f32 roll)
 Apply yaw, pitch, and roll rotations in radians to the integration orientations.
void SetVehicleTurnRate (Vehicle *vehicle, f32 x, f32 y, f32 z)
 Set angular velocity in the rigid-body integration states.

Function Documentation

◆ ResetVehicleState()

void ResetVehicleState ( Vehicle * vehicle)

Reset vehicle transforms and apply the selected car's physics.

Parameters
vehicleThe vehicle whose model and setup choices are already selected.

◆ InitVehiclePhysics()

void InitVehiclePhysics ( Vehicle * vehicle)

Initialise the body, wheels, and force chains for the selected model.

Parameters
vehicleThe vehicle to initialise; a null model skips body and wheel initialisation.

◆ InitVehicleColorAndPhysics()

void InitVehicleColorAndPhysics ( Vehicle * vehicle)

Apply release-specific model paint and initialise physics.

Parameters
vehicleThe vehicle whose model and colour selections have been populated.

◆ SetVehicleModelSlot()

void SetVehicleModelSlot ( Vehicle * vehicle,
s32 slot )

Bind a model slot and initialise its colour and physics.

Parameters
vehicleThe vehicle receiving the selected model.
slotA valid index in g_aVehicleModels.

◆ ClearVehicleDamageState()

void ClearVehicleDamageState ( Vehicle * vehicle)

Clear dents and the dent variation.

Parameters
vehicleThe vehicle whose visual damage is reset.

◆ SetupVehicleForRaceStart()

void SetupVehicleForRaceStart ( Vehicle * vehicle)

Place the vehicle on the starting grid and initialise race state.

Parameters
vehicleThe configured vehicle with a loaded model and assigned grid position.

◆ RespawnVehicle()

void RespawnVehicle ( Vehicle * vehicle)

Return an overturned or fallen vehicle to its current route point.

Parameters
vehicleThe active vehicle with a valid track section and point index.

◆ SetVehicleVelocity()

void SetVehicleVelocity ( Vehicle * vehicle,
f32 x,
f32 y,
f32 z )

Set velocity in the rigid-body integration states and the recorded placement.

Parameters
vehicleThe vehicle whose linear velocity changes.
xThe world x velocity, in world units per second.
yThe world y velocity, in world units per second.
zThe world z velocity, in world units per second.

◆ SetVehiclePosition()

void SetVehiclePosition ( Vehicle * vehicle,
f32 x,
f32 y,
f32 z )

Set the position in the frame, spray origin, and rigid-body integration states.

Parameters
vehicleThe vehicle to reposition.
xThe world x coordinate.
yThe world y coordinate.
zThe world z coordinate.

◆ InitVehicleOrientationFromAngle()

void InitVehicleOrientationFromAngle ( Vehicle * vehicle,
f32 angle )

Initialise the vehicle and integration orientations from a heading in radians.

Parameters
vehicleThe vehicle whose orientation changes.
angleThe heading in the world XY plane, in radians about the z axis.

◆ SetVehicleFrameMatrix()

void SetVehicleFrameMatrix ( Vehicle * vehicle,
f32(*) m[4] )

Set the frame matrix and copy its orientation to the integration states.

Parameters
vehicleThe vehicle whose frame and body orientation change.
mThe readable 4-by-4 frame matrix, copied during this call.

◆ RotateVehicleByEuler()

void RotateVehicleByEuler ( Vehicle * vehicle,
f32 yaw,
f32 pitch,
f32 roll )

Apply yaw, pitch, and roll rotations in radians to the integration orientations.

Parameters
vehicleThe vehicle whose orientation changes.
yawThe rotation about the local z axis, applied first, in radians.
pitchThe rotation about the local y axis, applied second, in radians.
rollThe rotation about the local x axis, applied last, in radians.

◆ SetVehicleTurnRate()

void SetVehicleTurnRate ( Vehicle * vehicle,
f32 x,
f32 y,
f32 z )

Set angular velocity in the rigid-body integration states.

Parameters
vehicleThe vehicle whose angular velocity changes.
xThe x component of angular velocity, in radians per second.
yThe y component of angular velocity, in radians per second.
zThe z component of angular velocity, in radians per second.