|
coastline 0.0.4
|
The vehicles of a race, the cars they are, and their place on the track. More...
#include "common/camerachange.h"#include "common/vehiclepaint.h"#include "common/vehiclestatus.h"#include "common/vehicletrackpos.h"#include <PR/gbi.h>#include <PR/ultratypes.h>#include "common/carphysics.h"#include "common/input.h"#include "common/profile.h"#include "common/racerslot.h"#include "common/render.h"#include "common/rigidbody.h"#include "common/system.h"#include "common/track.h"#include "common/vecmath.h"#include "common/vehiclecamera.h"#include "common/vehiclecount.h"#include "common/vehicleeffects.h"#include "common/vehicleforces.h"#include "common/vehiclemodel.h"#include "common/wheelframe.h"

Go to the source code of this file.
Classes | |
| struct | CarModel |
| A car the players can choose. More... | |
| struct | VehicleModelLoad |
| The decompression of the model of a car into a slot. More... | |
| struct | Vehicle |
| A vehicle. More... | |
Macros | |
| #define | MAX_VEHICLES 4 |
| The number of vehicles a race can hold. | |
| #define | VEHICLE_LAP_TIMES 5 |
| The laps of a race whose times a vehicle keeps. | |
| #define | CAR_MODELS 13 |
| The cars the players can choose. | |
| #define | VEHICLE_MODEL_SLOTS 4 |
| The slots the models of the cars of the menus load into. | |
| #define | VEHICLE_GHOST 2 |
| The ghost mode of a vehicle that other vehicles pass through and that fades back in. | |
Functions | |
| void | UpdateVehiclePhysicsFrame (Vehicle *vehicle) |
| Run a frame of a vehicle: fly it, or put it on the ground, drive its wheels and step its physics. | |
| void | SetVehiclePosition (Vehicle *vehicle, f32 x, f32 y, f32 z) |
| Put a vehicle at a position, with its body and the states of its steps. | |
| void | InitVehicleOrientationFromAngle (Vehicle *vehicle, f32 angle) |
| Turn a vehicle upright to face an angle about the vertical. | |
| void | SetVehicleFrameMatrix (Vehicle *vehicle, f32(*m)[4]) |
| Set the frame of a vehicle and the orientation of its body from a matrix. | |
| void | SetVehicleVelocity (Vehicle *vehicle, f32 x, f32 y, f32 z) |
| Set the velocity of a vehicle. | |
| void | RotateVehicleByEuler (Vehicle *vehicle, f32 yaw, f32 pitch, f32 roll) |
| Turn the body of a vehicle by angles about its vertical, sideways and forward axes, in turn. | |
| void | SetVehicleTurnRate (Vehicle *vehicle, f32 x, f32 y, f32 z) |
| Set the angular velocity of a vehicle. | |
| void | InitVehicleColorAndPhysics (Vehicle *vehicle) |
| Paint the model of a vehicle its colour and set up its physics. | |
| void | SetVehicleModelSlot (Vehicle *vehicle, s32 slot) |
| Give a vehicle the model of a slot. | |
| void | InstallVehicleModel (Vehicle *vehicle, s32 slot, s32 car) |
| Load the model of a car into a slot and give it to a vehicle. | |
| void | InstallVehicleModelCopy (Vehicle *vehicle, s32 slot, s32 car) |
| Load the model of a car into a slot and give it to a vehicle, as InstallVehicleModel() does. | |
| void | LoadAndActivateTrackWithPaintColor (Vehicle *vehicle, s32 slot, s32 car) |
| Load the model of a car into a slot, give it to a vehicle, and paint it the color of the vehicle. | |
| void | LoadVehicleModel (VehicleModelLoad *load, s32 slot, s32 car, s32 buffer) |
| Start loading the model of a car into a slot through a buffer of g_aDmaWorkBuffers. | |
| s32 | IsVehicleModelLoaded (VehicleModelLoad *load) |
| Whether the load of a model is done. | |
| u32 | PollVehicleModelDma (VehicleModelLoad *load) |
| Continue the load of a model, and once it is done, record the car of its slot and fix up its pointers. | |
| void | ResetVehicleState (Vehicle *vehicle) |
| Reset the frames, cameras, velocity, place on the route and gearbox of a vehicle for its car. | |
| void | BindPlayerInputToVehicle (Vehicle *vehicle) |
| Give a vehicle the input of the player of the same index. | |
| s32 | IsVehicleModelValid (s32 car) |
| Whether the model of a car is on the cartridge. | |
| void | ChooseVehicleCar (Vehicle *vehicle) |
| Choose the car of a vehicle. | |
| void | DriveAiVehicle (Vehicle *vehicle) |
| The driver of a computer's vehicle, which runs its behaviour for the frame. | |
| void | SimulateVehiclePhysicsSubstep (Vehicle *vehicle) |
| Step the physics of a vehicle on the ground for a frame: drive its wheels, push it by its springs, grip and dampers, collide it with the track and the other vehicles, and hang its wheels to the ground. | |
| void | TransformAllWheelMatrices (Vehicle *vehicle) |
| Place the matrix of a vehicle, leant into its skid, and the matrices of its wheels, turned by their roll and the front ones by their steering. | |
| void | UpdateVehicleEngineAndGearbox (Vehicle *vehicle) |
| Steer a vehicle by the stick, change its gears, and run its engine: its revolutions follow the front wheels in gear, and its throttle the torque at them. | |
| void | InitVehiclePhysics (Vehicle *vehicle) |
| Set up the body of a vehicle and the bodies of its wheels, and their forces, for the model of its car. | |
| void | InitPlayerVehicleSlot (Vehicle *vehicle) |
| Bind a vehicle to the input of its player and reset it for a race. | |
| void | InitVehicleColor (Vehicle *vehicle) |
| Reset a vehicle, paint it the colour of its player, and leave it solid and undriven. | |
| void | UpdatePhysicsStep (Vehicle *vehicle) |
| Drive a vehicle by the input of its player for a frame. | |
| void | RespawnVehicle (Vehicle *vehicle) |
| Put a vehicle that has been upside down too long, or has fallen below the track, back on the route at its point, as a ghost that fades back in. | |
| void | ResetVehicleEffects (Vehicle *vehicle) |
| Clear the smoke and the spray of the wheels of a vehicle. | |
| void | ClearVehicleDamageState (Vehicle *vehicle) |
| Clear the dents of a vehicle. | |
| void | SetupVehicleForRaceStart (Vehicle *vehicle) |
| Put a vehicle on the grid for the start of the race, with its model, cameras and effects reset. | |
| void | UnusedRaceStartStub (s32 unused) |
| Do nothing. | |
| void | ManageAiRacerSlots (Vehicle *player) |
| Move the vehicles the computer drives to the racers nearest a player, so that the racers around the player are driven in full. | |
| void | UpdateRacerSlotMotion (RacerSlot *slot) |
| Move a racer for a frame: drive its vehicle, or advance it along the route of the track when it has none. | |
Variables | |
| u8 | g_abPlayerColorsRgb [][3] |
| The color of each player's vehicle, as red, green and blue. | |
| CarModel | g_aCarModels [CAR_MODELS] |
| The model and dashboard definitions of the cars the players can choose. | |
| s32 | g_dwCarCount |
| The number of cars in g_aCarModels. | |
| CarPhysicsSpec | g_aCarPhysicsSpecs [CAR_MODELS] |
| The handling and engine specifications of the cars the players can choose. | |
| Vehicle | g_aVehicles [MAX_VEHICLES] |
| The active vehicles of a race, with players in the first slots. | |
| f32 | g_fSteerLock |
| How the steering answers the stick, as the steering mode of a vehicle sets it: the lock at rest and how much of it the speed takes, in degrees, how fast the wheels turn a frame, in radians, and the angle each unit of the stick steers, in degrees. | |
| f32 | g_fSteerRate |
| How quickly the steering angle changes per frame, in radians. | |
| f32 | g_fSteerGain |
| How many degrees each unit of steering input turns the wheels. | |
| f32 | g_fSteerLockLoss |
| How many degrees of steering lock are lost as speed increases. | |
| s16 | g_wSteerGainSpeedShare |
| How much the speed halves the gain, which the modes leave at 0. | |
The vehicles of a race, the cars they are, and their place on the track.
| #define MAX_VEHICLES 4 |
The number of vehicles a race can hold.
| #define VEHICLE_LAP_TIMES 5 |
The laps of a race whose times a vehicle keeps.
| #define CAR_MODELS 13 |
The cars the players can choose.
| #define VEHICLE_MODEL_SLOTS 4 |
The slots the models of the cars of the menus load into.
| #define VEHICLE_GHOST 2 |
The ghost mode of a vehicle that other vehicles pass through and that fades back in.
| void UpdateVehiclePhysicsFrame | ( | Vehicle * | vehicle | ) |
Run a frame of a vehicle: fly it, or put it on the ground, drive its wheels and step its physics.
Then place its wheels, set its speed, and update its cameras if a view follows it.
| vehicle | The vehicle. |
Put a vehicle at a position, with its body and the states of its steps.
| vehicle | The vehicle. |
| x | The x of the position. |
| y | The y of the position. |
| z | The z of the position. |
Turn a vehicle upright to face an angle about the vertical.
| vehicle | The vehicle. |
| angle | The angle from the x axis, in radians. |
Set the frame of a vehicle and the orientation of its body from a matrix.
| vehicle | The vehicle. |
| m | The matrix, whose rows are the axes and the position. |
Set the velocity of a vehicle.
| vehicle | The vehicle. |
| x | The x of the velocity. |
| y | The y of the velocity. |
| z | The z of the velocity. |
Turn the body of a vehicle by angles about its vertical, sideways and forward axes, in turn.
| vehicle | The vehicle. |
| yaw | The angle about the vertical, in radians. |
| pitch | The angle about the sideways axis, in radians. |
| roll | The angle about the forward axis, in radians. |
Set the angular velocity of a vehicle.
| vehicle | The vehicle. |
| x | The angular velocity about the x axis. |
| y | The angular velocity about the y axis. |
| z | The angular velocity about the z axis. |
| void InitVehicleColorAndPhysics | ( | Vehicle * | vehicle | ) |
Paint the model of a vehicle its colour and set up its physics.
The Japanese release only sets up the physics.
| vehicle | The vehicle. |
Give a vehicle the model of a slot.
| vehicle | The vehicle. |
| slot | The slot of g_aVehicleModels. |
Load the model of a car into a slot and give it to a vehicle.
The Japanese release then takes the colour of the vehicle from the model.
| vehicle | The vehicle. |
| slot | The slot of g_aVehicleModels. |
| car | The index of the car in g_aCarModels. |
Load the model of a car into a slot and give it to a vehicle, as InstallVehicleModel() does.
| vehicle | The vehicle. |
| slot | The slot of g_aVehicleModels. |
| car | The index of the car in g_aCarModels. |
Load the model of a car into a slot, give it to a vehicle, and paint it the color of the vehicle.
| vehicle | The vehicle. |
| slot | The slot of g_aVehicleModels. |
| car | The index of the car in g_aCarModels. |
| void LoadVehicleModel | ( | VehicleModelLoad * | load, |
| s32 | slot, | ||
| s32 | car, | ||
| s32 | buffer ) |
Start loading the model of a car into a slot through a buffer of g_aDmaWorkBuffers.
| load | The load, which this starts. |
| slot | The slot of g_aVehicleModels. |
| car | The index of the car in g_aCarModels. |
| buffer | The index of the buffer. |
| s32 IsVehicleModelLoaded | ( | VehicleModelLoad * | load | ) |
Whether the load of a model is done.
| load | The load. |
| u32 PollVehicleModelDma | ( | VehicleModelLoad * | load | ) |
Continue the load of a model, and once it is done, record the car of its slot and fix up its pointers.
| load | The load. |
| void ResetVehicleState | ( | Vehicle * | vehicle | ) |
Reset the frames, cameras, velocity, place on the route and gearbox of a vehicle for its car.
| vehicle | The vehicle. |
| void BindPlayerInputToVehicle | ( | Vehicle * | vehicle | ) |
Give a vehicle the input of the player of the same index.
| vehicle | The vehicle. |
Whether the model of a car is on the cartridge.
| car | The index of the car in g_aCarModels. |
| void ChooseVehicleCar | ( | Vehicle * | vehicle | ) |
Choose the car of a vehicle.
A player's vehicle takes the first car of the season in the championship and keeps its own otherwise. A computer's vehicle takes the car of the first player in the arcade; otherwise the first takes the first car of the season, and the others the lowest car of a set the season allows.
| vehicle | The vehicle. |
| void DriveAiVehicle | ( | Vehicle * | vehicle | ) |
The driver of a computer's vehicle, which runs its behaviour for the frame.
| vehicle | The vehicle. |
| void SimulateVehiclePhysicsSubstep | ( | Vehicle * | vehicle | ) |
Step the physics of a vehicle on the ground for a frame: drive its wheels, push it by its springs, grip and dampers, collide it with the track and the other vehicles, and hang its wheels to the ground.
| vehicle | The vehicle. |
| void TransformAllWheelMatrices | ( | Vehicle * | vehicle | ) |
Place the matrix of a vehicle, leant into its skid, and the matrices of its wheels, turned by their roll and the front ones by their steering.
| vehicle | The vehicle. |
| void UpdateVehicleEngineAndGearbox | ( | Vehicle * | vehicle | ) |
Steer a vehicle by the stick, change its gears, and run its engine: its revolutions follow the front wheels in gear, and its throttle the torque at them.
| vehicle | The vehicle. |
| void InitVehiclePhysics | ( | Vehicle * | vehicle | ) |
Set up the body of a vehicle and the bodies of its wheels, and their forces, for the model of its car.
| vehicle | The vehicle. |
| void InitPlayerVehicleSlot | ( | Vehicle * | vehicle | ) |
Bind a vehicle to the input of its player and reset it for a race.
| vehicle | The vehicle. |
| void InitVehicleColor | ( | Vehicle * | vehicle | ) |
Reset a vehicle, paint it the colour of its player, and leave it solid and undriven.
| vehicle | The vehicle. |
| void UpdatePhysicsStep | ( | Vehicle * | vehicle | ) |
Drive a vehicle by the input of its player for a frame.
| vehicle | The vehicle. |
| void RespawnVehicle | ( | Vehicle * | vehicle | ) |
Put a vehicle that has been upside down too long, or has fallen below the track, back on the route at its point, as a ghost that fades back in.
| vehicle | The vehicle. |
| void ResetVehicleEffects | ( | Vehicle * | vehicle | ) |
Clear the smoke and the spray of the wheels of a vehicle.
| vehicle | The vehicle. |
| void ClearVehicleDamageState | ( | Vehicle * | vehicle | ) |
Clear the dents of a vehicle.
| vehicle | The vehicle. |
| void SetupVehicleForRaceStart | ( | Vehicle * | vehicle | ) |
Put a vehicle on the grid for the start of the race, with its model, cameras and effects reset.
| vehicle | The vehicle. |
| void UnusedRaceStartStub | ( | s32 | unused | ) |
Do nothing.
Nothing calls it.
| unused | Not read. |
| void ManageAiRacerSlots | ( | Vehicle * | player | ) |
Move the vehicles the computer drives to the racers nearest a player, so that the racers around the player are driven in full.
| player | The vehicle of the player. |
| void UpdateRacerSlotMotion | ( | RacerSlot * | slot | ) |
Move a racer for a frame: drive its vehicle, or advance it along the route of the track when it has none.
| slot | The slot of g_aRacerSlots. |
|
extern |
The color of each player's vehicle, as red, green and blue.
|
extern |
The model and dashboard definitions of the cars the players can choose.
|
extern |
The number of cars in g_aCarModels.
|
extern |
The handling and engine specifications of the cars the players can choose.
|
extern |
The active vehicles of a race, with players in the first slots.
|
extern |
How the steering answers the stick, as the steering mode of a vehicle sets it: the lock at rest and how much of it the speed takes, in degrees, how fast the wheels turn a frame, in radians, and the angle each unit of the stick steers, in degrees.
|
extern |
How quickly the steering angle changes per frame, in radians.
|
extern |
How many degrees each unit of steering input turns the wheels.
|
extern |
How many degrees of steering lock are lost as speed increases.
|
extern |
How much the speed halves the gain, which the modes leave at 0.