14 #include <matrix/vlVector.h>
41 #define DT_RAIL_SEGMENT_MERGE_ERROR_BOUND 0.3
85 virtual const char*
type()
const;
104 virtual void clear();
129 static void moveAlongCallback(
DtSimMessage * msg,
void * usr);
131 static void setConvoyFollowCallback(
DtSimMessage * msg,
void * usrData);
134 static void settingsObjectConsumerCallback(
const DtSettingsObject* settingsObject,
void* usr);
151 myRoadConstants = rc;
157 myRoadPathFunctions = pf;
168 return myRoadObstructionFinder;
173 myRoadObstructionFinder = of;
191 {
return myProcessState; }
193 {
return myObjectParams; }
199 virtual bool drivingOnLeftEnabled()
const;
208 virtual double frontOffset()
const;
209 virtual void setFrontOffset(
const double o);
214 virtual double rearAxleOffset()
const;
215 virtual void setRearAxleOffset(
const double o);
239 virtual bool findPointOnTerrain(
const DtVector& worldLocation,
DtVector& worldLocationOnTerrain);
244 return myObstacleLocations;
250 return myObstacleBoxes;
256 virtual const double followSpeedFactor()
const;
258 virtual double getDistanceBehindConvoyTarget(
const DtVrfObject * convoyTgt)
const;
284 virtual bool createPSR();
287 virtual bool createUpdater();
288 virtual bool createPathFunctions();
291 virtual bool createRoadObstructionFinder();
293 virtual bool createDrivingLogic();
302 virtual void processSetConvoyFollowCallback(
DtSimMessage * msg);
320 virtual int entryLanePosition(
double heading,
unsigned int numLanes);
327 virtual void clearPath();
332 virtual void initiateLaneChange(
const int newLaneNum);
336 virtual void checkPathEnd();
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
DtRailMovementState
Used to keep the current state of an entity as it travels along a route using the rail system...
Definition: railMovementControllerPSR.h:32
bool myNotInitialized
Definition: roadMovementController.h:383
DtRoadSegmentList myRoadPath
This path is computed, and includes the lane connections and the geometry of the paths connecting the...
Definition: roadMovementController.h:379
virtual std::vector< std::vector< DtVector > > & debugBoxes()
Accessor for the array of 4-point arrays representing areas where the controller is looking for obsta...
Definition: roadMovementController.h:248
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
std::vector< std::vector< DtVector > > myObstacleBoxes
A set of polygons representing bounding volumes of the lanes to search for obstacle vehicles...
Definition: roadMovementController.h:451
DtRoadDrivingLogic * myDrivingLogic
Class to hold functions defining the driving logic.
Definition: roadMovementController.h:362
Description: This repository holds all information that is common to all the forms of all objects wit...
Definition: vrfMovingObjectStateRepository.h:26
Definition: boolSetting.h:30
DtRoadObstructionFinder * myRoadObstructionFinder
Class to hold functions that find obstructions (vehicles) along the entity's current lane and adjacen...
Definition: roadMovementController.h:366
DtRoadMovementUpdater * myRoadUpdater
Class to hold functions that perform the kinematic update and compute the resulting position...
Definition: roadMovementController.h:372
std::list< DtRailSegment * > DtRailSegmentList
Definition: railSegment.h:197
virtual DtRailMovementControllerPSR * psr()
Definition: roadMovementController.h:190
DtRoadSegment * myCurrentRoadSegment
Definition: roadMovementController.h:380
double myRearAxleOffset
Offset in x from entity center to the center of the rear axle.
Definition: roadMovementController.h:401
virtual void setDrivingLogic(DtRoadDrivingLogic *dl)
Definition: roadMovementController.h:161
DtRoadSegmentPart myRoadSegmentPart
Keeps track of what part of the road segment the vehicle currently occupies (entry curve...
Definition: roadMovementController.h:405
virtual void registerTaskMsgCallbacks()
virtual void preFirstTickInit()
This function can be overridden to initialize a component before it is ticked for the first time...
DtRailSegment are segments entities can follow when using the rail movement system.
Definition: railSegment.h:23
Instances of DtRailMovementControllerPSR are used to hold the shared/checkpointable data for a rail m...
Definition: railMovementControllerPSR.h:47
This class provides a base class for all controllers that are capable of executing a DtSimTask...
Definition: singleTaskControllerComponent.h:20
virtual DtRoadMovementUpdater * movementUpdater()
Definition: roadMovementController.h:176
virtual const DtRoadConstants * roadConstants()
Definition: roadMovementController.h:144
int myLastNumObstaclePoints
The number of obstacles last tick.
Definition: roadMovementController.h:446
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
bool myRoadAltitudesSet
Definition: roadMovementController.h:385
A container for constants that define the path of a vehicle on the road in terms of design-vehicles a...
Definition: roadConstants.h:21
Definition: roadPathFunctions.h:19
Definition: readerWriterRegistry.h:39
const DtRoadConstants * myRoadConstants
The following members hold classes that define key functions of the driving controller.
Definition: roadMovementController.h:353
double myFrontOffset
Distance from entity center to front.
Definition: roadMovementController.h:390
DtRoadMovementController is a movement controller that models an entity's movement along a road path...
Definition: roadMovementController.h:66
virtual const char * type() const =0
Returns a string identifies the class type of component.
virtual bool init()
Calls setRadio()
virtual void clearTask()
If component is currently tasked, calls clearPendingSubtasks(), sets the tasked flag to false...
Definition: settingsObject.h:27
std::list< DtRoadSegment * > DtRoadSegmentList
Definition: roadSegment.h:373
virtual DtRoadPathFunctions * pathFunctions()
Definition: roadMovementController.h:154
const DtRoadMovementDescriptor * myRoadMoveDescriptor
Definition: roadMovementController.h:341
virtual const DtMovingObjectParameters * objectParameters()
Definition: roadMovementController.h:192
virtual void updateTaskVisualizations()
Called to update task visualizations after every tick.
Definition: simComponent.h:485
std::vector< DtVector > myObstacleLocations
These visualizations are updated every tick.
Definition: roadMovementController.h:443
DtRailSegmentList myPath
This is the input path to the controller.
Definition: roadMovementController.h:376
bool myHaveCreatedDebugVis
Several visualizations are created once and never updated.
Definition: roadMovementController.h:432
virtual void setRoadConstants(const DtRoadConstants *rc)
A new set of road constants can be set in a class derived from DtRoadConstansts; then set the pointer...
Definition: roadMovementController.h:149
std::vector< DtVector > myTaskVisPath
For debug visualizationThe path of the road segments.
Definition: roadMovementController.h:411
Models an entity moving along a generated road path.
Definition: roadMovementUpdater.h:40
const DtMovingObjectParameters * myObjectParams
Definition: roadMovementController.h:343
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
virtual std::vector< DtVector > & debugPoints()
Accessor for the individual points representing obstacle vehicles.
Definition: roadMovementController.h:242
virtual bool tickWhileDestroyed() const
If the component returns true here, it will be ticked regardless of the destroyed state of the host e...
The moving-object-param parameter type is used for objects that are capable of movement, such as individual entities and aggregates.
Definition: movingObjectParameters.h:33
std::map< DtRoadSegment *, unsigned > myRoadSegmentTaskVisMap
Maps road segments to the index of the task vis path points that make up this segment.
Definition: roadMovementController.h:420
DtRoadPathFunctions * myRoadPathFunctions
Class to hold functions that process lists of road segments, i.e.
Definition: roadMovementController.h:359
const DtRailSegmentList * path() const
Definition: roadMovementController.h:265
DtRailMovementControllerPSR * myProcessState
Definition: roadMovementController.h:340
DtRoadSegmentPart
This enumeration is a convenience for indicating what part of the lane geometry a point is on...
Definition: roadSegment.h:377
std::vector< DtVector > myOriginalPath
Holds the start (local) locations of the original rail path segments.
Definition: roadMovementController.h:435
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
const DtTaskControllerComponent & operator=(const DtTaskControllerComponent &orig)
assignment operator
File: railMoveAlongTask.h.
Definition: railMoveAlongTask.h:50
bool myWarnedAboutMissingConvoyLeaderOnce
Definition: roadMovementController.h:384
std::vector< DtVector > myCurrentTaskVisPath
The currently displayed task vis path.
Definition: roadMovementController.h:416
DtVrfMovingObjectStateRepository * myMovingStateRep
Definition: roadMovementController.h:342
Description of one segment of a road.
Definition: roadSegment.h:390
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:102
bool myDrivingOnLeft
Definition: roadMovementController.h:382
An object containing functions to find obstructions in road segments in a road path; part of a DtRoad...
Definition: roadObstructionFinder.h:31
virtual void setPathFunctions(DtRoadPathFunctions *pf)
Definition: roadMovementController.h:155
virtual void setObstructionFinder(DtRoadObstructionFinder *of)
After creating a new obstFinder, call init() on it.
Definition: roadMovementController.h:171
virtual DtRoadDrivingLogic * drivingLogic()
Definition: roadMovementController.h:160
Definition: railSplineCalculator.h:25
virtual void setMovementUpdater(DtRoadMovementUpdater *u)
After creating a new updater, call init(), setEntityState(), and setPSR() on the new updater...
Definition: roadMovementController.h:180
Definition: roadDrivingLogic.h:18
unsigned myCurrentTaskVisPathPtIndex
The current starting point index of the displayed task vis path.
Definition: roadMovementController.h:423
virtual DtRoadObstructionFinder * obstructionFinder()
Definition: roadMovementController.h:166
DtBoost::shared_ptr< DtRailObstruction > DtRailObstructionPtr
Definition: railObstructionInfo.h:78
int myLastNumBoxes
The number of boxes last tick.
Definition: roadMovementController.h:454
A DtComponentDescriptor that has parameters that indicate how an entity should move along a rail segm...
Definition: roadMovementDescriptor.h:24