coastline 0.0.4
Loading...
Searching...
No Matches
Vehicle Struct Reference

A vehicle. More...

#include <vehicle.h>

Collaboration diagram for Vehicle:

Public Attributes

union { 
   CameraFrame   frame 
   struct { 
      f32   matrix [4][4] 
      union { 
         f32   wheelMatrices [VEHICLE_WHEELS][4][4] 
         WheelFrame   wheelFrames [VEHICLE_WHEELS] 
      } 
   } 
}; 
s32 index
s16 skidFrames
RigidBody body
RigidBody wheelBodies [VEHICLE_WHEELS]
RigidBodyForce forces [VEHICLE_FORCES]
u8 unreconstructedD70 [0xDF0 - 0xD70]
f32 steerAngle
f32 engineRpm
f32 gearRatios [CAR_GEAR_RATIOS]
union { 
   f32   torqueCurve [4] 
   struct { 
      f32   torqueCubic 
      f32   torqueQuadratic 
      f32   torqueLinear 
      f32   torqueConstant 
   } 
}; 
f32 finalDrive
s32 gearCount
s32 rearWheelDrive
s32 transmission
s32 tableIndex
f32 throttle
f32 brake
s32 gear
f32 frontLoad
u8 frontSliding
f32 rearLoad
u8 rearSliding
s8 steerReturn
s32 skipDrive
s32 customDecals
PlayerProfile * profile
s32 tireType
s32 suspensionStiffness
s32 steeringMode
s32 chosenTransmission
s32 forcedForwardFrames
s32 forcedReverseFrames
s32 reverseFrames
s32 forwardFrames
RacerSlot * nearestRacers [RACER_SLOTS]
RacerSlot * racer
s32 slotCooldown
void(* driver )(struct Vehicle *vehicle)
Vec3f aiTarget
Vec3f trackPoint
Vec3f trackForward
Vec3f trackSide
Vec3f trackUp
f32 trackSideDistance
Vec3f trackOffset
f32 trackSideOffset
Vec3f previousListenerPosition
s32 effectSound
s32 effectVolume
s32 effectPriority
f32 dopplerFactor
s32 cameraChanged
s32 flyMode
Vec3f previousPosition
TrackSection * section
s32 pointIndex
Vec3f trackDirection
s32 maxGate
s32 gate
s32 lap
s32 distanceLaps
f32 lapTime
f32 lapTimes [VEHICLE_LAP_TIMES]
f32 bestLapTime
s32 bestLap
f32 totalTime
f32 timeLeft
f32 distance
s32 racePosition
const char * message
f32 messageTime
const char * subMessage
f32 subMessageTime
char messageText [0xFD4 - 0xFC0]
s32 groundHits
Vec3f placedVelocity
f32 speedKph
f32 odometer
Vec3f joltPosition
Vec3f joltVelocity
Vec3f joltOffset
f32 exhaustTimer
Vec3f exhaustPosition
f32 smokeTimers [VEHICLE_WHEELS]
Vec3f smokePositions [VEHICLE_WHEELS]
f32 sprayFramesLeft [VEHICLE_WHEELS]
s32 spraySurfaces [VEHICLE_WHEELS]
f32 sprayPhases [VEHICLE_WHEELS]
s32 sprayAdvanced [VEHICLE_WHEELS]
Vec3f sprayPositions [VEHICLE_WHEELS]
Vtx sprayVertices [VEHICLE_WHEELS][SPRAY_SEGMENTS][SPRAY_SEGMENT_VERTICES]
s16 sprayVelocities [VEHICLE_WHEELS][SPRAY_SEGMENTS][SPRAY_SEGMENT_VERTICES][3]
union { 
   s16   spraySegmentSurfaces [VEHICLE_WHEELS][SPRAY_SEGMENTS] 
   s16   spraySegmentSurfaceList [VEHICLE_WHEELS *SPRAY_SEGMENTS] 
}; 
Vec3f sprayOrigin
Mtx sprayMtx
s32 inTunnel
f32 cameraHeading
u8 unreconstructed1DD0 [0x1DD4 - 0x1DD0]
f32 steering
f32 pitchInput
f32 accelerator
f32 rollInput
f32 fogFactor
CameraFrame * activeCamera
CameraFrame * previousCamera
CameraFrame cameras [VEHICLE_CAMERAS]
f32 chaseSpeed
f32 chaseLag
f32 lookAhead
Vec3f lookAt
Vec3f chasePosition
f32 collisionPull
u8 unreconstructed1FB0 [0x1FB4 - 0x1FB0]
Vec3f initialChasePosition
u16 groundInstances [RAY_INSTANCES]
s32 groundInstanceCount
u16 nearbyInstances [RAY_INSTANCES]
s32 nearbyInstanceCount
f32 groundDistance
s32 groundSurface
s16 shadowCorners [2][2]
s32 selectedCar
s32 carModel
u8 color [3]
u8 ghostMode
f32 opacity
s32 otherLook
s32 wrongWayFrames
u8 gridX
u8 gridY
PlayerInputState * input
VehicleModel * model
s16 dents [VEHICLE_DENT_SIDES]
s16 dentJitter

