VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
railMovementControllerPSR.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2015 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
15 #include "vrfobjcore/simObject.h"
16 #include <readerWriter/rwReal.h>
17 #include <readerWriter/rwInt.h>
18 #include <readerWriter/rwBoolean.h>
19 #include <readerWriter/rwString.h>
20 #include "readerWriter/rwVector.h"
21 #include <vrfutil/rwUUID.h>
23 
26 
34 {
45 };
49 {
50 public:
51 
54  const DtString& rwName = DtString::nullString(),
55  DtReaderWriterRegistry* parentRegistry = 0);
56 
59  const DtString& rwName = DtString::nullString(),
60  DtReaderWriterRegistry* parentRegistry = 0);
61 
63  virtual ~DtRailMovementControllerPSR() override;
64 
67 
70  const DtString& rwName = DtString::nullString(), DtReaderWriterRegistry* parentRegistry = 0) const override;
71 
74  virtual DtString type() const override;
75 
76  virtual void setCurrentMovementState(DtRailMovementState state);
77  virtual DtRailMovementState currentMovementState() const;
78 
89  virtual void setUseHighFidelityGroundClamping(bool yesOrNo);
90  virtual bool useHighFidelityGroundClamping() const;
92 
95  virtual void resetSegmentIndex();
96  virtual void incrementSegmentIndex();
97  virtual const int segmentIndex() const;
98  virtual void setSegmentIndex(const int);
100 
104  virtual double positionAlongLane() const;
105  virtual void setPositionAlongLane(const double p);
107 
110  virtual double speedAlongLane() const;
111  virtual void setSpeedAlongLane(const double s);
113 
116  virtual double accelerationAlongLane()const;
117  virtual void setAccelerationAlongLane(const double a);
119 
125  virtual double offsetFromLaneCenterline() const;
126  virtual void setOffsetFromLaneCenterline(const double offset);
127 
129  virtual double laneHeading() const;
130  virtual void setLaneHeading(const double heading);
131 
135  virtual double laneChangeWidth() const;
136  virtual void setLaneChangeWidth(const double f);
137 
138 
140  virtual void setCurrentLanePosition(const int lane);
141  virtual const int currentLanePosition() const;
142 
145  virtual void setCurrentLaneNumber(const int lane);
146  virtual const int currentLaneNumber() const;
147 
152  virtual void setPassingLanePosition(const int lane);
153 
154  virtual const int passingLanePosition() const;
156 
158  virtual void setTurning(bool turn);
159  virtual bool turning() const;
161 
163  virtual void setAllowPassing(bool canPass);
164  virtual bool allowPassing() const;
166 
168  virtual void setPassing(bool pass);
169  virtual bool passing() const;
171 
173  virtual void setAvoidingCollision(bool avoid);
174  virtual bool avoidingCollision() const;
176 
178  virtual void setNeedSwitchLanes(bool switchLane);
179  virtual bool needSwitchLanes() const;
181 
184  virtual void setIsAcquiringLane(bool isAcquiring);
185  virtual bool isAcquiringLane() const;
186 
188  virtual void setConvoyTargetSpecified(bool following);
189  virtual bool convoyTargetSpecified() const;
191 
194  virtual void setConvoyFollowTarget(const DtUUID&);
195 
197  virtual DtSimObjectReference convoyFollowTarget() const;
199 
201  virtual void setConvoyFollowDistance(const double dist);
202  virtual const double convoyFollowDistance() const;
204 
205  void setConvoyUseCatchUpSpeed(const bool useCatchUpSpeed);
206  const bool convoyUseCatchUpSpeed() const;
207 
208 
210  virtual const double maxFollowThreshold() const;
211  virtual void setMaxFollowThreshold(const double threshold);
213 
216  virtual bool useBreakdownLane() const;
217  virtual void setUseBreakdownLane(const bool bYes);
218 
219  virtual bool useOpposingLane() const;
220  virtual void setUseOpposingLane(const bool bYes);
222 
225  virtual void setUseTaskSpeed(const bool value);
226  virtual bool useTaskSpeed() const;
227 
228  virtual void setTaskSpeed(const double value);
229  virtual double taskSpeed() const;
231 
232 public:
233 
235  static DtVrfProcessStateRepository* creator (const DtString& rwName,
236  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
237 
238 protected:
239 
241 
245 
251 
257 
265 
269 
274 
278 
281 
285 
289 
293 
297 
301 
306 
311 
314 
317 
320 
323 
330 
336 
342 };
343 
344 
UUID is a unique ID wrapper class.
Definition: uuid.h:59
DtRailMovementState
Used to keep the current state of an entity as it travels along a route using the rail system...
Definition: railMovementControllerPSR.h:33
DtRwInt myCurrentMovementState
Definition: railMovementControllerPSR.h:240
Definition: railMovementControllerPSR.h:43
DtRwReal myLaneHeading
Useful for determining if the entity actual heading matches the road heading in the location it is su...
Definition: railMovementControllerPSR.h:273
DtRwBoolean myTurning
Keep track of whether we were in a turn or not. *** Not used in road movement controller; only in old...
Definition: railMovementControllerPSR.h:288
DtRwBoolean myAllowPassing
Were we passing *** Not used in road movement controller; only in old rail move controller. ***.
Definition: railMovementControllerPSR.h:292
Instances of DtRailMovementControllerPSR are used to hold the shared/checkpointable data for a rail m...
Definition: railMovementControllerPSR.h:48
DtRwSimObjectReference myConvoyFollowTarget
Keep track of who we&#39;re following if anybody. Used for convoys.
Definition: railMovementControllerPSR.h:316
Definition: railMovementControllerPSR.h:42
DtRwInt myPassingLanePosition
Lane number of lane we are moving to. *** Not used in road movement controller; only in old rail move...
Definition: railMovementControllerPSR.h:284
Definition: readerWriterRegistry.h:39
DtRwBoolean myUseTaskSpeed
Are we using speed from task message, or default ordered speed?
Definition: railMovementControllerPSR.h:340
Contains the DtUUID class declaration.
Definition: railMovementControllerPSR.h:38
DtRwBoolean myPassing
Were we passing *** Not used in road movement controller; only in old rail move controller. ***.
Definition: railMovementControllerPSR.h:296
Definition: railMovementControllerPSR.h:37
Definition: railMovementControllerPSR.h:41
Definition: railMovementControllerPSR.h:36
DtRwReal myPositionAlongLane
The current linear position along the segment in the current lane. This is the distance along the lan...
Definition: railMovementControllerPSR.h:256
Specialized reader/writer version of the shared object reference that will encapsulate the actual sha...
Definition: rwSimObjectReference.h:21
DtRwInt mySegmentIndex
Keep track of which segment we&#39;re on. This index corresponds to the order of rail segments...
Definition: railMovementControllerPSR.h:250
DtRwBoolean myUsingOpposingLane
Road passing options.
Definition: railMovementControllerPSR.h:334
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
DtRwReal mySpeedAlongLane
Since kinematics are based on the rail, and not on motion in space, we need speed and acceleration al...
Definition: railMovementControllerPSR.h:262
DtRwReal myConvoyFollowDistance
Keep track of how far behind convoy target we should follow.
Definition: railMovementControllerPSR.h:319
Description: Readable, Writable int.
Definition: rwInt.h:25
virtual DtVrfProcessStateRepository * clone(const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=0) const =0
DtRwBoolean myConvoyTargetSpecified
Quick check to know if we have target to follow.
Definition: railMovementControllerPSR.h:313
DtRwBoolean myNeedToSwitchLanes
Keep track if we need to switch lanes. This could be due to an upcoming turn, need to pass someone...
Definition: railMovementControllerPSR.h:305
DtRwBoolean myUseHighFidelityGroundClamping
Used by the rail updater when determining the orientation of the entity on the terrain.
Definition: railMovementControllerPSR.h:244
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
DtRwReal myTaskSpeed
Are we using speed from task message, or default ordered speed?
Definition: railMovementControllerPSR.h:339
Class DtVrfProcessStateRepository: Abstract base class for all process state repositories. Process state repositories represent (potentially) shared, savable information for one or more components functioning together to achieve some process or set of processes; such as aiming and firing a weapon; moving an object; or just waiting a specified amount of time.
Definition: vrfProcessStateRepository.h:45
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
DtRwBoolean myAvoidingCollision
*** Not used in road movement controller; only in old rail move controller. ***
Definition: railMovementControllerPSR.h:300
Definition: railMovementControllerPSR.h:44
DtRwInt myCurrentLanePosition
Current lane NUMBER. This is a 1-based lane number, with 1 on the outside.
Definition: railMovementControllerPSR.h:280
DtRwBoolean myConvoyUseCatchUpSpeed
*** Not used in road movement controller; only in old rail move controller. ***
Definition: railMovementControllerPSR.h:322
DtRwReal myMaxFollowThreshold
If entity is following another entity while moving along a rail route, this is the maximum delta they...
Definition: railMovementControllerPSR.h:329
Definition: railMovementControllerPSR.h:40
DtRwReal myLateralOffset
The current offset from the current lane centerline. Positive is to the right.
Definition: railMovementControllerPSR.h:268
DtRwReal myLaneChangeWidth
Indicates what the distance is between lane centerlines of the lanes the entity is between in a lane ...
Definition: railMovementControllerPSR.h:277
Definition: railMovementControllerPSR.h:39
DtRwReal myAccelerationAlongLane
Since kinematics are based on the rail, and not on motion in space, we need speed and acceleration al...
Definition: railMovementControllerPSR.h:263
virtual DtString type() const =0
Returns the string type of the repository, as defined in psrTypes.h.
DtRwBoolean myIsAcquiringLane
Indicates that the vehicle is off the normal lane track and is moving to get onto the road/lane...
Definition: railMovementControllerPSR.h:310
voidpf uLong offset
Definition: ioapi.h:42
Definition: railMovementControllerPSR.h:35
File: rwVector.h.
DtRwBoolean myUsingBreakdownLane
Road passing options.
Definition: railMovementControllerPSR.h:333
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
A locally simulated VRF object.
Definition: localObject.h:98

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)