20 #include <boost/signals2.hpp>
59 virtual void addAnimationChange(
int row,
int change,
const DtVector& vector,
const DtTaitBryan& orientation,
double timeDelta);
83 virtual void setTimeScale(
double d );
84 virtual double timeScale()
const;
90 virtual void setReferencePoint(
const DtVector&);
91 virtual DtVector referencePoint()
const;
97 virtual void setReferenceOrientation(
const DtTaitBryan&);
98 virtual DtTaitBryan referenceOrientation()
const;
106 virtual void setTarget(
const DtUUID&);
114 virtual void setForceAutomaticOrientation(
bool forceAuto);
115 virtual const bool forceAutomaticOrientation()
const;
121 virtual void setMoveOutHeading(
double);
122 virtual double moveOutHeading()
const;
127 virtual void setScriptedMovementFile(
const DtString&);
128 virtual const DtString& scriptedMovementFile()
const;
140 virtual void setClampType(
int);
141 virtual int clampType()
const;
151 virtual void setCompletionRule(
int);
152 virtual int completionRule()
const;
160 virtual void setSpeedNegated(
bool enable );
161 virtual bool isSpeedNegated()
const;
167 virtual void setFileConfiguration(
const DtString& );
168 virtual const DtString& fileConfiguration()
const;
173 virtual double calculateOrientation(
int frame,
double dt, DtTaitBryan&,
DtVector& rotationalVelocity)
const;
176 virtual DtVector calculateLocation(
int frameA,
int frameB = -1,
double timePastFrameA = 0)
const;
180 virtual void calculateSpeed(
int frame,
DtVector& velocity)
const;
183 virtual DtVector targetPosition()
const;
186 virtual DtVector localReferencePosition()
const;
189 virtual DtTaitBryan targetOrientation()
const;
195 virtual DtVector bodyOffsetVector(
int frame)
const;
198 virtual DtTaitBryan orientationOffset(
int frame)
const;
203 virtual bool groundClampHighFidelity(
const DtVector& location,
double heading, DtTaitBryan& newLocalOrienationTb,
DtVector& newLocalLocation)
const;
206 virtual DtVector velocityForFrame(
int frame)
const;
209 virtual DtVector calculateRotationalVelocity(
int frame,
double dt)
const;
212 virtual DtVector calculateRotationalVelocity(
const DtTaitBryan& currentFrame,
int frame)
const;
218 virtual DtTaitBryan orientationForFrame(
int frame,
double& heading)
const;
221 virtual bool canBeAnimated()
const;
225 virtual int animationRow(
double,
int frameHint = 0)
const;
228 virtual int animationRows()
const;
231 virtual double deltaTimeForFrame(
int frame)
const;
234 virtual void resetAnimationVariables();
237 virtual void reset();
240 virtual bool setupForAnimation();
243 virtual double simulationTime(
int)
const;
246 virtual void setFrameTime(
double);
250 virtual double frameTime()
const;
253 virtual void setAnimationFrame(
int);
254 virtual int animationFrame()
const;
257 virtual void setNeedsSetup(
bool);
258 virtual bool needsSetup()
const;
262 virtual bool simulate(
double simulateFor,
DtVector& newLocation, DtTaitBryan& newOrientation,
263 DtVector& newVelocity,
DtVector& newRotationalVelocity,
bool debug =
false);
266 virtual void setElapsedAnimationTime(
double);
267 virtual double elapsedAnimationTime()
const;
271 virtual void setTransitionSpeed(
double);
272 virtual double transitionSpeed()
const;
279 virtual int setObjectOffsetLocation(
int row,
const DtVector&);
283 virtual int setObjectOffsetOrientation(
int row,
const DtTaitBryan&);
286 virtual void setTimeDeltaFromPreviousRow(
int forRow,
double timeDelta);
292 virtual int addAnimationRow(
double deltaTime,
double lateral,
double range,
double altitude,
293 double headingOffset = 0,
double pitchOffset = 0,
double rollOffset = 0);
296 virtual void removeRow(
int);
305 virtual int frameToTravelSpeed(
int base,
double speed)
const;
308 virtual double lastSimulationTime()
const;
311 virtual bool isFinished()
const;
317 void createDeadReckoner();
319 virtual void processObjectAboutToBeRemoved(
const DtSimObject*);
322 virtual void putSelf(std::string& fp,
int indentLevel,
bool writeUnspecified,
323 const DtFilename& path);
330 virtual void initializeReferenceObject();
333 virtual int nextFrameToMaintainSpeed(
int frame,
double speed)
const;
336 virtual void deadReckon(
double overTime,
DtVector& newWorldLocation,
337 DtTaitBryan& newLocalOrientation,
DtVector& newVelocity,
338 DtVector& newRotationalVelocity)
const;
346 vector(orig.vector), orientation(orig.orientation), timeDelta(orig.timeDelta) {};
UUID is a unique ID wrapper class.
Definition: rwUUID.h:229
DtRwTaitBryan myOrientation
Definition: animationModel.h:47
DtRwInt myCompletionRule
Definition: animationModel.h:377
DtLocalObject * myEntity
Definition: animationModel.h:368
virtual const char * readerWriterType() const
Used to supply a string type that this reader writer type is. This can be used in place of dynamic-ca...
std::map< int, LocalAnimationChange > AnimationChanges
Map, by row, of changes to the animation file. When read back in will be applied to the movement file...
Definition: animationModel.h:390
AnimationChanges myAnimationChanges
Definition: animationModel.h:391
DtRwVector myVector
Definition: animationModel.h:46
DtRwInt myClampType
Definition: animationModel.h:376
DtRwString myScriptedMovementFile
Definition: animationModel.h:375
DtVector myLastRelativeVelocity
Definition: animationModel.h:396
DtVector myLastVelocity
Definition: animationModel.h:397
A Readable, Writable version of DtList. This class cannot be used directly, but must be inherited to ...
Definition: rwList.h:26
DtRwInt myRow
Definition: animationModel.h:44
DtDeadReckoner * myDeadReckoner
Definition: animationModel.h:405
DtRwBoolean myForceAutomaticOrientation
Definition: animationModel.h:386
DtRwReal myTimeScale
Definition: animationModel.h:370
DtVector myLastRotationalVelocity
Definition: animationModel.h:395
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
Definition: readerWriter.h:85
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
LocalAnimationChange()
Definition: animationModel.h:344
Description: Readable, Writable DtTaitBryan.
Definition: rwTaitBryan.h:20
Definition: readerWriterRegistry.h:39
DtRwBoolean mySpeedNegatedFlag
Definition: animationModel.h:378
DtRwReal myTimeDelta
Definition: animationModel.h:48
Definition: animationModel.h:52
DtTaitBryan myOriginalOrientation
Definition: animationModel.h:400
double timeDelta
Definition: animationModel.h:361
DtRwTaitBryan myReferenceOrientation
Definition: animationModel.h:372
DtMovementLocalObjectFacade * myMovementLocalObjectFacade
Definition: animationModel.h:409
This class will load in and return data from a movement file.
Definition: movementFile.h:273
Contains the DtRwTaitBryan class declaration.
Definition: rwVector.h:23
virtual void reset()
For those reader/writer items that support it, resets the reader/writer value to original state Defau...
Specialized reader/writer version of the shared object reference that will encapsulate the actual sha...
Definition: simObjectReference.h:74
Definition: animationModel.h:342
DtRwSimObjectReference myTarget
Definition: animationModel.h:373
#define DT_DLL_vrfobjcore
This file is used to determine how to build.
Definition: vrfobjcoreDefines.h:24
std::list< const DtRwVariableBindings * > DtVariableBindingsList
Definition: readerWriterRegistry.h:29
DtRwVector myReferencePoint
Definition: animationModel.h:371
DtVector myLastLocation
Definition: animationModel.h:394
Description: Readable, Writable int.
Definition: rwInt.h:25
virtual ~LocalAnimationChange()
Definition: animationModel.h:347
std::vector< DtFilename > SearchPaths
Definition: readerWriter.h:92
bool myIsEmbarked
Definition: animationModel.h:407
Definition: animationModel.h:34
DtTaitBryan myLastOrientation
Definition: animationModel.h:393
DtRwInt myChange
Definition: animationModel.h:45
DtRwBoolean myLastFrameWasAnimated
Definition: animationModel.h:382
DtRwReal myElapsedAnimationTime
Definition: animationModel.h:384
virtual void getSelf(DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference())
Top level to read itself from an input stream. searchPath is passed down to all DtReaderWriter member...
virtual void putSelf(std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename())
Top level call to write itself to file. If write unspecified is true, will write entries that are uns...
The DtAnimationModel class will contain the interface allow for animated movement via an external fil...
Definition: animationModel.h:30
boost::signals2::scoped_connection myDeleteObjectConnection
Definition: animationModel.h:408
DtRwBoolean myNeedsSetup
Definition: animationModel.h:403
Description: Readable, Writable DtReal (double)
Definition: rwReal.h:27
DtRwString myFileConfiguration
Definition: animationModel.h:379
DtMovementFile myMovementFile
Definition: animationModel.h:366
DtRwReal myFrameTime
Definition: animationModel.h:380
DtRwInt myAnimationFrame
Definition: animationModel.h:381
double myLastSimulationTime
Definition: animationModel.h:402
Represents a single simulation object in the exercise. Object may be VRF simulation, or non-VRF simulated, and may be simulated by the local sim engine, or by a remote sim engine. Only public (external) state of the object is available. All data is read-only. All access to data of the object is thread safe within the simulation frame.
Definition: simObject.h:79
DtRwReal myMoveOutHeading
Definition: animationModel.h:374
Description: Readable, Writable bool.
Definition: rwBoolean.h:26
DtVector myOriginalLocation
Definition: animationModel.h:399
LocalAnimationChange(const LocalAnimationChange &orig)
Definition: animationModel.h:345
const DtReaderWriter & operator=(const DtReaderWriter &orig)
assignment operator
DtVector vector
Vector in body coordinates.
Definition: animationModel.h:356
DtTaitBryan orientation
Orientation in topographic change from reference orientation.
Definition: animationModel.h:359
DtRwReal myLastAnimationFrameTime
Definition: animationModel.h:385
DtRwReal myTransitionSpeed
Definition: animationModel.h:383
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