coastline 0.0.4
Loading...
Searching...
No Matches
vehiclerender.h File Reference

The drawing of the vehicles: their models, wheels, lights, reflections and dents. More...

#include <PR/gbi.h>
#include <PR/ultratypes.h>
#include "common/vecmath.h"
#include "common/vehicle.h"
#include "common/vehicledeform.h"
#include "common/vehicleview.h"
Include dependency graph for vehiclerender.h:

Go to the source code of this file.

Functions

void TransformWheelPositions (s32 index)
 Place the four wheels of a vehicle: each takes the axes of the vehicle and the position of its wheel in the model, carried by the vehicle.
void RenderWheelModels (Vehicle *vehicle)
 Draw the four wheels of a vehicle, faded like a ghost when it is one, and with the wheel for the snow in the snow.
void CheckVehicleVisibility (Vehicle *vehicle)
 Decide whether a vehicle is drawn in the view being drawn, and set the fog at it.
void RenderVehicleModel (Vehicle *vehicle, s32 lodOffset)
 Draw a vehicle: its level of detail, lights, lit parts, underside, near details, specular highlight, the reflection of the sky on its paint, and its wheels.
void RenderVehicleHeadlightBeams (Vehicle *vehicle)
 Draw the beams of the headlights of a vehicle at night or in the rain, and glare the view when they shine at the camera.
void DrawCarStageDisc (Vehicle *vehicle)
 Draw the white disc of the stage of the cars, building its fan and its matrix on the first frame.
void DrawCarStageChoiceMarker (Vehicle *vehicle)
 Draw the choice marker of the stage of the cars, with the matrix DrawCarStageDisc() builds.
void DrawCarStageShadow (Vehicle *vehicle)
 Draw the shadow of a car on the stage of a menu, sized to its car.

Variables

f32 g_fConstInv255_802a9ed4
 Scale from byte model coordinates to world coordinates.
f32 g_fConst0p1_802a9ed8
 The near detail blend threshold.
f32 g_fConst1em4_802a9edc
 The minimum light vector length.
f32 g_fConstInvPi_802a9ee0
 Convert an angular difference in radians to a proportion of pi.
VehicleModel * g_pCurrentVehicleModelData
 The model of the vehicle being drawn.
f32 g_mtxVehicleModelScaled [4][4]
 The matrix of the vehicle being drawn, scaled to its model.
u32 g_dwVehicleOtherModeLBlend
 The blender part of the render mode of the vehicle being drawn, and its other flags.
u32 g_dwVehicleOtherModeLFlags
 The render-mode flags applied when drawing a vehicle.
s32 g_dwVehicleFogAlpha
 The alpha of the fog colour that fades a ghost vehicle.
s32 g_adwVehicleInViewRange [MAX_VEHICLES]
 Whether each vehicle is drawn in the view being drawn.
s32 g_anVehicleLod [MAX_VEHICLES]
 The level of detail each vehicle is drawn at.
Mtx * g_apVehicleModelMatrix [MAX_VEHICLES]
 The matrix of each vehicle, scaled to its model.
Mtx * g_apVehicleLightMatrix [MAX_VEHICLES]
 The matrix of each vehicle with the view and projection, forced for its lighting.
Lights1 g_aVehicleLights [MAX_VEHICLES]
 The lights of each vehicle at night or in the rain.
Vec3f g_vecVehicleLightDir
 The direction of the light on the vehicle being drawn.
Vec3f g_vecVehicleHiliteDir
 The direction of the specular highlight: halfway between the light and the camera.
u16 g_awVehicleShadePalette [16]
 The palette the textured parts of the cars share.
s32 g_bForceVehicleAltVariant
 Whether every vehicle is drawn in its other look, as Vehicle.otherLook draws one.
s32 g_bVehicleEnvMapLinearTexGen
 Whether the reflection of the sky takes its coordinates linearly from the normals.
s32 g_bPaintShopPreviewActive
 Whether the paint shop shows a car, which has no specular highlight.
u8 g_aVehicleHighlightTexture []
 The 64 by 64 texture of 4-bit intensities of the specular highlight, by day and by night.
u8 g_aVehicleNightHighlightTexture []
 The texture of a vehicle's night-time highlights.
