coastline 0.0.4
Loading...
Searching...
No Matches
trackshadow.h File Reference
Include dependency graph for trackshadow.h:

Go to the source code of this file.

Functions

long double ShadowTextureDistanceLeft (const ConvertedModelVertex *vertex)
 The signed distance from the left boundary of the shadow texture.
long double ShadowTextureDistanceRight (const ConvertedModelVertex *vertex)
 The signed distance from the right boundary of the shadow texture.
long double ShadowTextureDistanceTop (const ConvertedModelVertex *vertex)
 The signed distance from the top boundary of the shadow texture.
long double ShadowTextureDistanceBottom (const ConvertedModelVertex *vertex)
 The signed distance from the bottom boundary of the shadow texture.
void ProjectShadowTextureCoordinates (ConvertedModelVertex *vertex)
 Set the texture coordinates of a shadow vertex with the current projection matrix.
void UpdateShadowCornerVertex (const TrackInstance *instance, ConvertedModelVertex quad[4], s32 cornerValid[4], s32 corner, const ConvertedModelVertex *vertex, f32 s, f32 t, const f32 vehicleMatrix[4][4])
 Update a shadow corner for a closer vertex at most one unit above the vehicle frame.
void ProjectClippedShadowTriangle (const TrackInstance *instance, ConvertedModelVertex quad[4], s32 cornerValid[4], const ConvertedModelVertex *a, const ConvertedModelVertex *b, const ConvertedModelVertex *c, const f32 vehicleMatrix[4][4])
 Clip a shadow triangle to its texture and update the covered corners of its vehicle quad.

Function Documentation

◆ ShadowTextureDistanceLeft()

long double ShadowTextureDistanceLeft ( const ConvertedModelVertex * vertex)

The signed distance from the left boundary of the shadow texture.

Parameters
vertexThe vertex measured.
Returns
The texture s coordinate.
Ghidra address:
BRD3D: 0x10010960
Ghidra address:
BRGlide: 0x1000dec0

◆ ShadowTextureDistanceRight()

long double ShadowTextureDistanceRight ( const ConvertedModelVertex * vertex)

The signed distance from the right boundary of the shadow texture.

Parameters
vertexThe vertex measured.
Returns
1024 minus the texture s coordinate.
Ghidra address:
BRD3D: 0x10010970
Ghidra address:
BRGlide: 0x1000ded0

◆ ShadowTextureDistanceTop()

long double ShadowTextureDistanceTop ( const ConvertedModelVertex * vertex)

The signed distance from the top boundary of the shadow texture.

Parameters
vertexThe vertex measured.
Returns
The texture t coordinate.
Ghidra address:
BRD3D: 0x10010980
Ghidra address:
BRGlide: 0x1000dee0

◆ ShadowTextureDistanceBottom()

long double ShadowTextureDistanceBottom ( const ConvertedModelVertex * vertex)

The signed distance from the bottom boundary of the shadow texture.

Parameters
vertexThe vertex measured.
Returns
1024 minus the texture t coordinate.
Ghidra address:
BRD3D: 0x10010990
Ghidra address:
BRGlide: 0x1000def0

◆ ProjectShadowTextureCoordinates()

void ProjectShadowTextureCoordinates ( ConvertedModelVertex * vertex)

Set the texture coordinates of a shadow vertex with the current projection matrix.

Parameters
vertexThe vertex to project.
Ghidra address:
BRD3D: 0x10010d10
Ghidra address:
BRGlide: 0x1000e270

◆ UpdateShadowCornerVertex()

void UpdateShadowCornerVertex ( const TrackInstance * instance,
ConvertedModelVertex quad[4],
s32 cornerValid[4],
s32 corner,
const ConvertedModelVertex * vertex,
f32 s,
f32 t,
const f32 vehicleMatrix[4][4] )

Update a shadow corner for a closer vertex at most one unit above the vehicle frame.

Ghidra address:
BRD3D: 0x10010bf0
Ghidra address:
BRGlide: 0x1000e150

◆ ProjectClippedShadowTriangle()

void ProjectClippedShadowTriangle ( const TrackInstance * instance,
ConvertedModelVertex quad[4],
s32 cornerValid[4],
const ConvertedModelVertex * a,
const ConvertedModelVertex * b,
const ConvertedModelVertex * c,
const f32 vehicleMatrix[4][4] )

Clip a shadow triangle to its texture and update the covered corners of its vehicle quad.

Parameters
instanceThe placed model.
quadThe four output corners.
cornerValidWhether each corner has a projected vertex.
aThe first vertex.
bThe second vertex.
cThe third vertex.
vehicleMatrixThe vehicle frame.
Ghidra address:
BRD3D: 0x100106a0
Ghidra address:
BRGlide: 0x1000dc00