Talk:Track files and formats

From VDrift Documentation Wiki

Jump to: navigation, search

So what's the underlying structure of the roads.trk file. I see a number which I presume to be a number of entries and a series of vectors - what do these represent? Aegidian 11:20, 21 February 2008 (PST)

The roads.trk file stores the bezier surfaces for all of the roads on the track. This gets created when you trace the road in the track editor. Without this, collision is done only with the road's triangles, which can be discontinuous (bumpy). The bezier collision makes for a smoother surface. The format is as follows: first, the number of road segments in the track. Then, for each segment: the number of bezier surfaces. Then, for each bezier surface (bezier surfaces are in the shape of a rectangular 4x4 grid), the 16 control points from the grid. Note that the track editor doesn't have to deal with calculating all of the control points, it just asks the user to select the next two points on the track, creates a quad shape, and calls BEZIER::SetFromCorners. When VDrift loads the track, it calls BEZIER::Attach on each quad, which manipulates the control points to make a smooth transition between the quads. Venzon 17:38, 21 February 2008 (PST)

By the way, I don't check the talk pages regularly, so if you have more questions pop into the IRC channel to get faster answers. I just stay in there all the time and will eventually answer any questions. Venzon 17:40, 21 February 2008 (PST)

Personal tools