s32 g_dwGameFrameCount
 A count of frames; the fan of the speedometer needle is built while it is 0.
Vtx g_aCarStageDiscVertices [32]
 The white disc of the stage of the cars of a menu: its centre and 30 points around it.
Mtx g_CarStageMtx
 The scale and the turn of the disc and the choice marker of the stage of the cars.
Gfx g_aCarStageDiscDisplayList []
 The disc of the stage of the cars, a fan of shaded triangles drawn without the depth buffer.
Gfx g_aCarStageChoiceMarkerDisplayList []
 The choice marker of the stage of the cars: an arrow on each side of the disc, over its black shadow.
Gfx g_aCarStageShadowDisplayList []
 The shadow a car casts on the stage of a menu.

Detailed Description

The drawing of the vehicles: their models, wheels, lights, reflections and dents.

Function Documentation

◆ TransformWheelPositions()

void TransformWheelPositions ( s32 index)

Place the four wheels of a vehicle: each takes the axes of the vehicle and the position of its wheel in the model, carried by the vehicle.

Parameters
indexThe index of the vehicle in g_aVehicles.
Ghidra address:
USA: 0x8022fef0
Ghidra address:
Asia: 0x8022FA40
Ghidra address:
EUR: 0x80231400
Ghidra address:
JPN: 0x80231200

◆ RenderWheelModels()

void RenderWheelModels ( Vehicle * vehicle)

Draw the four wheels of a vehicle, faded like a ghost when it is one, and with the wheel for the snow in the snow.

Parameters
vehicleThe vehicle.
Ghidra address:
USA: 0x8022ffb4
Ghidra address:
Asia: 0x8022FB04
Ghidra address:
EUR: 0x802314c4
Ghidra address:
JPN: 0x802312c4
Ghidra address:
BRD3D: 0x1000c6e0
Ghidra address:
BRGlide: 0x10009c10

◆ CheckVehicleVisibility()

void CheckVehicleVisibility ( Vehicle * vehicle)

Decide whether a vehicle is drawn in the view being drawn, and set the fog at it.

Parameters
vehicleThe vehicle.
Ghidra address:
USA: 0x802303d4
Ghidra address:
Asia: 0x8022FF24
Ghidra address:
EUR: 0x802318e4
Ghidra address:
JPN: 0x802316e4
Ghidra address:
BRD3D: 0x1000ca90
Ghidra address:
BRGlide: 0x10009fc0

◆ RenderVehicleModel()

void RenderVehicleModel ( Vehicle * vehicle,
s32 lodOffset )

Draw a vehicle: its level of detail, lights, lit parts, underside, near details, specular highlight, the reflection of the sky on its paint, and its wheels.

Parameters
vehicleThe vehicle.
lodOffsetHow many levels of detail coarser it is drawn, up to the coarsest.
Ghidra address:
USA: 0x80230554
Ghidra address:
Asia: 0x802300A4
Ghidra address:
EUR: 0x80231a64
Ghidra address:
JPN: 0x80231864
Ghidra address:
BRD3D: 0x1000cbe0
Ghidra address:
BRGlide: 0x1000a110

◆ RenderVehicleHeadlightBeams()

void RenderVehicleHeadlightBeams ( Vehicle * vehicle)

Draw the beams of the headlights of a vehicle at night or in the rain, and glare the view when they shine at the camera.

Parameters
vehicleThe vehicle.
Ghidra address:
USA: 0x80232ed4
Ghidra address:
Asia: 0x80232A24
Ghidra address:
EUR: 0x802343e4
Ghidra address:
JPN: 0x802341e4
Ghidra address:
BRD3D: 0x1000e950
Ghidra address:
BRGlide: 0x1000beb0

◆ DrawCarStageDisc()

void DrawCarStageDisc ( Vehicle * vehicle)

Draw the white disc of the stage of the cars, building its fan and its matrix on the first frame.

Parameters
vehicleThe vehicle, which is not used.
Ghidra address:
USA: 0x80233494
Ghidra address:
Asia: 0x80232FE4
Ghidra address:
EUR: 0x802349a4
Ghidra address:
JPN: 0x802347a4

