1#ifndef COASTLINE_VEHICLEPHYSICS_H
2#define COASTLINE_VEHICLEPHYSICS_H
12#if TGR_PLATFORM == TGR_PLATFORM_SDL
16#include "common/vehicleaccess.h"
49static inline s32 IsVehicleControlAnalogue(
s32 control) {
54static inline s32 IsVehicleSteeringSpeedSensitive(
void) {
59static inline void UpdateVehicleReplayPose(
Vehicle *vehicle) {
62 VEHICLE_GET(vehicle, Input)->playbackBuffer
63#
if TGR_PLATFORM == TGR_PLATFORM_SDL
70 VEHICLE_GET(vehicle, Input)->playbackBuffer) {
79static inline s32 ShouldStepVehiclePhysics(
Vehicle *vehicle) {
82 VEHICLE_GET(vehicle, Input)->playbackBuffer
83#
if TGR_PLATFORM == TGR_PLATFORM_SDL
88 VEHICLE_GET(vehicle, Input)->playbackBuffer)) {
92 g_bRaceStartReached || VEHICLE_GET(vehicle, WheelBodies)[1].contactFrames <= 90;
96static inline void FinishVehiclePhysicsFrame(
Vehicle *vehicle) {
98#if TGR_PLATFORM == TGR_PLATFORM_WIN
105 vehicle->TransformAllWheelMatrices();
void PlayerVehicleControllerCallback(Vehicle *vehicle)
Translate player controls, advance vehicle physics, and process player effects and respawning.
#define g_dwNetworkPlayMode
Definition frontendstate.h:79
The main thread of the game, the weather of a race, and the player slots.
@ GAME_MODE_AFTER_SEASON
Definition game.h:46
@ GAME_MODE_DEMO
Definition game.h:45
@ GAME_MODE_TIME_ATTACK
Definition game.h:43
s32 g_dwGameMode
The mode of play the main menu chose.
The ghost cars of the PC port: the frames of their recordings.
void ApplyGhostKeyframeToVehicle(Vehicle *pVehicle, int nRecording)
Restore a ghost frame and estimate velocity from the following frame when available.
void RecordVehicleKeyframe(Vehicle *vehicle)
Sample vehicle and send its keyframe as a local network state update.
void ApplyGhostKeyframeForVehicle(Vehicle *pVehicle)
Restore the ghost frame from the recording slot matching a vehicle index.
void RecordGhostKeyframe(Vehicle *pVehicle)
Record one vehicle frame while recording is active and the race is not paused.
Whether an instant replay is playing.
s32 gInstantReplayActive
Whether an instant replay is playing.
The settings of the game saved in BossRally.cfg, and their reading from BossRally....
RallyConfig g_GlobalRallyConfig
Settings of the running game.
The settings of the PC port that BossRally.ini and the command line set.
int g_bSpeedSensitiveSteering
Whether speed reduces analogue steering lock, from SpeedSensitive=.
A vehicle.
Definition vehicle.h:143
int s32
Definition ultratypes.h:25
The vehicles of a race, the cars they are, and their place on the track.
void SimulateVehiclePhysicsSubstep(Vehicle *vehicle)
Advance spring, tyre, damping, and collision calculations for a vehicle.
void UpdatePhysicsStep(Vehicle *vehicle)
Advance the player-controlled vehicle for one frame.
void UpdateVehiclePhysicsFrame(Vehicle *vehicle)
Drive or fly a vehicle for a frame, then update its drawing transforms and cameras.
void UpdateVehicleWheelTransforms(Vehicle *vehicle)
Update wheel heights and rebuild their rigid-body orientation matrices.
void TransformAllWheelMatrices(Vehicle *vehicle)
Transform the body and wheel matrices for drawing.
void UpdateVehicleEngineAndGearbox(Vehicle *vehicle)
Update steering, engine torque, and gearbox selection.