![]() |
VR-Forces 5.0.3 Developer's Guide
|
Description of one lane of a DtRoadSegment.
Classes | |
| struct | DtLaneGeometry |
Public Member Functions | |
| DtLaneSegment () | |
| virtual | ~DtLaneSegment () |
| DtLaneSegment (const DtLaneSegment &orig) | |
| DtLaneSegment & | operator= (const DtLaneSegment &orig) |
| virtual DtLaneSegment * | clone () |
| virtual DtLaneGeometry & | laneGeometry () |
| virtual const DtLaneGeometry & | laneGeometry () const |
| virtual DtTrafficControlDevice * | trafficControlDevice () |
| virtual void | setTrafficControlDevice (DtTrafficControlDevice *device) |
| virtual int | laneNumber () const |
| virtual void | setLaneNumber (const int lane) |
| virtual DtRoadSegment * | parentRoadSegment () const |
| virtual void | setParentRoadSegment (DtRoadSegment *parent) |
Visualization Support | |
Get some vertices in local coordinates defining the lane, for the purposes of visualizing it. | |
| virtual void | generateFirstHalfLanePoints (std::vector< DtVector > &pointList, bool drivingOnLeft, int pointsInCurve=5) |
| virtual void | generateSecondHalfLanePoints (std::vector< DtVector > &pointList, bool drivingOnLeft, int pointsInCurve=5) |
Connecting Lane Access | |
Access connecting lanes. This is the lane in the downstream or upstream segment that this lane connects to. Note that roadSegment convention is used, so lane numbers start at 0 and go to # lanes-1. If this value is -1, the lane does not connect to the next segment (this can happen if a 2-lane segment connects to a 1-lane segment for example, or in the future if each segment approaching an intersection connects to multiple downstream segments but not all lanes connect to all segments). | |
| virtual int | connectingDownstreamLane () const |
| virtual void | setConnectingDownstreamLane (const int lane) |
| virtual int | connectingUpstreamLane () const |
| virtual void | setConnectingUpstreamLane (const int lane) |
Geometry Calculation | |
| virtual double | calculateInsideEntryCurveGeometry (double headingChange, double cosHeadingChange, double sinHeadingChange, bool debug=false) |
| virtual void | calculateEntryCurveGeometry (double segmentLeftEdgeRadius, double headingChange, bool debug=false) |
| virtual double | calculateInsideExitCurveGeometry (double segmentLeftEdgeRadius, double headingChange, double cosHeadingChange, double sinHeadingChange, bool debug=false) |
| virtual void | calculateExitCurveGeometry (double segmentLeftEdgeRadius, double headingChange, bool debug=false) |
Protected Attributes | |
| DtLaneGeometry | myGeometry |
| DtTrafficControlDevice * | myTrafficSignal |
| int | myConnectingDownstreamLane |
| int | myConnectingUpstreamLane |
| DtRoadSegment * | myRoadSegment |
| int | myLaneNumber |
| DtLaneSegment::DtLaneSegment | ( | ) |
|
virtual |
| DtLaneSegment::DtLaneSegment | ( | const DtLaneSegment & | orig | ) |
| DtLaneSegment& DtLaneSegment::operator= | ( | const DtLaneSegment & | orig | ) |
|
virtual |
|
virtual |
Accessor for lane geometry. Geometry is changed by accessing this structure and changing fields.
|
virtual |
|
virtual |
Not currently used (future work). Access traffic control device.
|
virtual |
Not currently used (future work).
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Generate the entry curve and a point halfway down the lane. Points are generated in the right-most lane that continues from the previous segment.
| pointList | A vector of points in local coordinates. This function adds new points to the end. |
| pointsInCurve | is the number of points to use to approximate the entry and exit curves. |
|
virtual |
Generate a point halfway down the lane and the exit curve. Points are generated in the right-most lane that continues to the next segment.
| pointList | A vector of points in local coordinates. This function adds new points to the end. |
| pointsInCurve | is the number of points to use to approximate the entry and exit curves. |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
virtual |
Calculate the entry curve geometry for the inside lane–that is, the lane that connects to the inside lane of the upstream segment. Inside lane means the one with the smallest arc radius. The radius of the curve is taken from the upstream lane info, since that was based on space available in this segment.
The function fills in elements of the myGeometry member.
| headingChange | The change in heading from the previous segment, in radians (+ to the right). If driving on the left of the road, this value should be negated from the true rail segment geometry. |
| cosHeadingChange | cos of heading change. A parameter to avoid repeated calculation. |
| sinHeadingChange | sin of headingChange |
| debug | A flag to generate verbose output on the sim console (DtWarn) |
|
virtual |
Calculate the geometry of the entry curve for all lanes besides the inside lane. See calculateInsideEntryCurveGeometry.
The function fills in elements of the myGeometry member.
|
virtual |
Calculate the exit curve geometry for the inside lane.
This computes the actual radius of the curve and the offset–the distance before the end of the segment (the straight segment defined by the original rail segment) that the curve must begin. The offset is determined both by the radius of the curve and by the location of the intersection of the lane with the downstream lane.
The function compares this offset to the space available in this segment and the next and reduces the curve radius if necessary (even below the design vehicle minimum radius) to accommodate the space available. If there is zero space or less–possible if a segment is short relative to the width of the road–a zero radius will be used, resulting in the vehicle jumping to the next lane when it reaches the end of the segment.
The function uses values in the DtRoadSegment::DtTmpGeometry structure.
The function fills in elements of the myGeometry member.
| segmentLeftEdgeRadius | The radius of a curve connecting the left edges of this segment and the next; assumed to have been calculated from constraints on the inside lane. |
| headingChange | The change in heading to the next segment, in radians (+ to the right). If driving on the left of the road, this value should be negated from the true rail segment geometry. |
| cosHeadingChange | cos of heading change. A parameter to avoid repeated calculation. |
| sinHeadingChange | sin of headingChange |
| debug | A flag to generate verbose output on the sim console (DtWarn) |
|
virtual |
Calculate the geometry of the exit curve for all lanes besides the inside lane. See calculateInsideExitCurveGeometry.
The function fills in elements of the myGeometry member.
|
protected |
|
protected |
Not currently used (future work); the traffic control device controlling traffic flow in the lane of the segment. May be static, e.g. a stop sign.
|
protected |
What lane this connects to in the downstream segment. RoadSegment lanes, ie 0-based numbering.
|
protected |
Upstream connecting lane.
|
protected |
The road segment this lane belongs to.
|
protected |
The array index of this lane in the road segment's array of lanes.