Repository navigation
A3D_GetRouteTurn
imshooter edited this page Oct 23, 2026
·
1 revision
Read a turn of a route, at a junction where more than two ways meet.
Turns a few metres apart count as one, so crossing a divided road is a single turn. A route that starts against heading begins with A3D_TURN_BACK at its first point.
native A3D_TURN:A3D_GetRouteTurn(
Route:routeid,
index,
&Float:x,
&Float:y,
&Float:z,
&Float:distance = 0.0
);| Parameter | Description | Default |
|---|---|---|
Route:routeid |
Route to read. | |
index |
Index of the turn, from 0. |
|
&Float:x |
Junction on the X axis. | |
&Float:y |
Junction on the Y axis. | |
&Float:z |
Junction on the Z axis. | |
&Float:distance |
Distance from the start of the route to the junction, in metres. | 0.0 |
- The turn.
-
A3D_TURN_NONEwhen the route or the turn does not exist.
The angle of a turn is measured between the directions of the roads a few metres before and after the junction. Turns tells what each value means. Turns closer than 25 metres count as one, so crossing a divided road is one left turn rather than two.
Writes a turn as a driver reads it.
static const gTurnText[A3D_TURN][] = {
"Continue",
"Keep left",
"Turn left",
"Turn sharp left",
"Keep right",
"Turn right",
"Turn sharp right",
"Turn back"
};
stock DescribeTurn(Route:routeid, index, text[], size = sizeof (text)) {
new
Float:x,
Float:y,
Float:z,
Float:distance,
A3D_TURN:turn = A3D_GetRouteTurn(routeid, index, x, y, z, distance)
;
format(text, size, "%s after %.0f metres", gTurnText[turn], distance);
}- A3D_GetRouteTurnCount: Number of turns of a route.
- A3D_GetRouteProgress: Find where a point is along a route: the distance left, the distance from the route and the next turn.
3DAndreas 0.7.0 · Repository · Releases · MIT License
Guides
- Installation
- Configuration
- Physics objects
- Model settings
- World queries
- The screen
- Routes
- Navigation mesh
- Map database
- Coming from ColAndreas
- Performance
Reference
Functions