Track loader for tracks of version 4. More...
#include <stdlib.h>#include <math.h>#include <stdio.h>#include <tgf.h>#include <robottools.h>#include <track.h>#include <portability.h>#include "trackinc.h"
Go to the source code of this file.
Macros | |
| #define | TSTX(x) |
| #define | TSTY(y) |
| #define | TSTZ(z) |
| #define | MAX_TMP_INTS 256 |
Functions | |
| static void | initSideForTurn (const int turntype, tTrackSeg *const curBorder, const tTrackSeg *const curSeg, const int side, const int bankingtype, const tdble startwidth, const tdble endwidth, const tdble maxwidth) |
| Set up side and border track segments for turns. More... | |
| static void | initSideForStraight (tTrackSeg *const curBorder, const tTrackSeg *const curSeg, const int side, const int bankingtype, const tdble startwidth, const tdble endwidth) |
| Set up side and border track segments for straight segments. More... | |
| static tTrackSeg * | commonSideInit (tTrackSeg *const curSeg, const int side, const int lefttype, const int righttype, const int bankingtype, const tdble startwidth, const tdble endwidth, tTrackSurface *surface, const tdble borderheight, const int borderstyle) |
| Common side/border allocation and initialization for straights and turns. More... | |
| static tTrackSurface * | getTrackSurface (void *trackHandle, tTrack *theTrack, const char *material) |
| Gets surface properties based on the material. More... | |
| static void | readDefaultSideParameters (void *trackHandle, tTrack *theTrack) |
| Reads default side/border track segment parameters. More... | |
| static void | addSides (tTrackSeg *curSeg, void *trackHandle, tTrack *theTrack, int curStep, int steps) |
| Adds the specified side/border/barrier segments to given main track segement. More... | |
| static void | normSeg (tTrackSeg *curSeg) |
| Segment coordinate normalization, track is moved to the origin of the coordinate system. More... | |
| static void | CreateSegRing (void *TrackHandle, tTrack *theTrack, int ext) |
| void | ReadTrack4 (tTrack *theTrack, void *TrackHandle, tRoadCam **camList, int ext) |
| static void | updateMinMaxForTurn (const tTrackSeg *const curBorder, const tdble radius, const tdble sign, const tdble z) |
| Update global min/max values for turns (discretized approximation). More... | |
| static void | initAnglesAndGradients (tTrackSeg *const curBorder, const tdble startwidth, const tdble endwidth) |
| Set up border segment angles and gradients. More... | |
| #define MAX_TMP_INTS 256 |
| #define TSTX | ( | x | ) |
Definition at line 38 of file track4.cpp.
| #define TSTY | ( | y | ) |
Definition at line 43 of file track4.cpp.
| #define TSTZ | ( | z | ) |
Definition at line 48 of file track4.cpp.
|
static |
Adds the specified side/border/barrier segments to given main track segement.
| [in,out] | curSeg | Main track segment to process |
| [in] | trackHandle | Handle to track parameter set |
| [in] | theTrack | Pointer to track structure |
| [in] | curStep | Current step (for segment subdivision) |
| [in] | steps | Number of steps (segment subdivisions) |
Definition at line 235 of file track4.cpp.

|
static |
Common side/border allocation and initialization for straights and turns.
| [in,out] | curSeg | Segment to attach the new side/border |
| [in] | side | 0 for right side, 1 for left side (TRK_SECT_RSIDE, TRK_SECT_LSIDE) |
| [in] | lefttype | For side: TR_LSIDE, for border: TR_LBORDER |
| [in] | righttype | For side: TR_RSIDE, for border: TR_RBORDER |
| [in] | bankingtype | For TRK_VAL_TANGENT 1, for TRK_VAL_LEVEL 0 |
| [in] | startwidth | Start width of the side/border |
| [in] | endwidth | End width of the side/border |
| [in] | surface | Surface for the side/border |
| [in] | borderheight | Border height for borders, should usually be 0.0 for sides |
| [in] | borderstyle | Type of segment, for sides always TR_PLAN, for borders either TR_PLAN, TR_CURB or TR_WALL |
Definition at line 1438 of file track4.cpp.