◆ DrawCarStageChoiceMarker()

void DrawCarStageChoiceMarker ( Vehicle * vehicle)

Draw the choice marker of the stage of the cars, with the matrix DrawCarStageDisc() builds.

Parameters
vehicleThe vehicle, which is not used.
Ghidra address:
USA: 0x80233668
Ghidra address:
Asia: 0x802331B8
Ghidra address:
EUR: 0x80234b78
Ghidra address:
JPN: 0x80234978

◆ DrawCarStageShadow()

void DrawCarStageShadow ( Vehicle * vehicle)

Draw the shadow of a car on the stage of a menu, sized to its car.

Parameters
vehicleThe vehicle.
Ghidra address:
USA: 0x802336e0
Ghidra address:
Asia: 0x80233230
Ghidra address:
EUR: 0x80234bf0
Ghidra address:
JPN: 0x802349f0

Variable Documentation

◆ g_fConstInv255_802a9ed4

f32 g_fConstInv255_802a9ed4
extern

Scale from byte model coordinates to world coordinates.

Ghidra address:
USA: 0x802a9ed4
Ghidra address:
Asia: 0x802A9994
Ghidra address:
EUR: 0x802abc24
Ghidra address:
JPN: 0x802aaba4

◆ g_fConst0p1_802a9ed8

f32 g_fConst0p1_802a9ed8
extern

The near detail blend threshold.

Ghidra address:
USA: 0x802a9ed8
Ghidra address:
Asia: 0x802A9998
Ghidra address:
EUR: 0x802abc28
Ghidra address:
JPN: 0x802aaba8

◆ g_fConst1em4_802a9edc

f32 g_fConst1em4_802a9edc
extern

The minimum light vector length.

Ghidra address:
USA: 0x802a9edc
Ghidra address:
Asia: 0x802A999C
Ghidra address:
EUR: 0x802abc2c
Ghidra address:
JPN: 0x802aabac

◆ g_fConstInvPi_802a9ee0

f32 g_fConstInvPi_802a9ee0
extern

Convert an angular difference in radians to a proportion of pi.

Ghidra address:
USA: 0x802a9ee0
Ghidra address:
Asia: 0x802A99A0
Ghidra address:
EUR: 0x802abc30
Ghidra address:
JPN: 0x802aabb0

◆ g_pCurrentVehicleModelData

VehicleModel* g_pCurrentVehicleModelData
extern

The model of the vehicle being drawn.

Ghidra address:
USA: 0x8028ab08
Ghidra address:
Asia: 0x8028A658
Ghidra address:
EUR: 0x8028cd10
Ghidra address:
JPN: 0x8028c7e0
Ghidra address:
BRD3D: 0x106c3308
Ghidra address:
BRGlide: 0x106ea398

◆ g_mtxVehicleModelScaled

f32 g_mtxVehicleModelScaled[4][4]
extern

The matrix of the vehicle being drawn, scaled to its model.

Ghidra address:
USA: 0x80351cc0
Ghidra address:
Asia: 0x80351770
Ghidra address:
EUR: 0x803541c0
Ghidra address:
JPN: 0x80352e30
Ghidra address:
BRD3D: 0x10277d88
Ghidra address:
BRGlide: 0x10273570

◆ g_dwVehicleOtherModeLBlend

u32 g_dwVehicleOtherModeLBlend
extern

The blender part of the render mode of the vehicle being drawn, and its other flags.

Ghidra address:
USA: 0x8028c300
Ghidra address:
Asia: 0x8028BE50
Ghidra address:
EUR: 0x8028ea60
Ghidra address:
JPN: 0x8028e4b0
Ghidra address:
BRD3D: 0x10277e5c
Ghidra address:
BRGlide: 0x10273644

◆ g_dwVehicleOtherModeLFlags

u32 g_dwVehicleOtherModeLFlags
extern

The render-mode flags applied when drawing a vehicle.

Ghidra address:
USA: 0x8028c304
Ghidra address:
Asia: 0x8028BE54
Ghidra address:
EUR: 0x8028ea64
Ghidra address:
JPN: 0x8028e4b4
Ghidra address:
BRD3D: 0x10277e58

