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();
64 
67 
70  const DtString& rwName = DtString::nullString(),
71  DtReaderWriterRegistry* parentRegistry = 0) const;
72 
75  virtual DtString type() const;
76 
77  virtual void setCurrentMovementState(DtRailMovementState state);
78  virtual DtRailMovementState currentMovementState() const;
79 
90  virtual void setUseHighFidelityGroundClamping(bool yesOrNo);
91  virtual bool useHighFidelityGroundClamping() const;
93 
96  virtual void resetSegmentIndex();
97  virtual void incrementSegmentIndex();
98  virtual const int segmentIndex() const;
99  virtual void setSegmentIndex(const int);
101 
105  virtual double positionAlongLane() const;
106  virtual void setPositionAlongLane(const double p);
108 
111  virtual double speedAlongLane() const;
112  virtual void setSpeedAlongLane(const double s);
114 
117  virtual double accelerationAlongLane()const;
118  virtual void setAccelerationAlongLane(const double a);
120 
126  virtual double offsetFromLaneCenterline() const;
127  virtual void setOffsetFromLaneCenterline(const double offset);
128 
132  virtual double laneChangeWidth() const;
133  virtual void setLaneChangeWidth(const double f);
134 
139  virtual void setCurrentLanePosition(const int lane);
140  virtual const int currentLanePosition() const;
141 
143  virtual void setCurrentLaneNumber(const int lane);
144  virtual const int currentLaneNumber() const;
146 
151  virtual void setPassingLanePosition(const int lane);
152 
153  virtual const int passingLanePosition() const;
155 
157  virtual void setTurning(bool turn);
158  virtual bool turning() const;
160 
162  virtual void setAllowPassing(bool canPass);
163  virtual bool allowPassing() const;
165 
167  virtual void setPassing(bool pass);
168  virtual bool passing() const;
170 
172  virtual void setAvoidingCollision(bool avoid);
173  virtual bool avoidingCollision() const;
175 
177  virtual void setNeedSwitchLanes(bool switchLane);
178  virtual bool needSwitchLanes() const;
180 
182  virtual void setConvoyTargetSpecified(bool following);
183  virtual bool convoyTargetSpecified() const;
185 
188  virtual void setConvoyFollowTarget(const DtUUID&);
189 
191  virtual DtSimObjectReference convoyFollowTarget() const;
193 
195  virtual void setConvoyFollowDistance(const double dist);
196  virtual const double convoyFollowDistance() const;
198 
199  void setConvoyUseCatchUpSpeed(const bool useCatchUpSpeed);
200  const bool convoyUseCatchUpSpeed() const;
201 
202 
204  virtual const double maxFollowThreshold() const;
205  virtual void setMaxFollowThreshold(const double threshold);
207 
210  virtual bool useBreakdownLane() const;
211  virtual void setUseBreakdownLane(const bool bYes);
212 
213  virtual bool useOpposingLane() const;
214  virtual void setUseOpposingLane(const bool bYes);
216 
217 public:
218 
220  static DtVrfProcessStateRepository* creator (const DtString& rwName,
221  DtLocalObject* vrfObject, DtReaderWriterRegistry* parentRegistry);
222 
223 protected:
224 
226 
230 
236 
242 
250 
254 
258 
261 
265 
269 
273 
277 
281 
286 
289 
292 
295 
298 
305 
311 };
312 
313 
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:225
Definition: railMovementControllerPSR.h:43
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:268
DtRwBoolean myAllowPassing
Were we passing *** Not used in road movement controller; only in old rail move controller. ***.
Definition: railMovementControllerPSR.h:272
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:291
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
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:264
Definition: readerWriterRegistry.h:39
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:276
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:241
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:235
DtRwBoolean myUsingOpposingLane
Road Driving Options.
Definition: railMovementControllerPSR.h:309
#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:247
DtRwReal myConvoyFollowDistance
Keep track of how far behind convoy target we should follow.
Definition: railMovementControllerPSR.h:294
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:288
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:285
DtRwBoolean myUseHighFidelityGroundClamping
Used by the rail updater when determining the orientation of the entity on the terrain.
Definition: railMovementControllerPSR.h:229
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
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:280
Definition: railMovementControllerPSR.h:44
DtRwInt myCurrentLanePosition
Current lane number.
Definition: railMovementControllerPSR.h:260
DtRwBoolean myConvoyUseCatchUpSpeed
*** Not used in road movement controller; only in old rail move controller. ***
Definition: railMovementControllerPSR.h:297
DtRwReal myMaxFollowThreshold
If entity is following another entity while moving along a rail route, this is the maximum delta they...
Definition: railMovementControllerPSR.h:304
Definition: railMovementControllerPSR.h:40
DtRwReal myLateralOffset
The current offset from the current lane centerline. Positive is to the right.
Definition: railMovementControllerPSR.h:253
DtRwReal myLaneChangeWidth
Indicates what the distance is between lane centerlines of the lanes the entity is between in a lane ...
Definition: railMovementControllerPSR.h:257
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:248
virtual DtString type() const =0
Returns the string type of the repository, as defined in procSRTypes.h.
voidpf uLong offset
Definition: ioapi.h:42
Definition: railMovementControllerPSR.h:35
File: rwVector.h.
DtRwBoolean myUsingBreakdownLane
Road Driving Options.
Definition: railMovementControllerPSR.h:308
const DtVrfProcessStateRepository & operator=(const DtVrfProcessStateRepository &orig)
A locally simulated VRF object. Holds all internal and external data for the object, and provides access to both the current frame and next frame state data for the object. All current frame data is read-only, and next-frame data can be written to. No thread safety guarantees are made on this object during the simulation frame and it should only be accessed by the thread that is simulating the object.
Definition: localObject.h:86

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)