Detailed Description

A vehicle.

The game prints its size, 0x2090 bytes, at start-up. Its fields join this structure as the routines that use them are reconstructed.

Member Data Documentation

◆ frame

CameraFrame Vehicle::frame

The axes and position of the vehicle.

◆ matrix

f32 Vehicle::matrix[4][4]

The frame as a matrix.

◆ wheelMatrices

f32 Vehicle::wheelMatrices[VEHICLE_WHEELS][4][4]

The matrix of each wheel.

◆ wheelFrames

WheelFrame Vehicle::wheelFrames[VEHICLE_WHEELS]

The axes and position of each wheel.

◆ [union]

union { ... } Vehicle

The frame of the vehicle, as axes or as matrices.

◆ index

s32 Vehicle::index

The index of the vehicle in g_aVehicles. The players have the first.

◆ skidFrames

s16 Vehicle::skidFrames

The frames the tyres have skidded, up to 16, swelling the sound of the skid.

◆ body

RigidBody Vehicle::body

The rigid body of the vehicle.

◆ wheelBodies

RigidBody Vehicle::wheelBodies[VEHICLE_WHEELS]

The bodies of the wheels, the rear and the front wheel of one side, then of the other. The body lists them as the rear two, then the front two.

◆ forces

RigidBodyForce Vehicle::forces[VEHICLE_FORCES]

The forces on the bodies, by the VEHICLE_FORCE_ values.

◆ unreconstructedD70

u8 Vehicle::unreconstructedD70[0xDF0 - 0xD70]

Not read by the routines reconstructed so far.

◆ steerAngle

f32 Vehicle::steerAngle

The angle the front wheels are steered to, in radians.

◆ engineRpm

f32 Vehicle::engineRpm

The revolutions of the engine a minute.

◆ gearRatios

f32 Vehicle::gearRatios[CAR_GEAR_RATIOS]

The ratio of each gear, from the physics spec of the car.

◆ torqueCurve

f32 Vehicle::torqueCurve[4]

The torque curve, from the physics spec of the car.

◆ torqueCubic

f32 Vehicle::torqueCubic

The coefficient of engine revolutions cubed.

◆ torqueQuadratic

f32 Vehicle::torqueQuadratic

The coefficient of engine revolutions squared.

◆ torqueLinear

f32 Vehicle::torqueLinear

The coefficient of engine revolutions.

◆ torqueConstant

f32 Vehicle::torqueConstant

The constant coefficient of engine torque.

◆ [union]

union { ... } Vehicle

◆ finalDrive

f32 Vehicle::finalDrive

The ratio of the final drive, from the physics spec of the car.

◆ gearCount

s32 Vehicle::gearCount

The number of forward gears, from the physics spec of the car.

◆ rearWheelDrive

s32 Vehicle::rearWheelDrive

Whether the rear wheels alone are driven, from the physics spec of the car.

◆ transmission

s32 Vehicle::transmission

The gearbox the player chose, nonzero for the automatic.

◆ tableIndex

s32 Vehicle::tableIndex

The class of the car among the arcade times of each track.

◆ throttle

f32 Vehicle::throttle

The throttle, below 0 in reverse.

◆ brake

f32 Vehicle::brake

The brake, below 0 when braking.

◆ gear

s32 Vehicle::gear

The gear, from 0 for neutral.

◆ frontLoad

f32 Vehicle::frontLoad

The load the front tyres bore in the last step.

◆ frontSliding

u8 Vehicle::frontSliding

Whether the front tyres slid in the last step; sliding tyres grip less.

◆ rearLoad

f32 Vehicle::rearLoad

The load the rear tyres bore in the last step.

◆ rearSliding

u8 Vehicle::rearSliding

Whether the rear tyres slid in the last step; sliding tyres grip less.

◆ steerReturn

s8 Vehicle::steerReturn

The way the steering returns towards the middle, 1 or -1, or 0 while it does not return.

◆ skipDrive

