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

The cache of the triangles of the track around a point, one cell of the 32-unit grid of the track in each slot. More...

#include <PR/ultratypes.h>
#include "common/vecmath.h"
Include dependency graph for tricache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  TrackTriangle
 A triangle of the track with its plane. More...

Macros

#define TRI_CACHE_SLOTS   4
 The cells of the grid the cache holds at once.
#define TRI_CACHE_TRIANGLES   150
 The triangles a slot of the cache holds.

Typedefs

typedef struct TrackTriangle TrackTriangle
 A triangle of the track with its plane.

Functions

s32 InvalidateTriCacheSectorAt (f32 x, f32 y)
 Empty the slot that holds the cell under a point.
s16 BuildTrackTriangleCache (f32 x, f32 y)
 Find or fill the slot of the cache that holds the triangles of the cell under a point, filling the slot used longest ago.

Variables

TrackTriangle g_aTriCacheTriangles [TRI_CACHE_SLOTS][TRI_CACHE_TRIANGLES]
 The track triangles stored in each slot of the collision cache.
u16 g_awTriCacheSectorId [TRI_CACHE_SLOTS]
 The cell each slot holds, as its row times 64 plus its column.
u16 g_awTriCacheTriCount [TRI_CACHE_SLOTS]
 The triangles in each slot.
Vec3f g_vRayCeilingNormalInit
 The initial ceiling normal for a vertical ray cast.
Vec3f g_vRayGroundNormalInit
 The initial ground normal for a vertical ray cast.
u32 g_adwTriCacheLruStamp [TRI_CACHE_SLOTS]
 When each slot was last used.
u32 g_dwTriCacheLruCounter
 The count of the uses of the cache.

Detailed Description

The cache of the triangles of the track around a point, one cell of the 32-unit grid of the track in each slot.

Macro Definition Documentation

◆ TRI_CACHE_SLOTS

#define TRI_CACHE_SLOTS   4

The cells of the grid the cache holds at once.

◆ TRI_CACHE_TRIANGLES

#define TRI_CACHE_TRIANGLES   150

The triangles a slot of the cache holds.

Typedef Documentation

◆ TrackTriangle

typedef struct TrackTriangle TrackTriangle

A triangle of the track with its plane.

Function Documentation

◆ InvalidateTriCacheSectorAt()

s32 InvalidateTriCacheSectorAt ( f32 x,
f32 y )

Empty the slot that holds the cell under a point.

Parameters
xThe X coordinate of the point.
yThe Y coordinate of the point.
Returns
Whether a slot held it.
Ghidra address:
USA: 0x8025f0a4
Ghidra address:
Asia: 0x8025EBF4
Ghidra address:
EUR: 0x80260580
Ghidra address:
JPN: 0x80260030

◆ BuildTrackTriangleCache()

s16 BuildTrackTriangleCache ( f32 x,
f32 y )

Find or fill the slot of the cache that holds the triangles of the cell under a point, filling the slot used longest ago.

Parameters
xThe X coordinate of the point.
yThe Y coordinate of the point.
Returns
The slot that holds them.
Ghidra address:
USA: 0x8025f18c
Ghidra address:
Asia: 0x8025ECDC
Ghidra address:
EUR: 0x80260668
Ghidra address:
JPN: 0x80260118
Ghidra address:
BRD3D: 0x1006f720
Ghidra address:
BRGlide: 0x100686d0

Variable Documentation

◆ g_aTriCacheTriangles

TrackTriangle g_aTriCacheTriangles[TRI_CACHE_SLOTS][TRI_CACHE_TRIANGLES]
extern

The track triangles stored in each slot of the collision cache.

Ghidra address:
USA: 0x80379f80
Ghidra address:
Asia: 0x80379A30
Ghidra address:
EUR: 0x8037c480
Ghidra address:
JPN: 0x8037b0f0
Ghidra address:
BRD3D: 0x11750338
Ghidra address:
BRGlide: 0x11773698

◆ g_awTriCacheSectorId

u16 g_awTriCacheSectorId[TRI_CACHE_SLOTS]
extern

The cell each slot holds, as its row times 64 plus its column.

Ghidra address:
USA: 0x8037ea80
Ghidra address:
Asia: 0x8037E530
Ghidra address:
EUR: 0x80380f80
Ghidra address:
JPN: 0x8037fbf0
Ghidra address:
BRD3D: 0x117554d8
Ghidra address:
BRGlide: 0x11778838

◆ g_awTriCacheTriCount

u16 g_awTriCacheTriCount[TRI_CACHE_SLOTS]
extern

The triangles in each slot.

Ghidra address:
USA: 0x8037ea88
Ghidra address:
Asia: 0x8037E538
Ghidra address:
EUR: 0x80380f88
Ghidra address:
JPN: 0x8037fbf8
Ghidra address:
BRD3D: 0x117554a0
Ghidra address:
BRGlide: 0x11778800

◆ g_vRayCeilingNormalInit

Vec3f g_vRayCeilingNormalInit
extern

The initial ceiling normal for a vertical ray cast.

Ghidra address:
USA: 0x8028b318
Ghidra address:
Asia: 0x8028AE68
Ghidra address:
EUR: 0x8028d5c8
Ghidra address:
JPN: 0x8028cff8

◆ g_vRayGroundNormalInit

Vec3f g_vRayGroundNormalInit
extern

The initial ground normal for a vertical ray cast.

Ghidra address:
USA: 0x8028b324
Ghidra address:
Asia: 0x8028AE74
Ghidra address:
EUR: 0x8028d5d4
Ghidra address:
JPN: 0x8028d004

◆ g_adwTriCacheLruStamp

u32 g_adwTriCacheLruStamp[TRI_CACHE_SLOTS]
extern

When each slot was last used.

Ghidra address:
USA: 0x8037ea90
Ghidra address:
Asia: 0x8037E540
Ghidra address:
EUR: 0x80380f90
Ghidra address:
JPN: 0x8037fc00
Ghidra address:
BRD3D: 0x117554c8
Ghidra address:
BRGlide: 0x11778828

◆ g_dwTriCacheLruCounter

u32 g_dwTriCacheLruCounter
extern

The count of the uses of the cache.

Ghidra address:
USA: 0x8037eaa0
Ghidra address:
Asia: 0x8037E550
Ghidra address:
EUR: 0x80380fa0
Ghidra address:
JPN: 0x8037fc10
Ghidra address:
BRD3D: 0x117554e0
Ghidra address:
BRGlide: 0x11778840