|
static |
|
static |
Gets surface properties based on the material.
If the material is not known, then a new material is created, initialized and attached to tTrack.
| [in] | trackHandle | Handle to track parameter set |
| [in,out] | theTrack | Pointer to track structure |
| [in] | material | Material name of the surface |
Definition at line 130 of file track4.cpp.

|
static |
Set up border segment angles and gradients.
| [in,out] | curBorder | Border segment to set up |
| [in] | startwidth | Start width of the border |
| [in] | endwidth | End width of the border |
Definition at line 1276 of file track4.cpp.
|
static |
Set up side and border track segments for straight segments.
Border segments are the ones touching the main segment (e.g. curbs), side segments are the segments touching the barrier.
| [in,out] | curBorder | Border segment to set up |
| [in] | curSeg | Connecting inner segment (e.g. main track segment for borders) |
| [in] | side | 0 for right side, 1 for left side (TRK_SECT_RSIDE, TRK_SECT_LSIDE) |
| [in] | bankingtype | For TRK_VAL_TANGENT 1, for TRK_VAL_LEVEL 0 |
| [in] | startwidth | Start width of the border |
| [in] | endwidth | End width of the border |
Definition at line 1376 of file track4.cpp.
|
static |
Set up side and border track segments for turns.
Border segments are the ones touching the main segment (e.g. curbs), side segments are the segments touching the barrier.
| [in] | turntype | Turn type, either TR_LFT or TR_RGT |
| [in,out] | curBorder | Border segment to set up |
| [in] | curSeg | Connecting inner segment (e.g. main track segment for borders) |
| [in] | side | 0 for right side, 1 for left side (TRK_SECT_RSIDE, TRK_SECT_LSIDE) |
| [in] | bankingtype | For TRK_VAL_TANGENT 1, for TRK_VAL_LEVEL 0 |
| [in] | startwidth | Start width of the border |
| [in] | endwidth | End width of the border |
| [in] | maxwidth | Maximum width of the border |
Definition at line 1301 of file track4.cpp.

|
static |
Segment coordinate normalization, track is moved to the origin of the coordinate system.
| [in,out] | curSeg | Segment to normalize |
Definition at line 371 of file track4.cpp.
|
static |
Reads default side/border track segment parameters.
| [in] | trackHandle | Handle to track parameter set |
| [in,out] | theTrack | Pointer to track structure |
Definition at line 172 of file track4.cpp.

|
static |
Update global min/max values for turns (discretized approximation).
| [in] | curBorder | Border segment |
| [in] | radius | Radius to hand over, either curBorder->radiusl or curBorder->radiusr |
| [in] | sign | Sign to consider turn type (TR_LFT or TR_RGT) |
| [in] | z | Z value |
Definition at line 1250 of file track4.cpp.

|
static |
Definition at line 78 of file track4.cpp.
|
static |
Definition at line 80 of file track4.cpp.
|
static |
Definition at line 79 of file track4.cpp.
|
static |
Definition at line 81 of file track4.cpp.
|
static |
Definition at line 77 of file track4.cpp.
|
static |
Definition at line 72 of file track4.cpp.
|
static |
Definition at line 74 of file track4.cpp.
|
static |
Definition at line 73 of file track4.cpp.
|
static |
Definition at line 75 of file track4.cpp.
|
static |
Definition at line 71 of file track4.cpp.
|
static |
Definition at line 69 of file track4.cpp.
|
static |
Definition at line 68 of file track4.cpp.
|
static |
Definition at line 83 of file track4.cpp.
|
static |
Definition at line 58 of file track4.cpp.
|
static |
Definition at line 57 of file track4.cpp.
|
static |
Definition at line 56 of file track4.cpp.
|
static |
Definition at line 64 of file track4.cpp.
|
static |
Definition at line 62 of file track4.cpp.
|
static |
Definition at line 65 of file track4.cpp.
|
static |
Definition at line 63 of file track4.cpp.
|
static |
Definition at line 66 of file track4.cpp.
|
static |
Definition at line 60 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.
|
static |
Definition at line 36 of file track4.cpp.