s32 Vehicle::skipDrive

Whether the next step does not drive the wheels.

◆ customDecals

s32 Vehicle::customDecals

Whether the player chose the custom decals of the car.

◆ profile

PlayerProfile* Vehicle::profile

The profile of the player who drives the vehicle.

◆ tireType

s32 Vehicle::tireType

The tyres; the grip falls by 0.002 for each type up.

◆ suspensionStiffness

s32 Vehicle::suspensionStiffness

The stiffness of the springs, from 0 for the softest.

◆ steeringMode

s32 Vehicle::steeringMode

How the steering responds to the stick, from 0.

◆ chosenTransmission

s32 Vehicle::chosenTransmission

The gearbox of the recording or the settings, taken by ResetVehicleState().

◆ forcedForwardFrames

s32 Vehicle::forcedForwardFrames

The remaining frames a computer's vehicle drives forward to get unstuck, whatever else it wants.

◆ forcedReverseFrames

s32 Vehicle::forcedReverseFrames

The remaining frames a computer's vehicle reverses to get unstuck, whatever else it wants.

◆ reverseFrames

s32 Vehicle::reverseFrames

The frames a computer's vehicle has reversed since it last checked whether it is stuck.

◆ forwardFrames

s32 Vehicle::forwardFrames

The frames a computer's vehicle has driven forward since it last checked whether it is stuck.

◆ nearestRacers

RacerSlot* Vehicle::nearestRacers[RACER_SLOTS]

The racers nearest a player's vehicle, the nearest first, as the vehicles were shared out.

◆ racer

RacerSlot* Vehicle::racer

The racer the vehicle drives for.

◆ slotCooldown

s32 Vehicle::slotCooldown

The frames before a computer's vehicle that departed its racer may be taken from another.

◆ driver

void(* Vehicle::driver) (struct Vehicle *vehicle)

The routine that drives the vehicle each frame, the player's or the computer's, or NULL.

◆ aiTarget

Vec3f Vehicle::aiTarget

The point a computer's vehicle steers towards.

◆ trackPoint

Vec3f Vehicle::trackPoint

The point of the route nearest the vehicle.

◆ trackForward

Vec3f Vehicle::trackForward

The axis of the route at trackPoint along it.

◆ trackSide

Vec3f Vehicle::trackSide

The axis of the route at trackPoint across it to the left.

◆ trackUp

Vec3f Vehicle::trackUp

The axis of the route at trackPoint upwards.

◆ trackSideDistance

f32 Vehicle::trackSideDistance

How far the vehicle is from the middle of the route, trackSideOffset without its sign.

◆ trackOffset

Vec3f Vehicle::trackOffset

The offset of the vehicle from trackPoint.

◆ trackSideOffset

f32 Vehicle::trackSideOffset

How far the vehicle is from the middle of the route along trackSide, below 0 to the right.

◆ previousListenerPosition

Vec3f Vehicle::previousListenerPosition

Where the camera that heard the vehicle was the last frame.

◆ effectSound

s32 Vehicle::effectSound

The sound effect the vehicle plays, from 0 for none. A louder or more important sound takes its place.

◆ effectVolume

s32 Vehicle::effectVolume

How loud the sound effect plays.

◆ effectPriority

s32 Vehicle::effectPriority

How much the sound effect matters.

◆ dopplerFactor

f32 Vehicle::dopplerFactor

How much the motion of the vehicle and the camera raise its sounds.

◆ cameraChanged

s32 Vehicle::cameraChanged

Set when the active camera changes, to 1 when a view is chosen and to 2 by the cameras.

◆ flyMode

s32 Vehicle::flyMode

Whether the vehicle flies freely with the controls, without physics, with the cameras fixed rigidly to its frame.

◆ previousPosition

Vec3f Vehicle::previousPosition

The position of the last frame.

◆ section

TrackSection* Vehicle::section

The section of the route the vehicle is on.

◆ pointIndex

s32 Vehicle::pointIndex

The nearest point of the vehicle in its section.

◆ trackDirection

Vec3f Vehicle::trackDirection

The direction of the track at pointIndex.

◆ maxGate

s32 Vehicle::maxGate

The farthest gate passed, counted across laps.

◆ gate

s32 Vehicle::gate

The gate last crossed, counted across laps.

◆ lap

s32 Vehicle::lap

The laps finished.

◆ distanceLaps

s32 Vehicle::distanceLaps

The laps the distance travelled has counted.

◆ lapTime

f32 Vehicle::lapTime

The time of the lap being driven, in seconds.

◆ lapTimes

