Class Road
A road represented by geo positions and a corresponding spline.
Namespace: Holoride.ElasticSDK.Overpass
Assembly: Holoride.ElasticSDK.Library.Runtime.dll
Syntax
public class Road
Fields
Bounds
The bounds of the road.
Declaration
public GlobalBounds Bounds
Field Value
| Type | Description |
|---|---|
| GlobalBounds |
Category
The category of the road.
Declaration
public Road.CategoryType Category
Field Value
| Type | Description |
|---|---|
| Road.CategoryType |
EndRoadLink
The end position.
Declaration
public RoadLink EndRoadLink
Field Value
| Type | Description |
|---|---|
| RoadLink |
Pool
Declaration
public static readonly ObjectPool<Road> Pool
Field Value
| Type | Description |
|---|---|
| ObjectPool<Road> |
StartRoadLink
The start road link.
Declaration
public RoadLink StartRoadLink
Field Value
| Type | Description |
|---|---|
| RoadLink |
Properties
ControlPoints
Gets the ControlPoints to define the road shape.
Declaration
public IReadOnlyList<Road.ControlPoint> ControlPoints { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<><ControlPoint> |
EndDirection
Gets the direction at the end of the road.
Declaration
public Vector2 EndDirection { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
EndPosition
Gets the end position.
Declaration
public GlobalPosition EndPosition { get; }
Property Value
| Type | Description |
|---|---|
| GlobalPosition |
Positions
Gets the positions to define the road shape.
Declaration
public IEnumerable<GlobalPosition> Positions { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<><GlobalPosition> |
StartDirection
Gets the direction at the start of the road.
Declaration
public Vector2 StartDirection { get; }
Property Value
| Type | Description |
|---|---|
| Vector2 |
StartPosition
Gets the start position.
Declaration
public GlobalPosition StartPosition { get; }
Property Value
| Type | Description |
|---|---|
| GlobalPosition |
Methods
AddControlPoint(GlobalPosition, float, float)
Adds a ControlPoint at the end of the road.
Declaration
public void AddControlPoint(GlobalPosition position, float roadWidth, float maxSpeed)
Parameters
| Type | Name | Description |
|---|---|---|
| GlobalPosition | position | The GlobalPosition of the control point. |
| float | roadWidth | The road width at the control point. |
| float | maxSpeed | The maximum speed at the control point. |
Append(Road)
Appends two consecutive roads. At their connection, the road width is set to the maximum of both ends.
Declaration
public void Append(Road road)
Parameters
| Type | Name | Description |
|---|---|---|
| Road | road | The road to append at the end of this road. |
CreatePooled()
Declaration
public static Road CreatePooled()
Returns
| Type | Description |
|---|---|
| Road |
Reverse()
Reverses a road by inverting the order of positions and road links.
Declaration
public void Reverse()
SampleWidth(double)
Returns the interpolated road width at a given control point index.
Declaration
public float SampleWidth(double controlPointIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| double | controlPointIndex | The control point index. The decimal places are the lerp time between its floor and ceil values. |
Returns
| Type | Description |
|---|---|
| float | The width of the road. |