1#ifndef COASTLINE_VEHICLE_H
2#define COASTLINE_VEHICLE_H
45#define VEHICLE_LAP_TIMES 5
134#define VEHICLE_MODEL_SLOTS 4
137#define VEHICLE_GHOST 2
496#if TGR_REGION == TGR_REGION_EU
508#if TGR_REGION == TGR_REGION_JP
740#if defined(COASTLINE_PAINTSHOP_COLOR_RETURN)
#define MAX_VEHICLES
The capacity of the race engine's vehicle array.
Definition bossrallyvehicle.h:23
u8 g_abPlayerColorsRgb[20][3]
Player and computer vehicle paint colours, indexed by player or race slot, in RGB byte order.
#define CAR_GEAR_RATIOS
The gears of a gearbox, neutral first.
Definition carphysics.h:11
The state the renderer shares between the parts of a frame.
The graphics binary interface types the gu routines fill in for the RSP microcode.
The saved settings and progress of a player, and the size of the championship.
#define RACER_SLOTS
The racers of a race.
Definition racerslot.h:11
The rigid bodies of the physics: their state, forces and inertia, and the quaternion and 3 by 3 matri...
A frame of reference: three axes and a position, the rows of a 4 by 4 matrix whose last column Finish...
Definition render.h:30
A car the players can choose.
Definition vehicle.h:58
u32 modelRomEnd
Definition vehicle.h:62
s32 gearCount
Definition vehicle.h:88
u8 gearWidth
Definition vehicle.h:73
u32 dashboardRom
Definition vehicle.h:65
f32 acceleration
Definition vehicle.h:85
u8 unreconstructed4C[0x54 - 0x4C]
Definition vehicle.h:87
u8 unreconstructed4[0x14 - 0x4]
Definition vehicle.h:60
u8 tachometer
Definition vehicle.h:75
u8 unreconstructed24[0x28 - 0x24]
Definition vehicle.h:68
u8 barSegments
Definition vehicle.h:78
u8 needleX
Definition vehicle.h:77
u8 gearHeight
Definition vehicle.h:74
u8 dashboardHeight
Definition vehicle.h:70
u8 needleY
Definition vehicle.h:80
s32 driveType
Definition vehicle.h:83
const char * name
Definition vehicle.h:59
f32 needleRestAngle
Definition vehicle.h:82
f32 maxSpeed
Definition vehicle.h:86
u32 modelRom
Definition vehicle.h:61
f32 shadowHalfWidth
Definition vehicle.h:90
s8 gearX
Definition vehicle.h:71
u8 dashboardWidth
Definition vehicle.h:69
s8 gearY
Definition vehicle.h:72
u32 modelSize
Definition vehicle.h:64
f32 needleFullAngle
Definition vehicle.h:81
s32 engineLayout
Definition vehicle.h:84
f32 shadowLength
Definition vehicle.h:89
The physics of a car.
Definition carphysics.h:14
A decompression that runs over several calls of DecompressFromRom(), a step a call.
Definition assetdma.h:58
The saved settings and progress of a player.
Definition profile.h:23
A racer of a race.
Definition racerslot.h:28
A force on a rigid body, in a list.
Definition rigidbody.h:42
A rigid body: the body of a vehicle or of one of its wheels.
Definition rigidbody.h:60
A section of the route.
Definition track.h:38
A point or direction in space.
Definition vecmath.h:17
The decompression of the model of a car into a slot.
Definition vehicle.h:127
s32 slot
Definition vehicle.h:129
s32 car
Definition vehicle.h:130
DecompressJob job
Definition vehicle.h:128
The model of a car as it is loaded from the cartridge.
Definition vehiclemodel.h:55
A vehicle.
Definition vehicle.h:143
s8 steerReturn
Definition vehicle.h:193
s32 sprayAdvanced[VEHICLE_WHEELS]
Definition vehicle.h:280
f32 pitchInput
Definition vehicle.h:306
f32 speedKph
Definition vehicle.h:263
s32 tireType
Definition vehicle.h:198
f32 torqueConstant
Definition vehicle.h:175
f32 odometer
Definition vehicle.h:264
CameraFrame frame
Definition vehicle.h:145
s32 selectedCar
Definition vehicle.h:334
u8 unreconstructed1DD0[0x1DD4 - 0x1DD0]
Definition vehicle.h:304
Vtx sprayVertices[VEHICLE_WHEELS][SPRAY_SEGMENTS][SPRAY_SEGMENT_VERTICES]
Definition vehicle.h:284
f32 throttle
Definition vehicle.h:184
s32 effectVolume
Definition vehicle.h:232
f32 torqueCubic
Definition vehicle.h:172
RacerSlot * racer
Definition vehicle.h:213
s32 maxGate
Definition vehicle.h:243
CameraFrame * previousCamera
Definition vehicle.h:312
Vec3f aiTarget
Definition vehicle.h:218
Vec3f sprayOrigin
Definition vehicle.h:297
s32 gate
Definition vehicle.h:244
s16 spraySegmentSurfaceList[VEHICLE_WHEELS *SPRAY_SEGMENTS]
Definition vehicle.h:294
s32 groundSurface
Definition vehicle.h:330
u8 rearSliding
Definition vehicle.h:191
s32 customDecals
Definition vehicle.h:196
s32 suspensionStiffness
Definition vehicle.h:199
RigidBody wheelBodies[VEHICLE_WHEELS]
Definition vehicle.h:159
f32 steerAngle
Definition vehicle.h:165
f32 lapTimes[VEHICLE_LAP_TIMES]
Definition vehicle.h:248
s32 pointIndex
Definition vehicle.h:241
s32 slotCooldown
Definition vehicle.h:214
s32 forwardFrames
Definition vehicle.h:209
f32 messageTime
Definition vehicle.h:256
f32 torqueCurve[4]
Definition vehicle.h:170
s32 carModel
Definition vehicle.h:335
s32 groundHits
Definition vehicle.h:261
f32 cameraHeading
Definition vehicle.h:302
s16 dentJitter
Definition vehicle.h:352
Vec3f trackSide
Definition vehicle.h:221
u8 gridY
Definition vehicle.h:346
f32 dopplerFactor
Definition vehicle.h:234
TrackSection * section
Definition vehicle.h:240
Vec3f exhaustPosition
Definition vehicle.h:270
u16 groundInstances[RAY_INSTANCES]
Definition vehicle.h:322
s32 groundInstanceCount
Definition vehicle.h:324
f32 finalDrive
Definition vehicle.h:178
f32 totalTime
Definition vehicle.h:251
s16 skidFrames
Definition vehicle.h:156
Vec3f joltOffset
Definition vehicle.h:268
s32 transmission
Definition vehicle.h:182
Vec3f chasePosition
Definition vehicle.h:318
s32 bestLap
Definition vehicle.h:250
u8 frontSliding
Definition vehicle.h:188
void(* driver)(struct Vehicle *vehicle)
Definition vehicle.h:216
Vec3f joltVelocity
Definition vehicle.h:267
s32 nearbyInstanceCount
Definition vehicle.h:328
s32 effectPriority
Definition vehicle.h:233
f32 frontLoad
Definition vehicle.h:187
Vec3f joltPosition
Definition vehicle.h:265
Vec3f smokePositions[VEHICLE_WHEELS]
Definition vehicle.h:273
s32 wrongWayFrames
Definition vehicle.h:343
s32 effectSound
Definition vehicle.h:230
char messageText[0xFD4 - 0xFC0]
Definition vehicle.h:259
s32 forcedForwardFrames
Definition vehicle.h:203
u8 unreconstructedD70[0xDF0 - 0xD70]
Definition vehicle.h:164
f32 exhaustTimer
Definition vehicle.h:269
u16 nearbyInstances[RAY_INSTANCES]
Definition vehicle.h:326
Vec3f trackPoint
Definition vehicle.h:219
s16 shadowCorners[2][2]
Definition vehicle.h:331
u8 gridX
Definition vehicle.h:344
s32 spraySurfaces[VEHICLE_WHEELS]
Definition vehicle.h:277
const char * message
Definition vehicle.h:255
f32 engineRpm
Definition vehicle.h:166
Vec3f sprayPositions[VEHICLE_WHEELS]
Definition vehicle.h:281
s16 spraySegmentSurfaces[VEHICLE_WHEELS][SPRAY_SEGMENTS]
Definition vehicle.h:291
f32 smokeTimers[VEHICLE_WHEELS]
Definition vehicle.h:271
f32 bestLapTime
Definition vehicle.h:249
f32 sprayPhases[VEHICLE_WHEELS]
Definition vehicle.h:279
s32 flyMode
Definition vehicle.h:237
f32 accelerator
Definition vehicle.h:307
f32 chaseLag
Definition vehicle.h:315
PlayerInputState * input
Definition vehicle.h:348
f32 matrix[4][4]
Definition vehicle.h:147
s32 lap
Definition vehicle.h:245
WheelFrame wheelFrames[VEHICLE_WHEELS]
Definition vehicle.h:150
f32 sprayFramesLeft[VEHICLE_WHEELS]
Definition vehicle.h:275
f32 collisionPull
Definition vehicle.h:319
f32 distance
Definition vehicle.h:253
Vec3f placedVelocity
Definition vehicle.h:262
f32 lookAhead
Definition vehicle.h:316
CameraFrame cameras[VEHICLE_CAMERAS]
Definition vehicle.h:313
f32 steering
Definition vehicle.h:305
f32 subMessageTime
Definition vehicle.h:258
Vec3f trackDirection
Definition vehicle.h:242
s16 dents[VEHICLE_DENT_SIDES]
Definition vehicle.h:350
s32 skipDrive
Definition vehicle.h:195
f32 rearLoad
Definition vehicle.h:190
f32 opacity
Definition vehicle.h:339
RacerSlot * nearestRacers[RACER_SLOTS]
Definition vehicle.h:211
Mtx sprayMtx
Definition vehicle.h:299
s32 chosenTransmission
Definition vehicle.h:201
Vec3f lookAt
Definition vehicle.h:317
s32 inTunnel
Definition vehicle.h:300
s32 cameraChanged
Definition vehicle.h:235
Vec3f initialChasePosition
Definition vehicle.h:321
u8 unreconstructed1FB0[0x1FB4 - 0x1FB0]
Definition vehicle.h:320
f32 rollInput
Definition vehicle.h:308
u8 color[3]
Definition vehicle.h:336
f32 fogFactor
Definition vehicle.h:309
s32 rearWheelDrive
Definition vehicle.h:180
s32 steeringMode
Definition vehicle.h:200
RigidBody body
Definition vehicle.h:158
s32 racePosition
Definition vehicle.h:254
s32 index
Definition vehicle.h:155
s16 sprayVelocities[VEHICLE_WHEELS][SPRAY_SEGMENTS][SPRAY_SEGMENT_VERTICES][3]
Definition vehicle.h:288
s32 gearCount
Definition vehicle.h:179
f32 groundDistance
Definition vehicle.h:329
Vec3f trackUp
Definition vehicle.h:222
s32 gear
Definition vehicle.h:186
Vec3f previousListenerPosition
Definition vehicle.h:228
f32 timeLeft
Definition vehicle.h:252
CameraFrame * activeCamera
Definition vehicle.h:310
PlayerProfile * profile
Definition vehicle.h:197
Vec3f trackForward
Definition vehicle.h:220
f32 brake
Definition vehicle.h:185
f32 trackSideDistance
Definition vehicle.h:223
s32 distanceLaps
Definition vehicle.h:246
s32 tableIndex
Definition vehicle.h:183
f32 trackSideOffset
Definition vehicle.h:226
s32 reverseFrames
Definition vehicle.h:207
u8 ghostMode
Definition vehicle.h:337
VehicleModel * model
Definition vehicle.h:349
f32 lapTime
Definition vehicle.h:247
f32 chaseSpeed
Definition vehicle.h:314
s32 forcedReverseFrames
Definition vehicle.h:205
Vec3f previousPosition
Definition vehicle.h:239
const char * subMessage
Definition vehicle.h:257
RigidBodyForce forces[VEHICLE_FORCES]
Definition vehicle.h:162
f32 torqueLinear
Definition vehicle.h:174
f32 gearRatios[CAR_GEAR_RATIOS]
Definition vehicle.h:167
f32 torqueQuadratic
Definition vehicle.h:173
Vec3f trackOffset
Definition vehicle.h:225
s32 otherLook
Definition vehicle.h:340
f32 wheelMatrices[VEHICLE_WHEELS][4][4]
Definition vehicle.h:149
The axes and the position of a wheel, the rows of its matrix.
Definition wheelframe.h:11
The display, DMA and decompression state of the system file of the N64 releases.
The track data a race loads below the program: its triangles and placed models, and the route the veh...
#define RAY_INSTANCES
The most placed models CastRayAgainstTrack() lists.
Definition track.h:336
Integer and floating-point types of libultra.
unsigned int u32
Definition ultratypes.h:20
signed char s8
Definition ultratypes.h:23
short s16
Definition ultratypes.h:24
float f32
Definition ultratypes.h:38
unsigned short u16
Definition ultratypes.h:19
int s32
Definition ultratypes.h:25
unsigned char u8
Definition ultratypes.h:18
A 4 by 4 matrix in s15.16 fixed point, with the integer halves before the fractions.
Definition gbi.h:16
A vertex for the RSP, with a colour or with a normal.
Definition gbi.h:75
The vector and matrix arithmetic of the game, its arctangent and power, the triangle and segment test...
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 ChooseVehicleCar(Vehicle *vehicle)
Choose the car 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,...
void SimulateVehiclePhysicsSubstep(Vehicle *vehicle)
Step the physics of a vehicle on the ground for a frame: drive its wheels, push it by its springs,...
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.
void InitVehicleColor(Vehicle *vehicle)
Reset a vehicle, paint it the colour of its player, and leave it solid and undriven.
void ManageAiRacerSlots(Vehicle *player)
Move the vehicles the computer drives to the racers nearest a player, so that the racers around the p...
void InitPlayerVehicleSlot(Vehicle *vehicle)
Bind a vehicle to the input of its player and reset it for a race.
f32 g_fSteerLockLoss
How many degrees of steering lock are lost as speed increases.
#define VEHICLE_LAP_TIMES
The laps of a race whose times a vehicle keeps.
Definition vehicle.h:45
void SetVehicleVelocity(Vehicle *vehicle, f32 x, f32 y, f32 z)
Set the velocity of a 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.
#define CAR_MODELS
The cars the players can choose.
Definition vehicle.h:94
void ClearVehicleDamageState(Vehicle *vehicle)
Clear the dents of a vehicle.
void InitVehicleColorAndPhysics(Vehicle *vehicle)
Paint the model of a vehicle its colour and set up its physics.
f32 g_fSteerRate
How quickly the steering angle changes per frame, in radians.
f32 g_fSteerLock
How the steering answers the stick, as the steering mode of a vehicle sets it: the lock at rest and h...
Vehicle g_aVehicles[MAX_VEHICLES]
The active vehicles of a race, with players in the first slots.
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 n...
void ResetVehicleState(Vehicle *vehicle)
Reset the frames, cameras, velocity, place on the route and gearbox of a vehicle for its car.
void UpdatePhysicsStep(Vehicle *vehicle)
Drive a vehicle by the input of its player for a frame.
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.
s32 IsVehicleModelValid(s32 car)
Whether the model of a car is on the cartridge.
s16 g_wSteerGainSpeedShare
How much the speed halves the gain, which the modes leave at 0.
void SetVehicleFrameMatrix(Vehicle *vehicle, f32(*m)[4])
Set the frame of a vehicle and the orientation of its body from a matrix.
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 SetVehicleTurnRate(Vehicle *vehicle, f32 x, f32 y, f32 z)
Set the angular velocity of a vehicle.
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 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 ResetVehicleEffects(Vehicle *vehicle)
Clear the smoke and the spray of the wheels of a vehicle.
void DriveAiVehicle(Vehicle *vehicle)
The driver of a computer's vehicle, which runs its behaviour for the frame.
void InitVehicleOrientationFromAngle(Vehicle *vehicle, f32 angle)
Turn a vehicle upright to face an angle about the vertical.
void TransformAllWheelMatrices(Vehicle *vehicle)
Place the matrix of a vehicle, leant into its skid, and the matrices of its wheels,...
void SetVehicleModelSlot(Vehicle *vehicle, s32 slot)
Give a vehicle the model of a slot.
f32 g_fSteerGain
How many degrees each unit of steering input turns the wheels.
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 UpdateVehicleEngineAndGearbox(Vehicle *vehicle)
Steer a vehicle by the stick, change its gears, and run its engine: its revolutions follow the front ...
void InstallVehicleModel(Vehicle *vehicle, s32 slot, s32 car)
Load the model of a car into a slot and give it to 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 BindPlayerInputToVehicle(Vehicle *vehicle)
Give a vehicle the input of the player of the same index.
CarModel g_aCarModels[CAR_MODELS]
The model and dashboard definitions of the cars the players can choose.
s32 IsVehicleModelLoaded(VehicleModelLoad *load)
Whether the load of a model is done.
void UnusedRaceStartStub(s32 unused)
Do nothing.
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...
@ VEHICLE_CAMERAS
Definition vehiclecamera.h:17
The numbers of the racers and the vehicles of a race.
#define VEHICLE_DENT_SIDES
The sides around a car that dent apart, by the direction of the blow.
Definition vehicleeffects.h:7
#define SPRAY_SEGMENTS
The segments of the spray a wheel throws.
Definition vehicleeffects.h:10
#define SPRAY_SEGMENT_VERTICES
The vertices of each segment of the spray, of which the first two are drawn.
Definition vehicleeffects.h:12
@ VEHICLE_FORCES
Definition vehicleforces.h:28
#define VEHICLE_WHEELS
The wheels of a vehicle.
Definition vehiclemodel.h:14