◆ g_dwVehicleFogAlpha

s32 g_dwVehicleFogAlpha
extern

The alpha of the fog colour that fades a ghost vehicle.

Ghidra address:
USA: 0x80351d00
Ghidra address:
Asia: 0x803517B0
Ghidra address:
EUR: 0x80354200
Ghidra address:
JPN: 0x80352e70
Ghidra address:
BRD3D: 0x10277e14
Ghidra address:
BRGlide: 0x102735fc

◆ g_adwVehicleInViewRange

s32 g_adwVehicleInViewRange[MAX_VEHICLES]
extern

Whether each vehicle is drawn in the view being drawn.

Ghidra address:
USA: 0x80351c80
Ghidra address:
Asia: 0x80351730
Ghidra address:
EUR: 0x80354180
Ghidra address:
JPN: 0x80352df0
Ghidra address:
BRD3D: 0x10277b68
Ghidra address:
BRGlide: 0x10273350

◆ g_anVehicleLod

s32 g_anVehicleLod[MAX_VEHICLES]
extern

The level of detail each vehicle is drawn at.

Ghidra address:
USA: 0x80351c90
Ghidra address:
Asia: 0x80351740
Ghidra address:
EUR: 0x80354190
Ghidra address:
JPN: 0x80352e00
Ghidra address:
BRD3D: 0x10277d38

◆ g_apVehicleModelMatrix

Mtx* g_apVehicleModelMatrix[MAX_VEHICLES]
extern

The matrix of each vehicle, scaled to its model.

Ghidra address:
USA: 0x80351ca0
Ghidra address:
Asia: 0x80351750
Ghidra address:
EUR: 0x803541a0
Ghidra address:
JPN: 0x80352e10
Ghidra address:
BRD3D: 0x10277dc8
Ghidra address:
BRGlide: 0x102735b0

◆ g_apVehicleLightMatrix

Mtx* g_apVehicleLightMatrix[MAX_VEHICLES]
extern

The matrix of each vehicle with the view and projection, forced for its lighting.

Ghidra address:
USA: 0x80351cb0
Ghidra address:
Asia: 0x80351760
Ghidra address:
EUR: 0x803541b0
Ghidra address:
JPN: 0x80352e20
Ghidra address:
BRD3D: 0x10277e18
Ghidra address:
BRGlide: 0x10273600

◆ g_aVehicleLights

Lights1 g_aVehicleLights[MAX_VEHICLES]
extern

The lights of each vehicle at night or in the rain.

Ghidra address:
USA: 0x80351c10
Ghidra address:
Asia: 0x803516C0
Ghidra address:
EUR: 0x80354110
Ghidra address:
JPN: 0x80352d80
Ghidra address:
BRD3D: 0x10277bb8

◆ g_vecVehicleLightDir

Vec3f g_vecVehicleLightDir
extern

The direction of the light on the vehicle being drawn.

Ghidra address:
USA: 0x80351d08
Ghidra address:
Asia: 0x803517B8
Ghidra address:
EUR: 0x80354208
Ghidra address:
JPN: 0x80352e78
Ghidra address:
BRD3D: 0x10277ba8

◆ g_vecVehicleHiliteDir

Vec3f g_vecVehicleHiliteDir
extern

The direction of the specular highlight: halfway between the light and the camera.

Ghidra address:
USA: 0x80351d18
Ghidra address:
Asia: 0x803517C8
Ghidra address:
EUR: 0x80354218
Ghidra address:
JPN: 0x80352e88
Ghidra address:
BRD3D: 0x10277d78

◆ g_awVehicleShadePalette

u16 g_awVehicleShadePalette[16]
extern

The palette the textured parts of the cars share.

Ghidra address:
USA: 0x8028c340
Ghidra address:
Asia: 0x8028BE90
Ghidra address:
EUR: 0x8028eaa0
Ghidra address:
JPN: 0x8028e4f0
Ghidra address:
BRD3D: 0x100a64c8
Ghidra address:
BRGlide: 0x100a5c88

◆ g_bForceVehicleAltVariant

s32 g_bForceVehicleAltVariant
extern

Whether every vehicle is drawn in its other look, as Vehicle.otherLook draws one.