f32 Vehicle::lapTimes[VEHICLE_LAP_TIMES]

The time of each lap finished, in seconds.

◆ bestLapTime

f32 Vehicle::bestLapTime

The time of the best lap, in seconds.

◆ bestLap

s32 Vehicle::bestLap

The best lap, from 0.

◆ totalTime

f32 Vehicle::totalTime

The time of the race so far, in seconds.

◆ timeLeft

f32 Vehicle::timeLeft

The time remaining, in seconds.

◆ distance

f32 Vehicle::distance

The distance travelled along the route.

◆ racePosition

s32 Vehicle::racePosition

The place in the race, from 0 for the leader.

◆ message

const char* Vehicle::message

The message shown large in the middle of the view, or NULL.

◆ messageTime

f32 Vehicle::messageTime

The remaining time of message, in seconds.

◆ subMessage

const char* Vehicle::subMessage

The message shown smaller when there is no large one, or NULL.

◆ subMessageTime

f32 Vehicle::subMessageTime

The remaining time of subMessage, in seconds.

◆ messageText

char Vehicle::messageText[0xFD4 - 0xFC0]

The text a message may show, such as the time of a record.

◆ groundHits

s32 Vehicle::groundHits

The triangles of the track below the vehicle this frame.

◆ placedVelocity

Vec3f Vehicle::placedVelocity

The velocity SetVehicleVelocity() last gave.

◆ speedKph

f32 Vehicle::speedKph

The speed the display shows, in kilometres an hour.

◆ odometer

f32 Vehicle::odometer

The distance the speedometer has counted.

◆ joltPosition

Vec3f Vehicle::joltPosition

Where a weight on a spring at a corner of the vehicle is. Its jolts damage the vehicle.

◆ joltVelocity

Vec3f Vehicle::joltVelocity

How far the jolt weight moves a frame.

◆ joltOffset

Vec3f Vehicle::joltOffset

How far the jolt weight hangs from the corner.

◆ exhaustTimer

f32 Vehicle::exhaustTimer

The time towards the next puff of exhaust.

◆ exhaustPosition

Vec3f Vehicle::exhaustPosition

Where the last puff departed the exhaust.

◆ smokeTimers

f32 Vehicle::smokeTimers[VEHICLE_WHEELS]

The time towards the next puff of smoke of each wheel, the front two first.

◆ smokePositions

Vec3f Vehicle::smokePositions[VEHICLE_WHEELS]

Where the last puff of smoke of each wheel was, the front two first.

◆ sprayFramesLeft

f32 Vehicle::sprayFramesLeft[VEHICLE_WHEELS]

The frames the spray of each wheel goes on after the wheel lifts off the ground.

◆ spraySurfaces

s32 Vehicle::spraySurfaces[VEHICLE_WHEELS]

The surface the spray of each wheel is thrown from.

◆ sprayPhases

f32 Vehicle::sprayPhases[VEHICLE_WHEELS]

The time towards the next segment of each spray.

◆ sprayAdvanced

s32 Vehicle::sprayAdvanced[VEHICLE_WHEELS]

Whether a segment of each spray began this frame.

◆ sprayPositions

Vec3f Vehicle::sprayPositions[VEHICLE_WHEELS]

Where the newest segment of each spray was thrown from.

◆ sprayVertices

The vertices of the segments of each spray, the newest first, in 127ths of a unit from sprayOrigin.

◆ sprayVelocities

s16 Vehicle::sprayVelocities[VEHICLE_WHEELS][SPRAY_SEGMENTS][SPRAY_SEGMENT_VERTICES][3]

How far the vertices of each spray move a second, in 127ths of a unit.

◆ spraySegmentSurfaces

s16 Vehicle::spraySegmentSurfaces[VEHICLE_WHEELS][SPRAY_SEGMENTS]

The surface each segment was thrown from, or -1 when it was thrown from none.

◆ spraySegmentSurfaceList

s16 Vehicle::spraySegmentSurfaceList[VEHICLE_WHEELS *SPRAY_SEGMENTS]

The same surfaces in storage order.

◆ [union]

union { ... } Vehicle

◆ sprayOrigin

Vec3f Vehicle::sprayOrigin

The point the spray vertices are relative to, put at the vehicle by SetVehiclePosition().

◆ sprayMtx

Mtx Vehicle::sprayMtx

The matrix of the spray, the identity until it is set.

◆ inTunnel

s32 Vehicle::inTunnel

Whether the placed model under the vehicle is a tunnel, darkening the vehicle.

◆ cameraHeading

