![]() |
VR-Forces 4.6 Class Documentation
|
DtRailSegment are segments entities can follow when using the rail movement system. More...

Public Member Functions | |
| DtRailSegment () | |
| DtRailSegment (const DtVector &start, const DtVector &end) | |
| virtual | ~DtRailSegment () |
| DtRailSegment (const DtRailSegment &orig) | |
| DtRailSegment & | operator= (const DtRailSegment &orig) |
| virtual DtRailSegment * | clone () |
| virtual double | defaultSegmentSpeedLimit () const |
| The default speed limit used when none is provided in feature data or otherwise set. | |
| virtual double | laneCenterOffset (int lane) const |
| virtual std::list< int > | availableLanes () const |
| virtual double | length () const |
| When length is called it will recompute and cache the new length if the endpoints have changed. | |
| virtual void | setStartPoint (const DtVector &start) |
| The first point of the segment. (Local coordinates) | |
| virtual const DtVector & | startPoint () const |
| virtual void | setEndPoint (const DtVector &end) |
| The last point of the segment. | |
| virtual const DtVector & | endPoint () const |
| virtual void | setSegmentSpeed (double speed) |
| The speed that is recommend along this segment. | |
| virtual double | segmentSpeed () const |
| virtual void | setLaneWidth (double width) |
| The lane width of the segment lanes. | |
| virtual double | laneWidth () const |
| virtual void | setNumberOfLanes (unsigned int lanes) |
| How many lanes are contained in the segment. | |
| virtual unsigned int | numberOfLanes () const |
| virtual int | leftLaneOfLane (int lane) const |
| Gets the lane to the left of the lane specified. | |
| virtual int | rightLaneOfLane (int lane) const |
| virtual double | findLaneShift (const int fromLane, const int toLane) const |
| This finds the distance between the centerlines of 2 lanes in the segment. | |
| virtual double | laneOffset (int lanePos) const |
| lane offset is the width of all the lanes between the lanePos and the center line. | |
| virtual void | setIsOneWay (bool way) |
| Directionality of the segment, whether it is one way or not. | |
| virtual bool | isOneWay () const |
| virtual void | setSpecificationID (const DtSpecificationID id) |
| The specification id of the feature data or route this segment is based from. | |
| virtual const DtSpecificationID | specificationID () const |
| virtual void | setPathId (const unsigned int id) |
| The path id is a simple way of keeping track of when we turn if we are just at a curve in the path in which case the two connecting segments will have the same id or if an intersection has been reached and the connecting segments will have different path ids. | |
| virtual const unsigned int | pathId () const |
| virtual void | setSegmentSurfaceConditions (DtVrfWeatherPrecipitationType condition) |
| Environmental Condition of segment. | |
| virtual DtVrfWeatherPrecipitationType | segmentSurfaceConditions () const |
| virtual void | setMedianWidth (const double width) |
| In a two-way segment, the width of the median (impassable area) down the center. | |
| virtual double | medianWidth () const |
| virtual void | setRoadName (const DtString name) |
| The name of the road this segment is a part of (or empty) | |
| virtual DtString | roadName () const |
Static Public Member Functions | |
| static unsigned int | nextPathId () |
Protected Attributes | |
| DtVector | myStartPoint |
| DtVector | myEndPoint |
| double | mySpeed |
| Default is 50 m/s. | |
| double | myLaneWidth |
| Default is 3.66m. This is U.S. Highway standard. | |
| unsigned int | myNumberOfLanes |
| Default is 2 allowing a lane for each direction of traffic. | |
| bool | myIsOneWay |
| Default is false. Allowing traffic in each direction. | |
| unsigned int | myPathId |
| Keep track of if this segment is just a continuation of the current road. | |
| DtSpecificationID | mySpecId |
| Default is 0. It will be set based on whatever feature it was created from. | |
| DtVrfWeatherPrecipitationType | mySurfaceCondition |
| Default is 0–No precipitation. | |
| double | myMedianWidth |
| In a two-way segment, the width of the median (impassable area) down the center. | |
| DtString | myRoadName |
| The name, if present. | |
| double | myLength |
| These values are calculated when needed and cached. | |
| bool | myRecomputeLength |
Static Protected Attributes | |
| static unsigned int | theNextPathId |
DtRailSegment are segments entities can follow when using the rail movement system.
End User Description: DtRailSegments are segments with attributes that entities follow. Currently these are only generated by the DtRailPathPlanner however future components can generate them if they desire an entity to follow along a collections of segments with defined speeds and heading. Other attributes can be added that can affect how an entity moves along it. These are not tied to ground entities. One can make rail segments that represent merchant marine lanes in the sea.
| DtRailSegment::DtRailSegment | ( | ) |
|
virtual |
| DtRailSegment::DtRailSegment | ( | const DtRailSegment & | orig | ) |
| DtRailSegment& DtRailSegment::operator= | ( | const DtRailSegment & | orig | ) |
Reimplemented in DtRwRailSegment.
|
virtual |
|
virtual |
The first point of the segment. (Local coordinates)
|
virtual |
|
virtual |
The last point of the segment.
|
virtual |
|
virtual |
The speed that is recommend along this segment.
The Rail Movement Controller will check this speed and cap the entity's speed if it's speed exceeds the segment speed. no speeding.
|
virtual |
|
virtual |
The default speed limit used when none is provided in feature data or otherwise set.
Always returns 50.0.
|
virtual |
The lane width of the segment lanes.
|
virtual |
How many lanes are contained in the segment.
Gets the lane to the left of the lane specified.
For countries that are reversed from the US, you should call the opposite function. For instance, in the UK, if you want the lane to the left of your current, you should call rightLaneOfLane() instead.
This finds the distance between the centerlines of 2 lanes in the segment.
lane offset is the width of all the lanes between the lanePos and the center line.
Lanes are designated from (number of lanes)/2 to -(number of lanes)/2 from the centerline oriented from the segment's start to end point. So for person traveling from start to end on a 4 lane road, 1 is the far most right lane and the lane offset for that lane position would be one lane width. 2 and -2 would have no offset since they are in the lanes adjacent to the center line and 1/-1 would have one lane width.
|
virtual |
Directionality of the segment, whether it is one way or not.
|
virtual |
|
virtual |
|
virtual |
The specification id of the feature data or route this segment is based from.
This can be used to lookup more information about the type of segment in the DtSpecificationManager if so desired. DtSpecificationID is just an unsigned int. They correspond the DFAD codes which are used to identify a feature–is it a bridge, a gravel road, a canal.......
|
virtual |
The path id is a simple way of keeping track of when we turn if we are just at a curve in the path in which case the two connecting segments will have the same id or if an intersection has been reached and the connecting segments will have different path ids.
|
virtual |
Environmental Condition of segment.
Rainy, sandstorm, high sea state... These are defined in vrfWeatherStateEnums.h
|
virtual |
|
virtual |
In a two-way segment, the width of the median (impassable area) down the center.
|
virtual |
|
virtual |
The name of the road this segment is a part of (or empty)
|
virtual |
|
virtual |
When length is called it will recompute and cache the new length if the endpoints have changed.
The same will happen for the length.
|
protected |
|
protected |
|
protected |
Default is 50 m/s.
Make it high so default is to not interfere with driving and let user choose speed to travel at.
|
protected |
Default is 3.66m. This is U.S. Highway standard.
Default is 2 allowing a lane for each direction of traffic.
|
protected |
Default is false. Allowing traffic in each direction.
Keep track of if this segment is just a continuation of the current road.
Upon reaching an intersection and turning, the ids will be different.
|
protected |
Default is 0. It will be set based on whatever feature it was created from.
|
protected |
Default is 0–No precipitation.
|
protected |
In a two-way segment, the width of the median (impassable area) down the center.
|
protected |
The name, if present.
|
mutableprotected |
These values are calculated when needed and cached.
|
mutableprotected |