TORCS  1.3.9
The Open Racing Car Simulator
Track Loader Module Interface

Interface for track loader modules, the track loader module is discovered and loaded during runtime. More...

Collaboration diagram for Track Loader Module Interface:

Files

file  track.h
 Track Structure and Track Loader Module Definition.
 

Classes

struct  tTrackItf
 Interface Structure for Track Loader. More...
 

Typedefs

typedef tTrack *(* tfTrackBuild) (char *filename)
 Read given track from filename into tTrack struct. More...
 
typedef tdble(* tfTrackHeightG) (tTrackSeg *seg, tdble X, tdble Y)
 Returns the absolute height in meters of the road at the given global position. More...
 
typedef tdble(* tfTrackHeightL) (tTrkLocPos *pos)
 Returns the absolute height in meters of the road at the local position. More...
 
typedef void(* tfTrackGlobal2Local) (tTrackSeg *seg, tdble X, tdble Y, tTrkLocPos *pos, int type)
 Convert a global position (segment, X, Y) into a local position (segment, toRight, toStart) More...
 
typedef void(* tfTrackLocal2Global) (tTrkLocPos *pos, tdble *X, tdble *Y)
 Convert a local position (segment, toRight, toStart) into a global one (X, Y) More...
 
typedef void(* tfTrackSideNormal) (tTrackSeg *seg, tdble X, tdble Y, int side, t3Dd *norm)
 Get the normal vector (in global coordinate system) of the border of the track including the sides. More...
 
typedef void(* tfTrackSurfaceNormal) (tTrkLocPos *pos, t3Dd *norm)
 Get the normal vector of the road (pointing upward). More...
 
typedef void(* tfTrackShutdown) (void)
 Release current track and all its resources. More...
 

Detailed Description

Interface for track loader modules, the track loader module is discovered and loaded during runtime.

Typedef Documentation

◆ tfTrackBuild

typedef tTrack*(* tfTrackBuild) (char *filename)

Read given track from filename into tTrack struct.

Parameters
[in]filenamefilename including path to file
Returns
tTrack structure on success
Note
The given file must exist and must be correct

Definition at line 530 of file track.h.

◆ tfTrackGlobal2Local

typedef void(* tfTrackGlobal2Local) (tTrackSeg *seg, tdble X, tdble Y, tTrkLocPos *pos, int type)

Convert a global position (segment, X, Y) into a local position (segment, toRight, toStart)

Parameters
[in]segSegment tTrackSeg to start search for coordinates
[in]XGlobal X coordinate
[in]YGlobal Y coordinate
[in,out]postTrkLocPos passed from the caller to fill in the local position
[in]typeType of local position desired:
See also
RtTrackGlobal2Local

Definition at line 563 of file track.h.

◆ tfTrackHeightG

typedef tdble(* tfTrackHeightG) (tTrackSeg *seg, tdble X, tdble Y)

Returns the absolute height in meters of the road at the given global position.

Parameters
[in]segSegment tTrackSeg to start search for coordinates
[in]XGlobal X coordinate
[in]YGlobal Y coordinate
Returns
Height in meters
See also
RtTrackHeightG
RtTrackHeightL

Definition at line 541 of file track.h.

◆ tfTrackHeightL

typedef tdble(* tfTrackHeightL) (tTrkLocPos *pos)

Returns the absolute height in meters of the road at the local position.

Parameters
[in]postTrkLocPos containing the loacal position
Returns
Height in meters
See also
RtTrackHeightL

Definition at line 549 of file track.h.

◆ tfTrackLocal2Global

typedef void(* tfTrackLocal2Global) (tTrkLocPos *pos, tdble *X, tdble *Y)

Convert a local position (segment, toRight, toStart) into a global one (X, Y)

Parameters
[in]posLocal position
[in,out]XPointer to tdble passed by the caller to fill in X position
[in,out]YPointer to tdble passed by the caller to fill in Y position
See also
RtTrackLocal2Global

Definition at line 572 of file track.h.

◆ tfTrackShutdown

typedef void(* tfTrackShutdown) (void)

Release current track and all its resources.

Definition at line 598 of file track.h.

◆ tfTrackSideNormal

typedef void(* tfTrackSideNormal) (tTrackSeg *seg, tdble X, tdble Y, int side, t3Dd *norm)

Get the normal vector (in global coordinate system) of the border of the track including the sides.

Parameters
[in]segCurrent segment
[in]XGlobal X position
[in]YGlobal Y position
[in]sideSide where the normal is wanted
[in,out]normt3Dd passed from the caller to fill in the normalized side normal vector
See also
RtTrackSideNormalG

Definition at line 585 of file track.h.

◆ tfTrackSurfaceNormal

typedef void(* tfTrackSurfaceNormal) (tTrkLocPos *pos, t3Dd *norm)

Get the normal vector of the road (pointing upward).

Parameters
[in]posLocal position
[in,out]normt3Dd passed from the caller to fill in the normal vector
See also
RtTrackSurfaceNormalL

Definition at line 593 of file track.h.