VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
DtRoadObstructionFinder Class Reference

An object containing functions to find obstructions in road segments in a road path; part of a DtRoadMovementController. This class finds obstructions along rail segment lists, and provides details of these obstructions.

Public Member Functions

 DtRoadObstructionFinder (const DtSimulationServices *objMgr, DtLocalObject *hostEntity, bool drivingOnLeft)
 
virtual ~DtRoadObstructionFinder ()
 
virtual void init (const DtRwEntityTypeList &passableObjectTypes)
 
virtual bool findFirstObstructionInLane (const DtRoadSegment *startSegment, const int roadLaneNum, const double frontBumperPositionAlongLane, double lookDistance, DtRailObstructionPtr &result, std::vector< std::vector< DtVector > > &debugBoxes, bool debug=false) const
 
virtual bool findFirstObstructionUpstreamInLane (const DtRoadSegment *startSegment, const int roadLaneNum, const double positionAlongLane, double lookDistance, DtRailObstructionPtr &result, std::vector< std::vector< DtVector > > &debugBoxes, bool debug=false) const
 
virtual bool findImmediateObstruction (double &obstacleDistance, std::vector< DtVector > &debugLocations, std::vector< std::vector< DtVector >> &debugBoxes, bool debug=false) const
 

Protected Member Functions

virtual bool findNearestObstructionInSegment (const DtRoadSegment *segment, const int roadLaneNum, const double distFromSegStart, const double testDistance, DtRailObstructionPtr &obstruction, std::vector< std::vector< DtVector > > &debugBoxes, bool debug=false) const
 
virtual bool findNearestObstructionUpstreamInSegment (const DtRoadSegment *segment, double testAltitude, const int roadLaneNum, const double distFromSegStart, const double testDistance, DtRailObstructionPtr &obstruction, std::vector< std::vector< DtVector > > &debugBoxes, bool debug=false) const
 
void getBoxPointsFromVolume (const Dt3dBoundingVolume &volume, const DtVector &refPoint, const DtDcm &orientation, std::vector< std::vector< DtVector > > &outputList) const
 

Protected Attributes

const DtSimulationServices * mySimulationServices
 
DtCollisionDetector * myCollisionDetector
 
DtLocalObject * myHostEntity
 
bool myDrivingOnLeft
 

Private Member Functions

 DtRoadObstructionFinder ()
 
 DtRoadObstructionFinder (const DtRoadObstructionFinder &orig)
 
DtRoadObstructionFinder & operator= (const DtRoadObstructionFinder &orig)
 

Constructor & Destructor Documentation

DtRoadObstructionFinder::DtRoadObstructionFinder ( const DtSimulationServices *  objMgr,
DtLocalObject *  hostEntity,
bool  drivingOnLeft 
)
virtual DtRoadObstructionFinder::~DtRoadObstructionFinder ( )
virtual
DtRoadObstructionFinder::DtRoadObstructionFinder ( )
private

Not implemented.

DtRoadObstructionFinder::DtRoadObstructionFinder ( const DtRoadObstructionFinder &  orig)
private

Not implemented.

Member Function Documentation

virtual void DtRoadObstructionFinder::init ( const DtRwEntityTypeList &  passableObjectTypes)
virtual
virtual bool DtRoadObstructionFinder::findFirstObstructionInLane ( const DtRoadSegment *  startSegment,
const int  roadLaneNum,
const double  frontBumperPositionAlongLane,
double  lookDistance,
DtRailObstructionPtr &  result,
std::vector< std::vector< DtVector > > &  debugBoxes,
bool  debug = false 
) const
virtual

Looks for obstructions along the given road, starting at the provided lane and position in lane for the specified distance along the lane and connecting lanes in downstream segments. Fills the result rail obstruction object ptr with obstruction information for the first obstacle object found in the lane.

Parameters
resultThis obstruction object is created if there is an obstruction found. If the function returns false, this pointer is not valid.
Returns
True if an obstacle object was found; false otherwise.
virtual bool DtRoadObstructionFinder::findFirstObstructionUpstreamInLane ( const DtRoadSegment *  startSegment,
const int  roadLaneNum,
const double  positionAlongLane,
double  lookDistance,
DtRailObstructionPtr &  result,
std::vector< std::vector< DtVector > > &  debugBoxes,
bool  debug = false 
) const
virtual

Looks for obstructions along the given road, starting at the provided local location for the specified distance along the rail. Fills the result rail obstruction object ptr with obstruction information for the first obstacle object found in the lane.

Parameters
resultThis obstruction object is created if there is an obstruction found. If the function returns false, this pointer is not valid. Note that the myRailObstructionInfo->startBlockDistance in this object is the distance upstream to the front of the obstacle, vs. the distance downstream to the back of the vehicle as in findFirstObstructionInLane.
Returns
True if an obstacle object was found; false otherwise.
virtual bool DtRoadObstructionFinder::findImmediateObstruction ( double &  obstacleDistance,
std::vector< DtVector > &  debugLocations,
std::vector< std::vector< DtVector >> &  debugBoxes,
bool  debug = false 
) const
virtual

Generates a test area directly in front of the vehicle that is a portion of the body length and the width of the vehicle, and checks for obstructing objects within that area. If an obstruction is found, returns true and sets obstacleDistance with the distance of front of the front edge of the vehicle to the obstacle. If no obstruction is found, returns false and obstacleDistance is not valid.

virtual bool DtRoadObstructionFinder::findNearestObstructionInSegment ( const DtRoadSegment *  segment,
const int  roadLaneNum,
const double  distFromSegStart,
const double  testDistance,
DtRailObstructionPtr &  obstruction,
std::vector< std::vector< DtVector > > &  debugBoxes,
bool  debug = false 
) const
protectedvirtual

Finds all obstructions along the specified segment, in the given lane, starting at distFromSegStart and running for the specified testDistance.

Parameters
obstructionThis obstruction object is created if there is an obstruction found. If the function returns false, this pointer is not valid.
Returns
True if an obstacle object was found; false otherwise.
virtual bool DtRoadObstructionFinder::findNearestObstructionUpstreamInSegment ( const DtRoadSegment *  segment,
double  testAltitude,
const int  roadLaneNum,
const double  distFromSegStart,
const double  testDistance,
DtRailObstructionPtr &  obstruction,
std::vector< std::vector< DtVector > > &  debugBoxes,
bool  debug = false 
) const
protectedvirtual

Finds all obstructions along the specified segment, starting at distFromSegStart, and running for the specified testDistance.

Parameters
obstructionThis obstruction object is created if there is an obstruction found. If the function returns false, this pointer is not valid.
Returns
True if an obstacle object was found; false otherwise.
void DtRoadObstructionFinder::getBoxPointsFromVolume ( const Dt3dBoundingVolume &  volume,
const DtVector &  refPoint,
const DtDcm &  orientation,
std::vector< std::vector< DtVector > > &  outputList 
) const
protected

Generates the (5) world points defining rectangle that is a horizontal slice through the given volume at the midpoint of the volume. Used to generate a visualization of the volume.

DtRoadObstructionFinder& DtRoadObstructionFinder::operator= ( const DtRoadObstructionFinder &  orig)
private

Not implemented.

Member Data Documentation

const DtSimulationServices* DtRoadObstructionFinder::mySimulationServices
protected
DtCollisionDetector* DtRoadObstructionFinder::myCollisionDetector
protected
DtLocalObject* DtRoadObstructionFinder::myHostEntity
protected
bool DtRoadObstructionFinder::myDrivingOnLeft
protected

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

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)