VR-Forces 4.0.4 Class Documentation
Public Member Functions | Protected Attributes | Private Member Functions
DtRailSplineCalculator Class Reference

List of all members.

Public Member Functions

 DtRailSplineCalculator ()
virtual ~DtRailSplineCalculator ()
virtual bool setUpTurnSpline (const DtRailSegment *currentSeg, const DtRailSegment *nextSeg, const int currentLane, const int desiredLane, Coordinate_System *coordinateSystem, bool useDefinedEntry=false, DtVector entryPt=DtVector::zero())
 Set up spline to achieve turning from one segment to another. Returns true if able to construct a spline.
virtual bool setUpLaneSwitchSpline (const DtVector &projectedLocation, const DtRailSegment *currentSeg, const double bvolHL, const int currentLane, const int desiredLane, Coordinate_System *coordinateSystem)
 Set up spline to achieve a lane switch.
virtual bool recalculateSpline (const DtRailSegment *currentSeg, const DtRailSegment *nextSeg, const int currentLane, const int passingLane, const int previousSwitchDirection, Coordinate_System *coordinateSystem)
virtual bool modifySpline (const DtVector &currentLocalPos, const DtRailSegment *currentSeg, const DtRailSegment *nextSeg, const int currentLane, const int passingLane, Coordinate_System *coordinateSystem)
virtual void calculateTurnPath (const DtVector &pathEntryPt, const DtVector &pathMidPt, const DtVector &pathExitPt)
 generates the turn path needed to provide a smooth turn that connects the segments on the path.
virtual DtVector determinePositionAlongCurve (double distance)
 If the entity is using turn smoothing and it is currently turning this will find where on the curve the entity is.
virtual double calculateTurnHeading (double oldHeading)
 Starting from the old heading add the percentage of the difference covered given the spline time.
virtual double calculateLaneSwitchHeading (double oldHeading)
virtual bool finishTurn (double oldHeading, double newHeading)
virtual bool finishLaneSwitch (double oldHeading, double newHeading)
virtual const DtVectorsplineLocalEntryPoint () const
 These are the generated local entry,mid, exit points for the spline transformed from the pathEntryPt,pathMidPt, pathExitPt supplied to the calculateTurnPath function.
virtual const DtVectorsplineLocalMidPoint () const
virtual const DtVectorsplineLocalExitPoint () const
virtual const int turnEntryLane () const
virtual void setDrivingOnLeft (bool left)
virtual bool drivingOnLeft () const
virtual void setTurnDirection (const int dir)
 These are set by the updater when setUpTurn is called to intialize the spline calculator.
virtual const int turnDirection () const
virtual void setLocalToTopoTransform (const DtCoordTransform &transform)
virtual void setTopoToLocalTransform (const DtCoordTransform &transform)
virtual void clear ()

Protected Attributes

double myTotalSplineDistance
 This is the distance along the current segment from turn entry point to end point plus the the distance along the next segment to the turn exit point.
double mySplineTime
 Keeps track of the parametric time, where we are on the curve.
double myHeadingShift
 This is the difference between our current heading and desired heading.
DtCoordTransform myLocalToTopoTransform
 Transform to.
DtCoordTransform myTopoToLocalTransform
int myTurnDirection
 Direction of the curve--going to left(-1) or right(1)
int myTurnEntryLane
 Lane we use to entry the turn.
bool myDrivingOnLeft
 Are we driving on the left or right side of the road.
DtVector myLocalEntryPoint
 The points used to generate the spline in local coordinates.
DtVector myLocalMidPoint
DtVector myLocalExitPoint
std::vector< DtVectormySplineCoefficents
 The spline coefficents used to determine a position along a curve.

Private Member Functions

 DtRailSplineCalculator (const DtRailSplineCalculator &orig)
 copy constructor
DtRailSplineCalculatoroperator= (const DtRailSplineCalculator &orig)
 assignment operator

Constructor & Destructor Documentation

copy constructor


Member Function Documentation

virtual bool DtRailSplineCalculator::setUpTurnSpline ( const DtRailSegment currentSeg,
const DtRailSegment nextSeg,
const int  currentLane,
const int  desiredLane,
Coordinate_System coordinateSystem,
bool  useDefinedEntry = false,
DtVector  entryPt = DtVector::zero() 
) [virtual]

