Class SBDTypeSpatialTransform#
ClassList > SBDTypeSpatialTransform
This class describes spatial transforms. More...
#include "SBDTypeSpatialTransform.hpp"
Inherited by the following classes: SBDTypeSymmetryTransform
Public Attributes#
| Type | Name |
|---|---|
| SBMatrix33 * | orientation The pointer to the orientation of the spatial transform. |
| SBPosition3 * | position The pointer to the position of the spatial transform. |
| SBVector3 * | scale The pointer to the scale of the spatial transform. |
Public Static Attributes#
| Type | Name |
|---|---|
| const SBDTypeSpatialTransform | identity The identity spatial transform. |
| const SBDTypeSpatialTransform | zero The zero spatial transform. |
Public Functions#
| Type | Name |
|---|---|
| SBDTypeSpatialTransform () Constructs an identity transform. |
|
| SBDTypeSpatialTransform (const SBDTypeSpatialTransform & transform) Copy constructor. |
|
| SBDTypeSpatialTransform (SBDTypeSpatialTransform && transform) Move constructor. |
|
| SBDTypeSpatialTransform (const SBPosition3 & position) Constructs a transform from a position vector, the orientation matrix is set to identity. |
|
| SBDTypeSpatialTransform (const SBMatrix33 & orientation) Constructs a transform from an orientation matrix, the position vector is set to zero. |
|
| SBDTypeSpatialTransform (const SBMatrix33 & orientation, const SBPosition3 & position) Constructs a transform from an orientation matrix and aposition vector. |
|
| SBDTypeSpatialTransform (const SBMatrix33 & orientation, const SBPosition3 & position, const SBVector3 & scale) Constructs a transform from an orientation matrix, aposition vector and ascale . |
|
| void | computeOpenGLMatrix (float mat) const Stores the OpenGL matrix corresponding to this transform in mat . |
| void | computeOpenGLMatrix (double mat) const Stores the OpenGL matrix corresponding to this transform in mat . |
| SBVector3 | getE1 () const Returns the first column of the orientation matrix. |
| SBVector3 | getE2 () const Returns the second column of the orientation matrix. |
| SBVector3 | getE3 () const Returns the third column of the orientation matrix. |
| SBPosition3 | getE4 () const Returns the position vector. |
| SBVector3 | getE5 () const Returns the scale vector. |
| void | inverse (SBDTypeSpatialTransform & inverse) const Stores the inverse of this transform in inverse . |
| SBDTypeSpatialTransform | inverse () const Returns the inverse of this transform. |
| void | inverseTransformAcceleration (const SBAcceleration6 & motionA, SBAcceleration6 & motionB) const Transforms the spatial acceleration accelerationA into the spatial accelerationaccelerationB by applying the__inverse of this transform. |
| void | inverseTransformVelocity (const SBVelocity6 & motionA, SBVelocity6 & motionB) const Transforms the spatial velocity velocityA into the spatial velocityvelocityB by applying the__inverse of this transform. |
| virtual bool | isSerializable () const Returns true __ |
| bool | operator!= (const SBDTypeSpatialTransform & transform) const Returns true if and only if this transform is not equal totransform . |
| SBPosition3 | operator* (const SBPosition3 & position) const Returns the result of the transformation of position position by this transform. |
| SBVelocity6 | operator* (const SBVelocity6 & velocity) const Returns the result of the transformation of spatial velocity velocity by this transform. |
| SBAcceleration6 | operator* (const SBAcceleration6 & acceleration) const Returns the result of the transformation of spatial acceleration acceleration by this transform. |
| SBForce6 | operator* (const SBForce6 & force) const Returns the result of the transformation of spatial force force by this transform. |
| SBDTypeSpatialTransform | operator* (const SBDTypeSpatialTransform & transform) const Returns the product of this transform with the transform transform . |
| SBDTypeSpatialTransform & | operator= (const SBDTypeSpatialTransform & transform) Copy assignment. |
| SBDTypeSpatialTransform & | operator= (SBDTypeSpatialTransform && transform) Move assignment. |
| bool | operator== (const SBDTypeSpatialTransform & transform) const Returns true if and only if this transform is equal totransform . |
| void | print () const Prints the spatial transform. |
| void | rightMultiply3D (const SBDTypeSpatialTransform & leftMember, SBDTypeSpatialTransform & result) const Stores in result the product ofleftMember and this transform. |
| void | rightMultiplyInverse3D (const SBDTypeSpatialTransform & leftMember, SBDTypeSpatialTransform & result) const Stores in result the product ofleftMember and the inverse of this transform. |
| virtual void | serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const Serializes the spatial transform. |
| void | setE1 (const SBVector3 & v) Sets the first column of the orientation matrix to v . |
| void | setE2 (const SBVector3 & v) Sets the second column of the orientation matrix to v . |
| void | setE3 (const SBVector3 & v) Sets the third column of the orientation matrix to v . |
| void | setE4 (const SBPosition3 & p) Sets the position vector to p . |
| void | setE5 (const SBVector3 & p) Sets the scale vector to p . |
| void | setIdentity () Sets this transform to identity. |
| void | transformAcceleration (const SBAcceleration6 & accelerationA, SBAcceleration6 & accelerationB) const Transforms the spatial acceleration accelerationA into the spatial accelerationaccelerationB . |
| void | transformForce (const SBForce6 & forceA, SBForce6 & forceB) const Transforms the spatial force forceA into the spatial forceforceB . |
| void | transformInertia (const SBInertia66 & IA, SBInertia66 & IB) const Transforms the inertia IA by this spatial transform and stores the result inIB . |
| void | transformInertiaLeft (const SBInertia66 & I, SBInertia66 & result) const Left-multiplies the inertia I by this spatial transform and stores the result inresult . |
| void | transformInertiaRight (const SBInertia66 & I, SBInertia66 & result) const Right-multiplies the inertia I by this spatial transform and stores the result inresult . |
| void | transformInverseInertia (const SBInverseInertia66 & phiA, SBInverseInertia66 & phiB) const Transforms the inverse inertia phiA into the inverse inertiaphiB . |
| void | transformInverseInertiaLeft (const SBInverseInertia66 & phi, SBInverseInertia66 & result) const Left-multiplies the inverse inertia phi by this spatial transform and stores the result inresult . |
| void | transformInverseInertiaRight (const SBInverseInertia66 & phi, SBInverseInertia66 & result) const Right-multiplies the inverse inertia phi by this spatial transform and stores the result inresult . |
| void | transformInverseInertiaTransposeRight (const SBInverseInertia66 & phi, SBInverseInertia66 & result) const Right-multiplies the transpose of the inverse inertia phi by this spatial transform and stores the result inresult . |
| void | transformPoint (const SBPosition3 & p, SBPosition3 & result) const Transforms the point p into the pointresult . |
| void | transformVelocity (const SBVelocity6 & velocityA, SBVelocity6 & velocityB) const Transforms the spatial velocity velocityA into the spatial velocityvelocityB . |
| virtual void | unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) Unserializes the spatial transform. |
| ~SBDTypeSpatialTransform () Destroys the spatial transform. |
Public Static Functions#
| Type | Name |
|---|---|
| SBDTypeSpatialTransform | fromAlignment (const SBVector< SBPosition3 > & fromPositionVector, const SBVector< SBPosition3 > & toPositionVector, SBQuantity::length & preRMSD, SBQuantity::length & postRMSD) Returns the transform that transforms the positions in fromPositionVector into the positions intoPositionVector as best as possible. |
Detailed Description#
This class handles rigid body transforms, and includes some useful functions to treat the transform either as a regular 3D transform (e.g.
__ to transform points) or as a spatial transform (e.g. to transform spatial velocities, spatial accelerations, spatial inertias, etc.). A spatial transform is composed of an orientation part (SBMatrix33) and a position part (SBPosition3).
Short name: SBSpatialTransform
See also: SBDTypePhysicalVector3, SBDTypePhysicalMatrix33
See also: SAMSON's unit system
Public Attributes Documentation#
variable orientation#
The pointer to the orientation of the spatial transform.
variable position#
The pointer to the position of the spatial transform.
variable scale#
The pointer to the scale of the spatial transform.
Public Static Attributes Documentation#
variable identity#
The identity spatial transform.
variable zero#
The zero spatial transform.
Public Functions Documentation#
function SBDTypeSpatialTransform [1/7]#
Constructs an identity transform.
function SBDTypeSpatialTransform [2/7]#
Copy constructor.
function SBDTypeSpatialTransform [3/7]#
Move constructor.
function SBDTypeSpatialTransform [4/7]#
Constructs a transform from a position vector, the orientation matrix is set to identity.
function SBDTypeSpatialTransform [5/7]#
Constructs a transform from an orientation matrix, the position vector is set to zero.
function SBDTypeSpatialTransform [6/7]#
Constructs a transform from an orientation matrix and aposition vector.
SBDTypeSpatialTransform::SBDTypeSpatialTransform (
const SBMatrix33 & orientation,
const SBPosition3 & position
)
function SBDTypeSpatialTransform [7/7]#
Constructs a transform from an orientation matrix, aposition vector and ascale .
SBDTypeSpatialTransform::SBDTypeSpatialTransform (
const SBMatrix33 & orientation,
const SBPosition3 & position,
const SBVector3 & scale
)
function computeOpenGLMatrix [1/2]#
Stores the OpenGL matrix corresponding to this transform in mat .
Stores the OpenGL matrix corresponding to this transform in mat:
mat[0] = (float)scale->v[0].getValue() * (float)orientation->m[0][0].getValue();
mat[1] = (float)scale->v[0].getValue() * (float)orientation->m[1][0].getValue();
mat[2] = (float)scale->v[0].getValue() * (float)orientation->m[2][0].getValue();
mat[3] = 0.0f;
mat[4] = (float)scale->v[1].getValue() * (float)orientation->m[0][1].getValue();
mat[5] = (float)scale->v[1].getValue() * (float)orientation->m[1][1].getValue();
mat[6] = (float)scale->v[1].getValue() * (float)orientation->m[2][1].getValue();
mat[7] = 0.0f;
mat[8] = (float)scale->v[2].getValue() * (float)orientation->m[0][2].getValue();
mat[9] = (float)scale->v[2].getValue() * (float)orientation->m[1][2].getValue();
mat[10] = (float)scale->v[2].getValue() * (float)orientation->m[2][2].getValue();
mat[11] = 0.0f;
mat[12] = (float)position->v[0].getValue();
mat[13] = (float)position->v[1].getValue();
mat[14] = (float)position->v[2].getValue();
mat[15] = 1.0f;
function computeOpenGLMatrix [2/2]#
Stores the OpenGL matrix corresponding to this transform in mat .
Stores the OpenGL matrix corresponding to this transform in mat:
mat[0] = scale->v[0].getValue() * orientation->m[0][0].getValue();
mat[1] = scale->v[0].getValue() * orientation->m[1][0].getValue();
mat[2] = scale->v[0].getValue() * orientation->m[2][0].getValue();
mat[3] = 0.0f;
mat[4] = scale->v[1].getValue() * orientation->m[0][1].getValue();
mat[5] = scale->v[1].getValue() * orientation->m[1][1].getValue();
mat[6] = scale->v[1].getValue() * orientation->m[2][1].getValue();
mat[7] = 0.0f;
mat[8] = scale->v[2].getValue() * orientation->m[0][2].getValue();
mat[9] = scale->v[2].getValue() * orientation->m[1][2].getValue();
mat[10] = scale->v[2].getValue() * orientation->m[2][2].getValue();
mat[11] = 0.0f;
mat[12] = position->v[0].getValue();
mat[13] = position->v[1].getValue();
mat[14] = position->v[2].getValue();
mat[15] = 1.0f;
function getE1#
Returns the first column of the orientation matrix.
function getE2#
Returns the second column of the orientation matrix.
function getE3#
Returns the third column of the orientation matrix.
function getE4#
Returns the position vector.
function getE5#
Returns the scale vector.
function inverse [1/2]#
Stores the inverse of this transform in inverse .
Note that this function only provides correct results when the scale is uniform.
function inverse [2/2]#
Returns the inverse of this transform.
function inverseTransformAcceleration#
Transforms the spatial acceleration accelerationA into the spatial accelerationaccelerationB by applying the__inverse of this transform.
void SBDTypeSpatialTransform::inverseTransformAcceleration (
const SBAcceleration6 & motionA,
SBAcceleration6 & motionB
) const
function inverseTransformVelocity#
Transforms the spatial velocity velocityA into the spatial velocityvelocityB by applying the__inverse of this transform.
void SBDTypeSpatialTransform::inverseTransformVelocity (
const SBVelocity6 & motionA,
SBVelocity6 & motionB
) const
function isSerializable#
Returns true __
function operator!=#
Returns true if and only if this transform is not equal totransform .
function operator*#
Returns the result of the transformation of position position by this transform.
function operator*#
Returns the result of the transformation of spatial velocity velocity by this transform.
function operator*#
Returns the result of the transformation of spatial acceleration acceleration by this transform.
function operator*#
Returns the result of the transformation of spatial force force by this transform.
function operator*#
Returns the product of this transform with the transform transform .
SBDTypeSpatialTransform SBDTypeSpatialTransform::operator* (
const SBDTypeSpatialTransform & transform
) const
Note that this function only provides correct results when the scales are uniform.
function operator=#
Copy assignment.
SBDTypeSpatialTransform & SBDTypeSpatialTransform::operator= (
const SBDTypeSpatialTransform & transform
)
function operator=#
Move assignment.
SBDTypeSpatialTransform & SBDTypeSpatialTransform::operator= (
SBDTypeSpatialTransform && transform
)
function operator==#
Returns true if and only if this transform is equal totransform .
function print#
Prints the spatial transform.
function rightMultiply3D#
Stores in result the product ofleftMember and this transform.
void SBDTypeSpatialTransform::rightMultiply3D (
const SBDTypeSpatialTransform & leftMember,
SBDTypeSpatialTransform & result
) const
function rightMultiplyInverse3D#
Stores in result the product ofleftMember and the inverse of this transform.
void SBDTypeSpatialTransform::rightMultiplyInverse3D (
const SBDTypeSpatialTransform & leftMember,
SBDTypeSpatialTransform & result
) const
function serialize#
Serializes the spatial transform.
virtual void SBDTypeSpatialTransform::serialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const
function setE1#
Sets the first column of the orientation matrix to v .
function setE2#
Sets the second column of the orientation matrix to v .
function setE3#
Sets the third column of the orientation matrix to v .
function setE4#
Sets the position vector to p .
function setE5#
Sets the scale vector to p .
function setIdentity#
Sets this transform to identity.
function transformAcceleration#
Transforms the spatial acceleration accelerationA into the spatial accelerationaccelerationB .
void SBDTypeSpatialTransform::transformAcceleration (
const SBAcceleration6 & accelerationA,
SBAcceleration6 & accelerationB
) const
function transformForce#
Transforms the spatial force forceA into the spatial forceforceB .
function transformInertia#
Transforms the inertia IA by this spatial transform and stores the result inIB .
function transformInertiaLeft#
Left-multiplies the inertia I by this spatial transform and stores the result inresult .
void SBDTypeSpatialTransform::transformInertiaLeft (
const SBInertia66 & I,
SBInertia66 & result
) const
function transformInertiaRight#
Right-multiplies the inertia I by this spatial transform and stores the result inresult .
void SBDTypeSpatialTransform::transformInertiaRight (
const SBInertia66 & I,
SBInertia66 & result
) const
function transformInverseInertia#
Transforms the inverse inertia phiA into the inverse inertiaphiB .
void SBDTypeSpatialTransform::transformInverseInertia (
const SBInverseInertia66 & phiA,
SBInverseInertia66 & phiB
) const
function transformInverseInertiaLeft#
Left-multiplies the inverse inertia phi by this spatial transform and stores the result inresult .
void SBDTypeSpatialTransform::transformInverseInertiaLeft (
const SBInverseInertia66 & phi,
SBInverseInertia66 & result
) const
function transformInverseInertiaRight#
Right-multiplies the inverse inertia phi by this spatial transform and stores the result inresult .
void SBDTypeSpatialTransform::transformInverseInertiaRight (
const SBInverseInertia66 & phi,
SBInverseInertia66 & result
) const
function transformInverseInertiaTransposeRight#
Right-multiplies the transpose of the inverse inertia phi by this spatial transform and stores the result inresult .
void SBDTypeSpatialTransform::transformInverseInertiaTransposeRight (
const SBInverseInertia66 & phi,
SBInverseInertia66 & result
) const
function transformPoint#
Transforms the point p into the pointresult .
function transformVelocity#
Transforms the spatial velocity velocityA into the spatial velocityvelocityB .
void SBDTypeSpatialTransform::transformVelocity (
const SBVelocity6 & velocityA,
SBVelocity6 & velocityB
) const
function unserialize#
Unserializes the spatial transform.
virtual void SBDTypeSpatialTransform::unserialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
)
function ~SBDTypeSpatialTransform#
Destroys the spatial transform.
Public Static Functions Documentation#
function fromAlignment#
Returns the transform that transforms the positions in fromPositionVector into the positions intoPositionVector as best as possible.
static SBDTypeSpatialTransform SBDTypeSpatialTransform::fromAlignment (
const SBVector< SBPosition3 > & fromPositionVector,
const SBVector< SBPosition3 > & toPositionVector,
SBQuantity::length & preRMSD,
SBQuantity::length & postRMSD
)