Ghidra address:
USA: 0x8028ddc8
Ghidra address:
Asia: 0x8028D918
Ghidra address:
EUR: 0x80290568
Ghidra address:
JPN: 0x80290008
Ghidra address:
BRD3D: 0x10277b1c

◆ g_bVehicleEnvMapLinearTexGen

s32 g_bVehicleEnvMapLinearTexGen
extern

Whether the reflection of the sky takes its coordinates linearly from the normals.

Ghidra address:
USA: 0x8028ddcc
Ghidra address:
Asia: 0x8028D91C
Ghidra address:
EUR: 0x8029056c
Ghidra address:
JPN: 0x8029000c
Ghidra address:
BRD3D: 0x100a6380
Ghidra address:
BRGlide: 0x100a5b40

◆ g_bPaintShopPreviewActive

s32 g_bPaintShopPreviewActive
extern

Whether the paint shop shows a car, which has no specular highlight.

Ghidra address:
USA: 0x8028c334
Ghidra address:
Asia: 0x8028BE84
Ghidra address:
EUR: 0x8028ea94
Ghidra address:
JPN: 0x8028e4e4

◆ g_aVehicleHighlightTexture

u8 g_aVehicleHighlightTexture[]
extern

The 64 by 64 texture of 4-bit intensities of the specular highlight, by day and by night.

Ghidra address:
USA: 0x802a1968
Ghidra address:
Asia: 0x802A14B8
Ghidra address:
EUR: 0x802a4128
Ghidra address:
JPN: 0x802a3bc8

◆ g_aVehicleNightHighlightTexture

u8 g_aVehicleNightHighlightTexture[]
extern

The texture of a vehicle's night-time highlights.

Ghidra address:
USA: 0x802a2170
Ghidra address:
Asia: 0x802A1CC0
Ghidra address:
EUR: 0x802a4930
Ghidra address:
JPN: 0x802a43d0

◆ g_dwGameFrameCount

s32 g_dwGameFrameCount
extern

A count of frames; the fan of the speedometer needle is built while it is 0.

Ghidra address:
USA: 0x8028c360
Ghidra address:
Asia: 0x8028BEB0
Ghidra address:
EUR: 0x8028eac0
Ghidra address:
JPN: 0x8028e510

◆ g_aCarStageDiscVertices

Vtx g_aCarStageDiscVertices[32]
extern

The white disc of the stage of the cars of a menu: its centre and 30 points around it.

Ghidra address:
USA: 0x80351a20
Ghidra address:
Asia: 0x803514D0
Ghidra address:
EUR: 0x80353f20
Ghidra address:
JPN: 0x80352b90

◆ g_CarStageMtx

Mtx g_CarStageMtx
extern

The scale and the turn of the disc and the choice marker of the stage of the cars.

Ghidra address:
USA: 0x803519e0
Ghidra address:
Asia: 0x80351490
Ghidra address:
EUR: 0x80353ee0
Ghidra address:
JPN: 0x80352b50

◆ g_aCarStageDiscDisplayList

Gfx g_aCarStageDiscDisplayList[]
extern

The disc of the stage of the cars, a fan of shaded triangles drawn without the depth buffer.

Ghidra address:
USA: 0x8028c368
Ghidra address:
Asia: 0x8028BEB8
Ghidra address:
EUR: 0x8028eac8
Ghidra address:
JPN: 0x8028e518

◆ g_aCarStageChoiceMarkerDisplayList

Gfx g_aCarStageChoiceMarkerDisplayList[]
extern

The choice marker of the stage of the cars: an arrow on each side of the disc, over its black shadow.

Ghidra address:
USA: 0x8028c4f0
Ghidra address:
Asia: 0x8028C040
Ghidra address:
EUR: 0x8028ec50
Ghidra address:
JPN: 0x8028e6a0

◆ g_aCarStageShadowDisplayList

Gfx g_aCarStageShadowDisplayList[]
extern

The shadow a car casts on the stage of a menu.

Ghidra address:
USA: 0x8028c5d8
Ghidra address:
Asia: 0x8028C128
Ghidra address:
EUR: 0x8028ed38
Ghidra address:
JPN: 0x8028e788