Set up spline to achieve turning from one segment to another. Returns true if able to construct a spline.

virtual bool DtRailSplineCalculator::setUpLaneSwitchSpline ( const DtVector projectedLocation,
const DtRailSegment currentSeg,
const double  bvolHL,
const int  currentLane,
const int  desiredLane,
Coordinate_System coordinateSystem 
) [virtual]

Set up spline to achieve a lane switch.

virtual bool DtRailSplineCalculator::recalculateSpline ( const DtRailSegment currentSeg,
const DtRailSegment nextSeg,
const int  currentLane,
const int  passingLane,
const int  previousSwitchDirection,
Coordinate_System coordinateSystem 
) [virtual]
virtual bool DtRailSplineCalculator::modifySpline ( const DtVector currentLocalPos,
const DtRailSegment currentSeg,
const DtRailSegment nextSeg,
const int  currentLane,
const int  passingLane,
Coordinate_System coordinateSystem 
) [virtual]
virtual void DtRailSplineCalculator::calculateTurnPath ( const DtVector pathEntryPt,
const DtVector pathMidPt,
const DtVector pathExitPt 
) [virtual]

generates the turn path needed to provide a smooth turn that connects the segments on the path.

Uses 3 points in the intersection to generate a simple quadratic spline curve. Points are in whatever coordinate systems the supplied path points are in.

virtual DtVector DtRailSplineCalculator::determinePositionAlongCurve ( double  distance) [virtual]

If the entity is using turn smoothing and it is currently turning this will find where on the curve the entity is.

virtual double DtRailSplineCalculator::calculateTurnHeading ( double  oldHeading) [virtual]

Starting from the old heading add the percentage of the difference covered given the spline time.

virtual double DtRailSplineCalculator::calculateLaneSwitchHeading ( double  oldHeading) [virtual]
virtual bool DtRailSplineCalculator::finishTurn ( double  oldHeading,
double  newHeading 
) [virtual]
virtual bool DtRailSplineCalculator::finishLaneSwitch ( double  oldHeading,
double  newHeading 
) [virtual]
virtual const DtVector& DtRailSplineCalculator::splineLocalEntryPoint ( ) const [virtual]

These are the generated local entry,mid, exit points for the spline transformed from the pathEntryPt,pathMidPt, pathExitPt supplied to the calculateTurnPath function.

virtual const DtVector& DtRailSplineCalculator::splineLocalMidPoint ( ) const [virtual]
virtual const DtVector& DtRailSplineCalculator::splineLocalExitPoint ( ) const [virtual]
virtual const int DtRailSplineCalculator::turnEntryLane ( ) const [virtual]
virtual void DtRailSplineCalculator::setDrivingOnLeft ( bool  left) [virtual]
virtual bool DtRailSplineCalculator::drivingOnLeft ( ) const [virtual]
virtual void DtRailSplineCalculator::setTurnDirection ( const int  dir) [virtual]

These are set by the updater when setUpTurn is called to intialize the spline calculator.

virtual const int DtRailSplineCalculator::turnDirection ( ) const [virtual]
virtual void DtRailSplineCalculator::setLocalToTopoTransform ( const DtCoordTransform &  transform) [virtual]
virtual void DtRailSplineCalculator::setTopoToLocalTransform ( const DtCoordTransform &  transform) [virtual]
virtual void DtRailSplineCalculator::clear ( ) [virtual]
DtRailSplineCalculator& DtRailSplineCalculator::operator= ( const DtRailSplineCalculator orig) [private]

assignment operator


Member Data Documentation

This is the distance along the current segment from turn entry point to end point plus the the distance along the next segment to the turn exit point.

Keeps track of the parametric time, where we are on the curve.

This is the difference between our current heading and desired heading.

Used to determine the heading of the entity as it moves along the spline.

DtCoordTransform DtRailSplineCalculator::myLocalToTopoTransform [protected]

Transform to.

DtCoordTransform DtRailSplineCalculator::myTopoToLocalTransform [protected]

Direction of the curve--going to left(-1) or right(1)

Lane we use to entry the turn.

Are we driving on the left or right side of the road.

This affects how you set up the turn splines!

The points used to generate the spline in local coordinates.

The spline coefficents used to determine a position along a curve.


The documentation for this class was generated from the following file:

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)