API to gather information about the track and the cars state relative to the track. More...
|
Functions | |
| tdble | RtTrackGetWidth (tTrackSeg *seg, tdble toStart) |
| Get the track width at the specified point. More... | |
| void | RtTrackLocal2Global (tTrkLocPos *p, tdble *X, tdble *Y, int flag) |
| Calculate global coordinates from a local position relative to the given track segment (segment, toRight, toStart)The toStart position refers to the current segment, the function will not search for next segment if toStart is greater than the segment length. More... | |
| void | RtTrackGlobal2Local (tTrackSeg *segment, tdble X, tdble Y, tTrkLocPos *p, int type) |
| Convert a Global (segment, X, Y) position into a Local one (segment, toRight, toStart)The segment in the Global position is used to start the search of a good segment in term of toStart value. More... | |
| tdble | RtTrackHeightL (tTrkLocPos *p) |
| Returns the absolute height in meters of the road at the Local position p. More... | |
| tTrackSeg * | RtTrackGetSideNeighbourSeg (tTrackSeg *main, tTrackSeg *current, int tr_side) |
| Get the neighbour segment of the given current segment. More... | |
| tTrackSeg * | RtTrackGetSeg (tTrkLocPos *p) |
| Get the effective segment of the given position starting from a segment of type TR_MAIN, searching to the sides. More... | |
| tdble | RtTrackHeightG (tTrackSeg *seg, tdble X, tdble Y) |
| Returns the absolute height in meters of the road at the Global position (segment, X, Y) More... | |
| void | RtTrackSideNormalG (tTrackSeg *seg, tdble X, tdble Y, int side, t3Dd *norm) |
| Give the normal vector of the border of the track including the sides. More... | |
| tdble | RtTrackSideTgAngleL (tTrkLocPos *p) |
| Used to get the tangent angle for a track position The angle is given in radian. More... | |
| void | RtTrackSurfaceNormalL (tTrkLocPos *p, t3Dd *norm) |
| Used to get the normal vector of the road (pointing upward). More... | |
| tdble | RtGetDistFromStart (tCarElt *car) |
| Get the distance from the start lane. More... | |
| tdble | RtGetDistFromStart2 (tTrkLocPos *p) |
| Get the distance from the start lane. More... | |
| int | RtDistToPit (struct CarElt *car, tTrack *track, tdble *dL, tdble *dW) |
| Get the distance to the pit stop. More... | |
API to gather information about the track and the cars state relative to the track.
Get the distance to the pit stop.
| [in] | car | The concerned car. |
| [in] | track | The current Track |
| [in,out] | dL | Length to the pits |
| [in,out] | dW | Width to the pits |
Definition at line 662 of file rttrack.cpp.

Get the distance from the start lane.
| [in] | car | the concerned car. |
Definition at line 619 of file rttrack.cpp.

| tdble RtGetDistFromStart2 | ( | tTrkLocPos * | p | ) |
Get the distance from the start lane.
| [in] | p | Local position |
Definition at line 631 of file rttrack.cpp.
| tTrackSeg* RtTrackGetSeg | ( | tTrkLocPos * | p | ) |
Get the effective segment of the given position starting from a segment of type TR_MAIN, searching to the sides.
Get the current segment.
It does not search along the previous and next segments on the track.
| [in] | p | Current position relative to the main segment |
Definition at line 413 of file rttrack.cpp.
Get the neighbour segment of the given current segment.
This is required, because the lside and rside members only point to segments on the outside, the inside pointer is always NULL and this is implied in various code locations.
| [in] | main | Main segment to serach for neighbour from the inside (must be of type TR_MAIN) |
| [in] | current | Segment to find the neighbour for |
| [in] | tr_side | Neighbour we are looking for, either left or right, TR_SIDE_LFT or TR_SIDE_RGT |
Definition at line 383 of file rttrack.cpp.

Get the track width at the specified point.
| [in] | seg | Segment |
| [in] | toStart | Distance from the beginning of the segment. The units are:
|
Definition at line 58 of file rttrack.cpp.
| void RtTrackGlobal2Local | ( | tTrackSeg * | segment, |
| tdble | X, | ||
| tdble | Y, | ||
| tTrkLocPos * | p, | ||
| int | type | ||
| ) |
Convert a Global (segment, X, Y) position into a Local one (segment, toRight, toStart)The segment in the Global position is used to start the search of a good segment in term of toStart value.
The segments are scanned in order to find a toStart value between 0 and the length of the segment for straights or the arc of the curve. The sides parameters is to indicate wether to use the track sides (1) or not (0) in the toRight computation.
| [in] | segment | Current segment |
| [in] | X | Current X position |
| [in] | Y | Current Y position |
| [in,out] | p | Returned local position |
| [in] | type | Type of local position desired:
|
Definition at line 156 of file rttrack.cpp.

Returns the absolute height in meters of the road at the Global position (segment, X, Y)
| [in] | seg | Segment |
| [in] | X | Global X position |
| [in] | Y | Global Y position |
Definition at line 443 of file rttrack.cpp.

| tdble RtTrackHeightL | ( | tTrkLocPos * | p | ) |
Returns the absolute height in meters of the road at the Local position p.
If the point lies outside the track (and sides) the height is computed using the tangent to the banking of the segment (or side).
+ Point given
.^
. |
. |
. |
/ | heigth
/ |
______/ v
^ ^^ ^
| || |
track side
| [in] | p | Local position |
Definition at line 314 of file rttrack.cpp.

| void RtTrackLocal2Global | ( | tTrkLocPos * | p, |
| tdble * | X, | ||
| tdble * | Y, | ||
| int | flag | ||
| ) |
Calculate global coordinates from a local position relative to the given track segment (segment, toRight, toStart)The toStart position refers to the current segment, the function will not search for next segment if toStart is greater than the segment length.
toStart represent an angle in radian for curves and a length in meters for straights.
| [in] | p | Local position |
| [in,out] | X | Returned X position |
| [in,out] | Y | Returned Y position |
| [in] | flag | Local position use:
|
Definition at line 80 of file rttrack.cpp.

Give the normal vector of the border of the track including the sides.
The side parameter is used to indicate the right (TR_RGT) of the left (TR_LFT) side to consider. The Global position given (segment, X, Y) is used to project the point on the border, it is not necessary to give a point directly on the border itself. The vector is normalized.
| [in] | seg | Current segment |
| [in] | X | Global X position |
| [in] | Y | Global Y position |
| [in] | side | Side where the normal is wanted
|
| [in,out] | norm | Returned normalized side normal vector |
Definition at line 470 of file rttrack.cpp.
| tdble RtTrackSideTgAngleL | ( | tTrkLocPos * | p | ) |
Used to get the tangent angle for a track position The angle is given in radian.
the angle 0 is parallel to the first segment start.
| [in] | p | Local position |
Definition at line 514 of file rttrack.cpp.
| void RtTrackSurfaceNormalL | ( | tTrkLocPos * | p, |
| t3Dd * | norm | ||
| ) |
Used to get the normal vector of the road (pointing upward).
Local coordinates are used to locate the point where to get the road normal vector. The vector is normalized.
| [in] | p | Local position |
| [in,out] | norm | Returned normalized road normal vector |
Definition at line 540 of file rttrack.cpp.
