1#ifndef COASTLINE_DRIVING_H
2#define COASTLINE_DRIVING_H
20#include "common/vehicleaccess.h"
301#if TGR_PLATFORM == TGR_PLATFORM_N64 && (TGR_REGION == TGR_REGION_JP || TGR_REGION == TGR_REGION_EU)
328static inline void ApplyPlayerVehicleEffects(
Vehicle *vehicle) {
329 if (g_dwInputButtonMask & 0x10000) {
330 VEHICLE_GET(vehicle, Body).unreconstructed202 = 0x80;
332 if (g_dwInputButtonMask & 0x20000) {
333 VEHICLE_GET(vehicle, Body).unreconstructed203 = 0x80;
335 if (g_dwInputButtonMask & 0x40000) {
336 VEHICLE_GET(vehicle, Body).unreconstructed204 = 0x80;
338 if (g_dwInputButtonMask & 0x80000) {
339 VEHICLE_GET(vehicle, Body).replayEffects[0] = 0x80;
341 if (g_dwInputButtonMask & 0x80) {
342 VEHICLE_GET(vehicle, Body).replayEffects[1] = 0x80;
347void ApplyPlayerVehicleRespawnRequest(
Vehicle *vehicle);
Vec3f g_avTraceCenterLine[TRACE_DEPTH]
The centre points of the line the search follows.
f32 g_afVehicleJolts[]
The jolts each vehicle took, from 0 to 5.
Vec3f g_avTraceLeftHalf[TRACE_DEPTH]
The points halfway between the left lane and centre line of the search.
Vec3f g_avBestCenterLine[TRACE_DEPTH]
The centre points of the deepest straight line found.
Vec3f g_avBestLeftLane[TRACE_DEPTH]
The lanes and the middle of the deepest straight line.
Vec3f g_vTraceHalfwayPoint
The centre point halfway along the deepest straight line found.
Vec3f g_avTraceLeftLane[TRACE_DEPTH]
The points of the line a search follows: a fifth of the way in from each side, halfway from there to ...
s32 g_dwBestTraceLength
The number of points in the deepest straight line.
Vec3f g_vUpAxis
The axis that points up.
Vec3f g_avBestRightLane[TRACE_DEPTH]
The right lane points of the deepest straight line found.
s32 g_dwBestTracePoint
The point index in the section at the deepest end of the search.
s32 g_bTraceBlocked
Set when a searched line crosses outside the route; never read.
#define TRACE_DEPTH
The points of the route a search for a straight line looks ahead.
Definition driving.h:28
s32 TraceTrackSplineRecursive(Vehicle *vehicle, s32 depth, s32 pointIndex, TrackSection *section)
Search the route ahead of a vehicle for straight lines it could drive, keeping the deepest.
Vec3f g_avTraceRightLane[TRACE_DEPTH]
The right lane points of the line the search follows.
void ProcessVehicleInputAndPhysics(Vehicle *vehicle)
Read the controls of a vehicle, choose the view of a replay, and step the vehicle.
TrackSection * g_pBestTraceSection
The section and point at the deepest end of the search.
Vec3f g_vTraceFarPoint
The last point of the deepest line, and its point halfway.
s32 g_dwTraceUnusedB
Cleared at the start of a search and never read.
s32 g_bAiNudgeLeft
Whether a computer's vehicle should ease to the left or to the right of where it steers.
s32 g_dwTraceUnusedA
Cleared at the start of a search and never read.
void UpdateAiVehicleBehavior(Vehicle *vehicle)
Drive a computer's vehicle for a frame: steer for a point ahead, keep to the route,...
void ChooseReplayCamera(Vehicle *vehicle)
Stand the trackside camera of a vehicle at the nearest point of the track no more than 10 below the v...
void ComputeTrackPosition(Vehicle *vehicle)
Find the point of the route nearest a vehicle along a curve through the points, with the axes of the ...
s32 g_dwBestTraceDepth
The deepest level found by a straight-line search.
f32 g_aafAiVelocityRetention[SEASONS][SEASON_RACES][2]
How much of its velocity a computer's vehicle retains each frame in the championship,...
void AddVehicleJolt(s32 index, f32 amount)
Add a jolt to a vehicle, at most 2.5 at once and 5 in all.
Vec3f g_avTraceRightHalf[TRACE_DEPTH]
The points halfway between the right lane and centre line of the search.
s32 g_bReplayCockpitNext
Whether a replay switches from the trackside camera to the cockpit next.
s32 g_bAiNudgeRight
Whether a computer's vehicle should ease to the right of where it steers.
#define SEASON_RACES
Definition profile.h:17
#define SEASONS
Definition profile.h:16
A section of the route.
Definition track.h:38
A point or direction in space.
Definition vecmath.h:17
A vehicle.
Definition vehicle.h:143
The track data a race loads below the program: its triangles and placed models, and the route the veh...
Integer and floating-point types of libultra.
float f32
Definition ultratypes.h:38
int s32
Definition ultratypes.h:25
The vector and matrix arithmetic of the game, its arctangent and power, the triangle and segment test...
The vehicles of a race, the cars they are, and their place on the track.