![]() |
VR-Forces 4.0.4 Class Documentation
|
class DtKinematicStateCS: DtKinematicStateCS contains the current kinematic state of an object in one Cartesian coordinate system. More...

Public Types | |
| enum | DtSimOrientationType { BodyToLocal, BodyToBody, BodyToGeocentric } |
| enum | DtRotationConstraint { FixedRotation, RotateAboutX, RotateAboutY, RotateAboutZ, UnconstrainedRotation } |
Public Member Functions | |
| DtKinematicStateCS (DtSimOrientationType orientationType, const DtString &name=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=NULL) | |
| Constructor which optionally sets the object up for reading/writing. | |
| DtKinematicStateCS (DtSimOrientationType orientationType, const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL) | |
| DtKinematicStateCS (const DtKinematicStateCS &orig, const DtString &rwName=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=NULL) | |
| Copy Constructor. | |
| DtKinematicStateCS (const DtKinematicStateCS &orig, const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL) | |
| const DtKinematicStateCS & | operator= (const DtKinematicStateCS &orig) |
| Assignment operator. | |
| virtual | ~DtKinematicStateCS () |
| Destructor. | |
| virtual DtKinematicStateCS * | clone (const DtString &name=DtString::nullString(), DtReaderWriterRegistry *parentRegistry=NULL) const |
| Clone. | |
| virtual DtKinematicStateCS * | clone (const DtSymbolString &name, DtReaderWriterRegistry *parentRegistry=NULL) const |
| virtual const DtVector & | position () const |
| Get / set position in this coordinate system. | |
| virtual void | setPosition (const DtVector &position) |
| virtual const DtVector & | velocity () const |
| Get / set velocity in this coordinate system. | |
| virtual void | setVelocity (const DtVector &velocity, bool recomputeSpeed=true) |
| virtual DtReal | speed () const |
| You must set velocity, but you can access speed as well. | |
| virtual void | setSpeed (DtReal speed) |
| virtual const DtVector & | acceleration () const |
| Get / set acceleration in this coordinate system. | |
| virtual void | setAcceleration (const DtVector &acceleration) |
| virtual const DtTaitBryan & | orientation () const |
| Get / set orientation in this coordinate system. | |
| virtual void | setOrientation (const DtTaitBryan &orientation, DtRotationConstraint recomputeMatrix=RotateAboutX) |
| virtual const DtDcm & | orientationMatrix () const |
| Get / set orientation matrix in this coordinate system. | |
| virtual void | setOrientationMatrix (const DtDcm &orientationMatrix, bool recomputeEulers=true) |
| virtual DtSimOrientationType | orientationType () const |
| Get / set orientation type in this coordinate system. | |
| virtual void | setOrientationType (DtSimOrientationType orientationType) |
| virtual DtRotationConstraint | rotationConstraint () const |
| virtual void | setRotationConstraint (DtRotationConstraint contraint) |
| virtual void | setCoordinateSystem (const Coordinate_System *coordinateSystem) |
| virtual void | getSelf (DtlObjPtr args, const DtFilename &searchPath, const DtVariableBindingsList &variableBindings) |
| Overridden to initialize myRecomputeMatrix to true. | |
Protected Attributes | |
| DtRotationConstraint | myRecomputeMatrix |
| bool | myRecomputeEulers |
| bool | myRecomputeSpeed |
| DtRwVector | myPosition |
| DtRwVector | myVelocity |
| DtRwVector | myAcceleration |
| DtSimOrientationType | myOrientationType |
| DtRwTaitBryan | myOrientation |
| DtDcm | myOrientationMatrix |
| DtRotationConstraint | myCurrentRotationConstraint |
| DtReal | myCurrentSpeed |
| derived quantity; used so much, it's worth caching | |
| const Coordinate_System * | myCoordinateSystemPtr |
| DtRwTaitBryan | myTopoOrientation |
| Retained for backwards compatibility. | |
Private Member Functions | |
| DtKinematicStateCS () | |
| Default Constructor. Do not use. | |
class DtKinematicStateCS: DtKinematicStateCS contains the current kinematic state of an object in one Cartesian coordinate system.
It may be local (database) coordinates, network (geocentric) coordinates, or in the coordinate system of the object's parent object. Orientation (in Eulers) and Orientation Type together represent the same information as the OrientationMatrix; these values are linked so that if one is changed, the other will be converted the next time it is accessed.
Euler angles represent angles of rotation about another coordinate system, but this information is not enough to create a 3x3 rotation matrix. We need to support 3 types of orientation matrices, all of them pre-multiply: matrices that represent our body system wrt a local database system; matrices that represent one body system wrt to another; and matrices that represent our bodySystem wrt geocentric coordinates. Each DtKinematicStateCS in the the DtKinematicState object (see kinState.h) uses a different orientation type, and so needs different routines to go between Eulers and matrices (DtDcms).
Orientation may be constrained about a given axis, resulting in less expensive routines to go between Euler angles and matrices. This is used for articulating parts such as guns and turrets.
| DtKinematicStateCS::DtKinematicStateCS | ( | DtSimOrientationType | orientationType, |
| const DtString & | name = DtString::nullString(), |
||
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
Constructor which optionally sets the object up for reading/writing.
| DtKinematicStateCS::DtKinematicStateCS | ( | DtSimOrientationType | orientationType, |
| const DtSymbolString & | name, | ||
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
| DtKinematicStateCS::DtKinematicStateCS | ( | const DtKinematicStateCS & | orig, |
| const DtString & | rwName = DtString::nullString(), |
||
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
Copy Constructor.
| DtKinematicStateCS::DtKinematicStateCS | ( | const DtKinematicStateCS & | orig, |
| const DtSymbolString & | name, | ||
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) |
| virtual DtKinematicStateCS::~DtKinematicStateCS | ( | ) | [virtual] |
Destructor.
| DtKinematicStateCS::DtKinematicStateCS | ( | ) | [private] |
Default Constructor. Do not use.
| const DtKinematicStateCS& DtKinematicStateCS::operator= | ( | const DtKinematicStateCS & | orig | ) |
Assignment operator.
| virtual DtKinematicStateCS* DtKinematicStateCS::clone | ( | const DtString & | name = DtString::nullString(), |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) | const [virtual] |
Clone.
| virtual DtKinematicStateCS* DtKinematicStateCS::clone | ( | const DtSymbolString & | name, |
| DtReaderWriterRegistry * | parentRegistry = NULL |
||
| ) | const [virtual] |
| virtual const DtVector& DtKinematicStateCS::position | ( | ) | const [virtual] |
Get / set position in this coordinate system.
| virtual void DtKinematicStateCS::setPosition | ( | const DtVector & | position | ) | [virtual] |
| virtual const DtVector& DtKinematicStateCS::velocity | ( | ) | const [virtual] |
Get / set velocity in this coordinate system.
| virtual void DtKinematicStateCS::setVelocity | ( | const DtVector & | velocity, |
| bool | recomputeSpeed = true |
||
| ) | [virtual] |
| virtual DtReal DtKinematicStateCS::speed | ( | ) | const [virtual] |
You must set velocity, but you can access speed as well.
This is recomputed only as needed.
| virtual void DtKinematicStateCS::setSpeed | ( | DtReal | speed | ) | [virtual] |
| virtual const DtVector& DtKinematicStateCS::acceleration | ( | ) | const [virtual] |
Get / set acceleration in this coordinate system.
| virtual void DtKinematicStateCS::setAcceleration | ( | const DtVector & | acceleration | ) | [virtual] |
| virtual const DtTaitBryan& DtKinematicStateCS::orientation | ( | ) | const [virtual] |
Get / set orientation in this coordinate system.
| virtual void DtKinematicStateCS::setOrientation | ( | const DtTaitBryan & | orientation, |
| DtRotationConstraint | recomputeMatrix = RotateAboutX |
||
| ) | [virtual] |
| virtual const DtDcm& DtKinematicStateCS::orientationMatrix | ( | ) | const [virtual] |
Get / set orientation matrix in this coordinate system.
| virtual void DtKinematicStateCS::setOrientationMatrix | ( | const DtDcm & | orientationMatrix, |
| bool | recomputeEulers = true |
||
| ) | [virtual] |
| virtual DtSimOrientationType DtKinematicStateCS::orientationType | ( | ) | const [virtual] |
Get / set orientation type in this coordinate system.
| virtual void DtKinematicStateCS::setOrientationType | ( | DtSimOrientationType | orientationType | ) | [virtual] |
| virtual DtRotationConstraint DtKinematicStateCS::rotationConstraint | ( | ) | const [virtual] |
| virtual void DtKinematicStateCS::setRotationConstraint | ( | DtRotationConstraint | contraint | ) | [virtual] |
| virtual void DtKinematicStateCS::setCoordinateSystem | ( | const Coordinate_System * | coordinateSystem | ) | [virtual] |
| virtual void DtKinematicStateCS::getSelf | ( | DtlObjPtr | args, |
| const DtFilename & | searchPath, | ||
| const DtVariableBindingsList & | variableBindings | ||
| ) | [virtual] |
Overridden to initialize myRecomputeMatrix to true.
We only write out Tait-Bryan angles. So to force the rotation matrix to recomputed the next time it is requested, this flag must be true.
Also overridden to handle pre-3.5 oob files.
DtRotationConstraint DtKinematicStateCS::myRecomputeMatrix [mutable, protected] |
bool DtKinematicStateCS::myRecomputeEulers [mutable, protected] |
bool DtKinematicStateCS::myRecomputeSpeed [mutable, protected] |
DtRwVector DtKinematicStateCS::myPosition [protected] |
DtRwVector DtKinematicStateCS::myVelocity [protected] |
DtRwVector DtKinematicStateCS::myAcceleration [protected] |
DtRwTaitBryan DtKinematicStateCS::myOrientation [mutable, protected] |
DtDcm DtKinematicStateCS::myOrientationMatrix [mutable, protected] |
DtReal DtKinematicStateCS::myCurrentSpeed [mutable, protected] |
derived quantity; used so much, it's worth caching
const Coordinate_System* DtKinematicStateCS::myCoordinateSystemPtr [protected] |
DtRwTaitBryan DtKinematicStateCS::myTopoOrientation [protected] |
Retained for backwards compatibility.
Used in parsing pre-3.5 version oob files. Registered as "orientation", and contains topocentric Euler angles. Replaced by myOrientation, which is registered as "orientation-tait-bryan" in the oob file. It contains Euler angles with respect to database coordinates. Only used in getSelf(), in which it is used to initialize myOrientaiton.