f32 Vehicle::cameraHeading

The heading of the camera of the vehicle, in radians, turning the reflection of the sky.

◆ unreconstructed1DD0

u8 Vehicle::unreconstructed1DD0[0x1DD4 - 0x1DD0]

Not read by the routines reconstructed so far.

◆ steering

f32 Vehicle::steering

The steering control.

◆ pitchInput

f32 Vehicle::pitchInput

The pitch control of the fly mode.

◆ accelerator

f32 Vehicle::accelerator

The accelerator control.

◆ rollInput

f32 Vehicle::rollInput

The roll control of the fly mode, 1, -1, or 0.

◆ fogFactor

f32 Vehicle::fogFactor

How thick the fog is at the vehicle, from 0 to 1, fading its shadow.

◆ activeCamera

CameraFrame* Vehicle::activeCamera

The member of cameras the view of the vehicle is drawn from.

◆ previousCamera

CameraFrame* Vehicle::previousCamera

The camera of the last frame.

◆ cameras

CameraFrame Vehicle::cameras[VEHICLE_CAMERAS]

The cameras, by the VEHICLE_CAMERA_ values.

◆ chaseSpeed

f32 Vehicle::chaseSpeed

The speed the chase camera follows, smoothed.

◆ chaseLag

f32 Vehicle::chaseLag

The lag of the chase camera, smoothed.

◆ lookAhead

f32 Vehicle::lookAhead

How far the look-at point leads the vehicle.

◆ lookAt

Vec3f Vehicle::lookAt

The point the chase camera looks at.

◆ chasePosition

Vec3f Vehicle::chasePosition

Where the chase camera was before the track pushed it.

◆ collisionPull

f32 Vehicle::collisionPull

How hard the track has been pushing the chase camera.

◆ unreconstructed1FB0

u8 Vehicle::unreconstructed1FB0[0x1FB4 - 0x1FB0]

Not read by the routines reconstructed so far.

◆ initialChasePosition

Vec3f Vehicle::initialChasePosition

Where the chase camera started.

◆ groundInstances

u16 Vehicle::groundInstances[RAY_INSTANCES]

The placed models of the ground below the vehicle, the nearest first, from CastRayAgainstTrack().

◆ groundInstanceCount

s32 Vehicle::groundInstanceCount

The number of groundInstances to read, 1 once the ground is found.

◆ nearbyInstances

u16 Vehicle::nearbyInstances[RAY_INSTANCES]

The placed models near the ground, the latest first.

◆ nearbyInstanceCount

s32 Vehicle::nearbyInstanceCount

The number of nearbyInstances.

◆ groundDistance

f32 Vehicle::groundDistance

How far the ground is below the vehicle.

◆ groundSurface

s32 Vehicle::groundSurface

The index of the triangle of the ground.

◆ shadowCorners

s16 Vehicle::shadowCorners[2][2]

The corners of the rectangle of the screen the shadow of the vehicle covers in the view being drawn, the left and the lower edge, then the right and the upper edge.

◆ selectedCar

s32 Vehicle::selectedCar

The car under the cursor of the car selection screen.

◆ carModel

s32 Vehicle::carModel

The index of the car in g_aCarModels.

◆ color

u8 Vehicle::color[3]

The color of the paint of the car, as red, green, and blue.

◆ ghostMode

u8 Vehicle::ghostMode

VEHICLE_GHOST while the vehicle fades back in after it is put back on the track.

◆ opacity

f32 Vehicle::opacity

How solid the vehicle is drawn, from 0 to 1.

◆ otherLook

s32 Vehicle::otherLook

Whether the car is drawn in its other look, without its textured parts or the reflection of the sky. A button switches it once an unlock allows it.

◆ wrongWayFrames

s32 Vehicle::wrongWayFrames

The frames the vehicle has faced against the track.

◆ gridX

u8 Vehicle::gridX

The x of the cell of the 32-unit grid of the track the vehicle is in.

◆ gridY

u8 Vehicle::gridY

The y of the cell of the 32-unit grid of the track the vehicle is in.

◆ input

PlayerInputState* Vehicle::input

The input that drives the vehicle.

◆ model

VehicleModel* Vehicle::model

The model of the car, in a slot of g_aVehicleModels.

◆ dents

s16 Vehicle::dents[VEHICLE_DENT_SIDES]

How deeply each of eight sides around the car has been dented; up to 0x100 it dents more.

◆ dentJitter

s16 Vehicle::dentJitter

A small offset, from -4 to 3, that changes with each dent to vary the dents.


The documentation for this struct was generated from the following file: