Originally Posted by
tigrou
Hi,
@aybe : the following files are used in W1/WOXL :
- TRV : contains all track vertices (x, y, z 3D points)
- TRF : contains all track faces. basically an array of indexes that references the vertexes in TRV file. This allow same vertices to be shared between triangles (as XPand explained). All objects around the track (tunnels, mountains, bridges, trees, ...) are stored separately, in the SCENE.PRM file.
- TRS : track sections. this is a double linked list of 3D vertices that represent the track curve. in other words, a list of points that follow the track.
This is used for lot of things :
- physics : collision is performed only with triangles (track faces) in current section (where the player is), not the whole track.
- rendering : each section contains a list of 3D objects to display (precalculated before). So, the game only render triangles visible from player position (occlusion culling).
- game AI + autopilot (CPU ships knows which points to follow)
- checking who is 1st , 2nd (ranking)
- checking if player passed over a weapon / boost / repair tile, ...
- ...