![]() |
VR-Forces Developer's Guide
|
Represents the kinematic state of an object in the simulation. This can be any object on the network. The class encapsulates the kinematic state of an object wrt to the network (geocentric) coordinate systems, as well as wrt its own parent for embarked objects and attached objects such as launchers.
There is a SimKinematicState in both the current frame and the next frame for the entity. The DtEntityLocationStateComponentCurrentFrame and NextFrame classes define wrapper functions for many functions in this kinematic state class; however, the current frame component does not provide access to the set functions. Only the Next Frame state component can be changed. Generally, the accessor functions below are used in the current frame component, and the mutator functions are used in the next frame component.
At the end of each frame, or when the current frame needs to be refreshed, the kinematic state is validated (see validateState() and related functions). This means that kinematic values are updated if they depend on other values that have changed. For example, if an entity is embarked on a parent object–which may have moved– then the entity's world position etc. must be recalculated from the parent's position. The calculations can be done in the accessor functions below. Normally, in the current frame kinematic state, the myFrozen flag is true, which means that the accessors simply return stored values. However, during validation, the myFrozen flag is false, which means that the accessors can perform calculations and store the results for later access. See DtEntityLocationStateComponentCurrentFrame::refreshKinematicState().

Public Member Functions | |
| DtRwSimKinematicState () | |
| DtRwSimKinematicState (const DtRwSimKinematicState &orig) | |
| DtRwSimKinematicState (const DtString &name, DtReaderWriterRegistry *parentRegistry=nullptr) | |
| DtRwSimKinematicState (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=nullptr) | |
| DtRwSimKinematicState (const DtRwSimKinematicState &orig, const DtString &name, DtReaderWriterRegistry *parentRegistry=nullptr) | |
| DtRwSimKinematicState (const DtRwSimKinematicState &orig, const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=nullptr) | |
| const DtRwSimKinematicState & | operator= (const DtRwSimKinematicState &orig) |
| virtual | ~DtRwSimKinematicState () override |
| virtual DtRwSimKinematicState * | clone (const DtString &name=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=nullptr) const |
| virtual DtRwSimKinematicState * | clone (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=nullptr) const |
| bool | operator== (const DtRwSimKinematicState &orig) const |
| bool | operator!= (const DtRwSimKinematicState &orig) const |
| virtual void | putSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtReaderWriter::appPath()) override |
World Kinematic State | |
The motion state in geocentric coordinates. Also referred to as "world", "DIS", or "network" coordinates. See documentation above for information on how the get/set functions are generally used. Returns the position in geocentric (world) coordinates. | |
| virtual const DtVector & | worldPosition (bool debug=false) const |
| virtual void | setWorldPosition (const DtVector &position, bool debug=false) |
| virtual const DtVector & | setWorldPositionFromParent (bool debug=false) |
| virtual const DtVector & | worldVelocity (bool debug=false) const |
| virtual void | setWorldVelocity (const DtVector &velocity, bool recomputeSpeed=true, bool debug=false) |
| virtual DtReal | worldSpeed () const |
| virtual const DtVector & | worldAcceleration () const |
| virtual void | setWorldAcceleration (const DtVector &acceleration) |
| virtual const DtTaitBryan & | worldOrientation () const |
| virtual void | setWorldOrientation (const DtTaitBryan &orientation, DtKinematicStateCS::DtRotationConstraint recomputeMatrix=DtKinematicStateCS::RotateAboutX) |
| virtual void | setWorldOrientationFromParent () |
| virtual const DtDcm & | worldOrientationMatrix () const |
| virtual void | setWorldOrientationMatrix (const DtDcm &orientationMatrix, bool recomputeEulers=true) |
| DtCoordSysValidationVector & | worldVV () |
| const DtCoordSysValidationVector & | worldVV () const |
| virtual const DtKinematicStateCS & | worldKinematicState () const |
| virtual DtKinematicStateCS & | worldKinematicState () |
| virtual void | setWorldKinematicState (const DtKinematicStateCS &worldKinematicState) |
Parent Kinematic State | |
The motion state relative to the parent, in parent (body) coordinates. See documentation above for information on how the get/set functions are generally used. Returns the position relative to the parent in parent (body) coordinates. | |
| virtual const DtVector & | parentPosition () const |
| virtual void | setParentPosition (const DtVector &position, bool debug=false) |
| virtual const DtVector & | parentVelocity () const |
| virtual DtReal | parentSpeed () const |
| virtual void | setParentVelocity (const DtVector &velocity, bool recomputeSpeed=true, bool debug=false) |
| virtual const DtVector & | parentAcceleration () const |
| virtual void | setParentAcceleration (const DtVector &acceleration) |
| virtual const DtTaitBryan & | parentOrientation () const |
| virtual void | setParentOrientation (const DtTaitBryan &orientation, DtKinematicStateCS::DtRotationConstraint recomputeMatrix=DtKinematicStateCS::RotateAboutX) |
| virtual const DtDcm & | parentOrientationMatrix () const |
| virtual void | setParentOrientationMatrix (const DtDcm &orientationMatrix, bool recomputeEulers=true) |
| DtCoordSysValidationVector & | parentVV () |
| const DtCoordSysValidationVector & | parentVV () const |
| virtual const DtKinematicStateCS & | parentKinematicState () const |
| virtual DtKinematicStateCS & | parentKinematicState () |
| virtual void | setParentKinematicState (const DtKinematicStateCS &parentKinematicState) |
Body Kinematic State | |
Returns the velocity expressed in the entity's own body coordinate system. | |
| virtual DtVector | bodyVelocity () const |
| virtual const DtVector & | rotationalVelocity () const |
| virtual void | setRotationalVelocity (const DtVector &rotationalVelocity) |
| virtual DtKinematicStateCS::DtRotationConstraint | rotationConstraint () const |
| virtual void | setRotationConstraint (DtKinematicStateCS::DtRotationConstraint constraint) |
| virtual DtKinematicStateCS::DtSimOrientationType | orientationType () const |
| virtual void | setOrientationType (DtKinematicStateCS::DtSimOrientationType orientationType) |
Topographic State | |
Accessors for orientation in a topographic coordinate system centered at the entity's position. Returns the orientation as Tait-Bryan angles in a topographic coordinate system centered at the entity's position. | |
| virtual const DtTaitBryan & | topoEuler () const |
| virtual double | heading () const |
| virtual double | pitch () const |
| virtual double | roll () const |
Validation Functions | |
Validates all values (if they are invalid) including world and parent | |
| virtual void | validateParentState () |
| virtual void | validateWorldState () |
| virtual void | invalidateState () |
| virtual void | validateState () |
| void | setFrozen (bool b) |
| bool | frozen () const |
Attachment to a Parent Object | |
These function concern the attachment of this object to a parent object (attachment or embarkation). | |
| virtual void | setObjectAttachMode (int m) |
| int | objectAttachMode () const |
| virtual void | setAttachedTo (const DtStateData *stateData, const DtUUID &uuid) |
| const DtStateData * | attachedTo () const |
| const DtUUID & | attachedToUUID () const |
| bool | isAttachedTo () const |
| virtual void | detach () |
| virtual void | attach () |
| virtual const DtLocationStateComponent * | attachedLocationStateComponent () const |
| virtual const DtEntityLocationStateComponent * | attachedEntityLocationStateComponent () const |
Public Member Functions inherited from DtReaderWriter | |
| DtReaderWriter () | |
| DtReaderWriter (const DtString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| DtReaderWriter (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL, bool readonly=false) | |
| DtReaderWriter (const DtString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtReaderWriter (const DtSymbolString &name, const DtReaderWriter &orig, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtReaderWriter (const DtReaderWriter &, DtReaderWriterRegistry *parentRegistry=NULL) | |
| const DtReaderWriter & | operator= (const DtReaderWriter &orig) |
| bool | operator== (const DtReaderWriter &) const |
| bool | operator!= (const DtReaderWriter &rhs) const |
| virtual | ~DtReaderWriter () |
| virtual void | postPutSelf () |
| virtual void | prePutSelf () |
| virtual void | getSelf (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference()) |
| virtual void | preGetSelf () |
| virtual void | writeSelf (std::string &fp, int indentLevel=0, bool writeUnspecified=false, const DtFilename &path=DtFilename::nullFilename()) |
| virtual DtSymbolString | name () const |
| virtual void | addAlias (const DtSymbolString &alias) |
| virtual void | addAlias (const DtString &alias) |
| virtual bool | hasAlias (const DtSymbolString &alias) |
| virtual const aliasContainer & | aliases () const |
| virtual void | setReadonly (bool flag) |
| bool | isReadonly () const |
| virtual void | reset () |
| virtual int | alignment () const |
| virtual bool | variableIsBound () const |
| virtual void | unbindVariable () |
| virtual void | setName (const DtString &) |
| virtual const char * | readerWriterType () const |
| virtual const char * | xmlType () const |
| virtual DtString | prettyPrint () const |
| std::string | debugText () const |
| virtual void | bindVariables (DtVariableBindingsList variableBindings) |
| virtual std::list < DtVariableNameType > | unboundVariables () const |
| bool | invalid () const |
| virtual bool | hasChild (const DtReaderWriter *p) const |
| virtual bool | hasVariableReference () const |
| virtual void | bindLocalVariables (const DtVariableBindingsList &variableBindings) |
| virtual void | recordUpdateTime () const |
| virtual bool | changedSinceLastChecked () |
| virtual bool | peekChangedSinceLastChecked () const |
| virtual void | putData (std::string &fp, int indentLevel=0) |
| virtual DtlObjPtr | getData (DtlObjPtr args, const SearchPaths &searchPaths, const DtVariableBindingsList &variableBindings) |
| virtual void | setValueSpecified (bool specified, bool recurse=false) |
| virtual bool | valueSpecified () const |
| virtual bool | isVariableReference () const |
| virtual void | setIsVariableReference (bool value) |
| virtual void | clearAllVariableReferenceFlags () |
| virtual DtSymbolString | variableName () const |
| virtual void | setVariableName (const DtSymbolString variableName) |
| virtual const DtReaderWriter * | defaultRWValue () const |
| virtual DtReaderWriter * | defaultRWValue () |
| virtual void | setDefaultRWValue (DtReaderWriter *) |
| virtual bool | checkAndSetDefaultRWValue (DtlObjPtr args, const DtReaderWriter::SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &variableBindings=nullVariableReference()) |
| const DtReaderWriterRegistry & | registry () const |
| DtReaderWriterRegistry & | registry () |
| virtual DtPropertyInterface * | property () |
| virtual const DtPropertyInterface * | property () const |
| virtual DtString | toXml () const |
| virtual DtRwVariableBindings * | generateVariableBindings () const |
| virtual bool | toXml (const DtFilename &) const |
| virtual bool | fromXml (const DtString &) |
| virtual bool | fromXmlFile (const DtFilename &) |
| virtual void | putSelf (DtEnvironmentSP, DtEnvValueSP parent) const |
| virtual void | putData (DtEnvironmentSP, DtEnvValueSP value) const |
| virtual void | putVariableReference (DtEnvironmentSP, DtEnvValueSP value) const |
| virtual void | getSelf (const DtEnvironmentSP, const DtEnvValueSP root, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList()) |
| virtual void | getData (const DtEnvironmentSP, const DtEnvValueSP, const SearchPaths &searchPaths=SearchPaths(), const DtVariableBindingsList &bindings=DtVariableBindingsList()) |
| virtual void | unrecognizedItem (const DtEnvironmentSP env, const DtEnvValueSP root, const SearchPaths &searchPaths, const DtVariableBindingsList &varBindings) |
| virtual void | getVariableReference (DtEnvironmentSP, DtEnvValueSP value) |
Protected Member Functions | |
| virtual void | postGetSelf () override |
Protected Member Functions inherited from DtReaderWriter | |
| virtual void | bindToRwAsVariable (const DtReaderWriter *rw) |
| makVrf::DtRwSimKinematicState::DtRwSimKinematicState | ( | ) |
This constructor will not add any elements to the registry. Use this for calculation only.
| makVrf::DtRwSimKinematicState::DtRwSimKinematicState | ( | const DtRwSimKinematicState & | orig | ) |
Copy constructor. Does not register elements in a registry.
| makVrf::DtRwSimKinematicState::DtRwSimKinematicState | ( | const DtString & | name, |
| DtReaderWriterRegistry * | parentRegistry = nullptr |
||
| ) |
Constructor.
| makVrf::DtRwSimKinematicState::DtRwSimKinematicState | ( | const DtSymbolString & | name, |
| DtReaderWriterRegistry * | parentRegistry = nullptr |
||
| ) |
Constructor.
| makVrf::DtRwSimKinematicState::DtRwSimKinematicState | ( | const DtRwSimKinematicState & | orig, |
| const DtString & | name, | ||
| DtReaderWriterRegistry * | parentRegistry = nullptr |
||
| ) |
Copy Constructor.
| makVrf::DtRwSimKinematicState::DtRwSimKinematicState | ( | const DtRwSimKinematicState & | orig, |
| const DtSymbolString & | name, | ||
| DtReaderWriterRegistry * | parentRegistry = nullptr |
||
| ) |
Copy Constructor.
|
overridevirtual |
Destructor.
| const DtRwSimKinematicState& makVrf::DtRwSimKinematicState::operator= | ( | const DtRwSimKinematicState & | orig | ) |
Assignment Operator.
|
virtual |
Clone.
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Clone.
| bool makVrf::DtRwSimKinematicState::operator== | ( | const DtRwSimKinematicState & | orig | ) | const |
Equality comparison.
|
inline |
Inequality comparison.
|
virtual |
Sets the position in geocentric (world) coordinates.
| position | New world position vector. |
| debug | If true, emit diagnostic output. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Sets the position in geocentric (world) coordinates.
| position | New world position vector. |
| debug | If true, emit diagnostic output. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Update the world position from the parent's position. Used in worldPosition() when the world position is invalid.
|
virtual |
Returns the velocity in geocentric (world) coordinates.
|
virtual |
Sets the velocity in geocentric (world) coordinates.
| velocity | New world velocity vector. |
| recomputeSpeed | If true, update the cached world speed. |
| debug | If true, emit diagnostic output. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Returns the scalar speed derived from the world velocity vector.
|
virtual |
Returns the acceleration in geocentric (world) coordinates.
|
virtual |
Sets the acceleration in geocentric (world) coordinates.
| acceleration | New world acceleration vector. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Returns the orientation as Tait-Bryan (Euler) angles in world coordinates.
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Sets the orientation as Tait-Bryan angles in world coordinates.
| orientation | New world orientation angles. |
| recomputeMatrix | Controls which rotation axis is used when recomputing the DCM. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Update the world orientation from the parent's orientation. Used in worldOrientation() when the world orientation is invalid.
|
virtual |
Returns the orientation as a direction cosine matrix in world coordinates.
|
virtual |
Sets the orientation DCM in world coordinates.
| orientationMatrix | New orientation matrix. |
| recomputeEulers | If true, recompute Tait-Bryan angles from the new matrix. |
Reimplemented in makVrf::DtRwVrfKinematicState.
| DtCoordSysValidationVector& makVrf::DtRwSimKinematicState::worldVV | ( | ) |
Used to allow lazy calculation of related elements.
| const DtCoordSysValidationVector& makVrf::DtRwSimKinematicState::worldVV | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Get / set kinematic state in world coords. I don't expect the set version to be used, but it's included for completeness.
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Sets the full kinematic state in world (geocentric) coordinates.
| worldKinematicState | New world kinematic state. |
|
virtual |
Sets the position relative to the parent in parent (body) coordinates.
| position | New parent-relative position. |
| debug | If true, emit diagnostic output. |
|
virtual |
Sets the position relative to the parent in parent (body) coordinates.
| position | New parent-relative position. |
| debug | If true, emit diagnostic output. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Returns the velocity relative to the parent in parent (body) coordinates.
|
virtual |
Returns the scalar speed derived from the parent velocity vector.
|
virtual |
Sets the velocity relative to the parent in parent (body) coordinates.
| velocity | New parent-relative velocity. |
| recomputeSpeed | If true, update the cached parent speed. |
| debug | If true, emit diagnostic output. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Returns the acceleration relative to the parent in parent (body) coordinates.
|
virtual |
Sets the acceleration relative to the parent in parent (body) coordinates.
| acceleration | New parent-relative acceleration. |
|
virtual |
Returns the orientation as Tait-Bryan angles relative to the parent.
|
virtual |
Sets the orientation as Tait-Bryan angles relative to the parent.
| orientation | New parent-relative orientation. |
| recomputeMatrix | Controls which rotation axis is used when recomputing the DCM. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Returns the orientation as a direction cosine matrix relative to the parent.
|
virtual |
Sets the orientation DCM relative to the parent.
| orientationMatrix | New orientation matrix. |
| recomputeEulers | If true, recompute Tait-Bryan angles from the new matrix. |
| DtCoordSysValidationVector& makVrf::DtRwSimKinematicState::parentVV | ( | ) |
Used to allow lazy calculation of related elements.
| const DtCoordSysValidationVector& makVrf::DtRwSimKinematicState::parentVV | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Get / set kinematic state in parent coords. I don't expect the set version to be used, but it's included for completeness.
|
virtual |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
virtual |
Sets the full kinematic state in parent (body) coordinates.
| parentKinematicState | New parent kinematic state. |
|
virtual |
Returns the rotational (angular) velocity vector.
|
virtual |
Returns the rotational (angular) velocity vector.
|
virtual |
Sets the rotational (angular) velocity vector.
| rotationalVelocity | New rotational velocity. |
|
virtual |
Returns the rotation constraint used when converting between orientation representations.
|
virtual |
Sets the rotation constraint used when converting between orientation representations.
| constraint | New rotation constraint value. |
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Wrapper for DtKinematicStateCS functions.
|
virtual |
Returns the rotational (angular) velocity vector.
|
virtual |
Returns the heading (yaw) angle in the topographic coordinate system (radians).
|
virtual |
Returns the heading (yaw) angle in the topographic coordinate system (radians).
|
virtual |
Returns the pitch angle in the topographic coordinate system (radians).
|
virtual |
Returns the roll angle in the topographic coordinate system (radians).
|
virtual |
Calls the parent KS accessors to update any invalid values.
|
virtual |
Calls the world KS accessors to update any invalid values.
|
virtual |
Sets all values as invalid via myParentVV and myWorldVV.
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Calls validateParentState() and validateWorldState()
Reimplemented in makVrf::DtRwVrfKinematicState.
|
inline |
These set or test myFrozen; see myFrozen. When true, the kinematic state elements are not recalculated and updated in the accessor functions.
|
inline |
These set or test myFrozen; see myFrozen. When true, the kinematic state elements are not recalculated and updated in the accessor functions.
|
virtual |
When setting an attached object and mode, the mode must be set before the attachment, else internal structures will calcualte new body and world vertices with current attach mode, which could cause differences in point position for multi point objects.
|
inline |
Returns the current object attachment mode.
|
virtual |
Sets the parent state data and UUID to attach this object to. The attach mode must be set via setObjectAttachMode() before calling this.
| stateData | Pointer to the parent state data. |
| uuid | UUID of the parent entity. |
|
inline |
Returns a pointer to the state data of the parent object, or nullptr if not attached.
|
inline |
Returns the UUID of the parent entity this object is attached to.
| bool makVrf::DtRwSimKinematicState::isAttachedTo | ( | ) | const |
Returns true if this object is currently attached to a parent object.
|
virtual |
Detaches this object from its parent, clearing attachment state.
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
Re-establishes the attachment signal connection with the current parent, if any.
Reimplemented in makVrf::DtRwVrfKinematicState.
|
virtual |
The location state component of the object to which this object is attached (i.e., the parent object), or nullptr if not attached.
|
virtual |
Returns the entity location state component of the parent object, or nullptr if not attached or the parent does not have an entity location component.
|
overridevirtual |
Override to check for invalid parent and world state date before writing self to file. Updates position and orientation as needed and then call base class putSelf().
Reimplemented from DtReaderWriter.
|
overrideprotectedvirtual |
Called after reading state from file to perform any post-load fixups.
Reimplemented from DtReaderWriter.
Reimplemented in makVrf::DtRwVrfKinematicState.
|
protected |
Position, velocity, acceleration, orientation (Euler and DCM), and rotational velocity in parent's coordinate system. Velocity and acceleration are relative to parent velocity and acceleration.
|
protected |
Position, velocity, acceleration, orientation (Euler and DCM), and rotational velocity in geocentric coordinate system.
|
protected |
|
protected |
Validation vector tracking which world-coordinate kinematic values are current.
|
protected |
this is the rate at which the object is rolling, pitching and yawing
|
protected |
The object attach mode:
|
protected |
|
protected |
UUID of the entity this object is attached to.
|
mutableprotected |
Location component of the parent object.
|
mutableprotected |
|
mutableprotected |
|
protected |
Cached Tait-Bryan orientation in the topographic coordinate system.
|
protected |
True when myTopoEuler must be recomputed before use.
|
protected |
Boost.Signals2 connection used to listen for parent state-data destruction.
|
protected |
This flag indicates that the elements of the kinematic state should not be updated. This is used (set to true) in the current frame kinematic state, which is part of the current frame entityLocationStateComponent. That state component also does not define set functions for its kinematic state. The current frame KS can only be changed in DtEntityLocationStateComponent::refreshKinematicState, where myFrozen is temporarily set false before being set true again for the rest of VRF operations.