Web Analytics Made Easy - Statcounter
Skip to content

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 (std::ostream & os) const
Prints the spatial transform.
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.
const SBDTypeSpatialTransform & getIdentity ()
Returns the identity spatial transform.
const SBDTypeSpatialTransform & getZero ()
Returns the zero spatial transform.

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.

SBMatrix33* SBDTypeSpatialTransform::orientation;


variable position#

The pointer to the position of the spatial transform.

SBPosition3* SBDTypeSpatialTransform::position;


variable scale#

The pointer to the scale of the spatial transform.

SBVector3* SBDTypeSpatialTransform::scale;


Public Static Attributes Documentation#

variable identity#

The identity spatial transform.

SBDTypeSpatialTransform const SBDTypeSpatialTransform::identity;


variable zero#

The zero spatial transform.

SBDTypeSpatialTransform const SBDTypeSpatialTransform::zero;


Public Functions Documentation#

function SBDTypeSpatialTransform [1/7]#

Constructs an identity transform.

SBDTypeSpatialTransform::SBDTypeSpatialTransform () 


function SBDTypeSpatialTransform [2/7]#

Copy constructor.

SBDTypeSpatialTransform::SBDTypeSpatialTransform (
    const SBDTypeSpatialTransform & transform
) 

Copy constructs a spatial transform from another transform.

Parameters:

  • transform The source transform to copy.

function SBDTypeSpatialTransform [3/7]#

Move constructor.

SBDTypeSpatialTransform::SBDTypeSpatialTransform (
    SBDTypeSpatialTransform && transform
) 

Move constructs a spatial transform from another transform.

Parameters:

  • transform The source transform to move.

function SBDTypeSpatialTransform [4/7]#

Constructs a transform from a position vector, the orientation matrix is set to identity.

SBDTypeSpatialTransform::SBDTypeSpatialTransform (
    const SBPosition3 & position
) 

Constructs a transform from a position vector, setting the orientation to identity.

Parameters:

  • pos Position vector.

function SBDTypeSpatialTransform [5/7]#

Constructs a transform from an orientation matrix, the position vector is set to zero.

SBDTypeSpatialTransform::SBDTypeSpatialTransform (
    const SBMatrix33 & orientation
) 

Constructs a transform from an orientation matrix, setting the position to zero.

Parameters:

  • orient Orientation matrix.

function SBDTypeSpatialTransform [6/7]#

Constructs a transform from an orientation matrix and aposition vector.

SBDTypeSpatialTransform::SBDTypeSpatialTransform (
    const SBMatrix33 & orientation,
    const SBPosition3 & position
) 

Constructs a transform from an orientation matrix and a position vector.

Parameters:

  • orient Orientation matrix.
  • pos Position vector.

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
) 

Constructs a transform from an orientation matrix, a position vector, and a scale vector.

Parameters:

  • orient Orientation matrix.
  • pos Position vector.
  • sca Scale vector.

function computeOpenGLMatrix [1/2]#

Stores the OpenGL matrix corresponding to this transform in mat .

void SBDTypeSpatialTransform::computeOpenGLMatrix (
    float mat
) const

Stores the OpenGL matrix corresponding to this transform in a float array.

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;

Parameters:

  • mat Array of 16 floats that receives the matrix in column-major order.

function computeOpenGLMatrix [2/2]#

Stores the OpenGL matrix corresponding to this transform in mat .

void SBDTypeSpatialTransform::computeOpenGLMatrix (
    double mat
) const

Stores the OpenGL matrix corresponding to this transform in a double array.

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;

Parameters:

  • mat Array of 16 doubles that receives the matrix in column-major order.

function getE1#

Returns the first column of the orientation matrix.

SBVector3 SBDTypeSpatialTransform::getE1 () const

Returns:

The first column as an SBVector3.


function getE2#

Returns the second column of the orientation matrix.

SBVector3 SBDTypeSpatialTransform::getE2 () const

Returns:

The second column as an SBVector3.


function getE3#

Returns the third column of the orientation matrix.

SBVector3 SBDTypeSpatialTransform::getE3 () const

Returns:

The third column as an SBVector3.


function getE4#

Returns the position vector.

SBPosition3 SBDTypeSpatialTransform::getE4 () const

Returns the position vector of the transform.

Returns:

The position as an SBPosition3.


function getE5#

Returns the scale vector.

SBVector3 SBDTypeSpatialTransform::getE5 () const

Returns the scale vector of the transform.

Returns:

The scale as an SBVector3.


function inverse [1/2]#

Stores the inverse of this transform in inverse .

void SBDTypeSpatialTransform::inverse (
    SBDTypeSpatialTransform & inverse
) const

Computes the inverse of this transform and stores it in inverse.

Note that this function only provides correct results when the scale is uniform.

Parameters:

  • inverse Transform that will receive the inverse of this transform.

function inverse [2/2]#

Returns the inverse of this transform.

SBDTypeSpatialTransform SBDTypeSpatialTransform::inverse () const

Returns the inverse of this spatial transform.

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

Applies the inverse of this spatial transform to a spatial acceleration.

Transforms the spatial acceleration motionA using the inverse of the transform described by this object's orientation and position, and stores the result in motionB.

Parameters:

  • motionA The input spatial acceleration to be transformed.
  • motionB The output spatial acceleration after applying the inverse transform.

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

Transforms a spatial velocity using the inverse of this spatial transform.

Applies the inverse of the transform's orientation and translation to a spatial velocity, yielding the transformed angular and linear components.

Parameters:

  • motionA Input spatial velocity to be transformed.
  • motionB Output transformed spatial velocity.

function isSerializable#

Returns true __

virtual bool SBDTypeSpatialTransform::isSerializable () const

Returns true indicating that the transform can be serialized.

Returns:

true.


function operator!=#

Returns true if and only if this transform is not equal totransform .

bool SBDTypeSpatialTransform::operator!= (
    const SBDTypeSpatialTransform & transform
) const

Checks whether this spatial transform is not equal to another.

Returns true if any of the orientation, position, or scale differ between the two transforms.

Parameters:

  • u The spatial transform to compare with.

Returns:

true if the transforms are not equal; otherwise false.


function operator*#

Returns the result of the transformation of position position by this transform.

SBPosition3 SBDTypeSpatialTransform::operator* (
    const SBPosition3 & position
) const

Applies this spatial transform to a position vector.

Parameters:

  • p The position to be transformed.

Returns:

The transformed position.


function operator*#

Returns the result of the transformation of spatial velocity velocity by this transform.

SBVelocity6 SBDTypeSpatialTransform::operator* (
    const SBVelocity6 & velocity
) const

Applies this spatial transform to a spatial velocity and returns the transformed velocity.

This operator returns a new SBVelocity6 that results from transforming the input velocity by the spatial transform represented by this object.

Parameters:

  • velocity The spatial velocity to be transformed.

Returns:

The transformed spatial velocity.


function operator*#

Returns the result of the transformation of spatial acceleration acceleration by this transform.

SBAcceleration6 SBDTypeSpatialTransform::operator* (
    const SBAcceleration6 & acceleration
) const

Applies this spatial transform to a spatial acceleration and returns the transformed acceleration.

This operator returns a new SBAcceleration6 that results from transforming the input acceleration by the spatial transform represented by this object.

Parameters:

  • acceleration The spatial acceleration to be transformed.

Returns:

The transformed spatial acceleration.


function operator*#

Returns the result of the transformation of spatial force force by this transform.

SBForce6 SBDTypeSpatialTransform::operator* (
    const SBForce6 & force
) const

Applies this spatial transform to a spatial force and returns the transformed force.

This operator returns a new SBForce6 that results from transforming the input force by the spatial transform represented by this object.

Parameters:

  • force The spatial force to be transformed.

Returns:

The transformed spatial force.


function operator*#

Returns the product of this transform with the transform transform .

SBDTypeSpatialTransform SBDTypeSpatialTransform::operator* (
    const SBDTypeSpatialTransform & transform
) const

Returns the composition of this spatial transform with another transform.

This operator computes the product of this transform and the given transform t, resulting in a new spatial transform.

Note that this function only provides correct results when the scales are uniform.

Parameters:

  • t The spatial transform to be multiplied with this transform.

Returns:

The resulting spatial transform.


function operator=#

Copy assignment.

SBDTypeSpatialTransform & SBDTypeSpatialTransform::operator= (
    const SBDTypeSpatialTransform & transform
) 

Assigns the contents of another spatial transform to this transform.

Performs a deep copy of the orientation, position, and scale from u to this object.

Parameters:

  • u The source spatial transform to copy from.

Returns:

Reference to this spatial transform.


function operator=#

Move assignment.

SBDTypeSpatialTransform & SBDTypeSpatialTransform::operator= (
    SBDTypeSpatialTransform && transform
) 

Moves the contents of another spatial transform into this transform.

Transfers ownership of the orientation, position, and scale from u to this object, leaving u in a valid but unspecified state.

Parameters:

  • u The source spatial transform to move from.

Returns:

Reference to this spatial transform.


function operator==#

Returns true if and only if this transform is equal totransform .

bool SBDTypeSpatialTransform::operator== (
    const SBDTypeSpatialTransform & transform
) const

Checks whether this spatial transform is equal to another.

Returns true if the orientation, position, and scale of both transforms are equal.

Parameters:

  • u The spatial transform to compare with.

Returns:

true if the transforms are equal; otherwise false.


function print [1/2]#

Prints the spatial transform.

void SBDTypeSpatialTransform::print (
    std::ostream & os
) const

Prints the spatial transform to the given output stream.

Parameters:

  • os The output stream to which the transform is printed.

function print [2/2]#

Prints the spatial transform.

void SBDTypeSpatialTransform::print () const

Prints the spatial transform to the standard output.


function rightMultiply3D#

Stores in result the product ofleftMember and this transform.

void SBDTypeSpatialTransform::rightMultiply3D (
    const SBDTypeSpatialTransform & leftMember,
    SBDTypeSpatialTransform & result
) const

Stores the product of leftMember and this transform in result.

Parameters:

  • leftMember The left-hand side transform.
  • result The transform that receives the product.

function rightMultiplyInverse3D#

Stores in result the product ofleftMember and the inverse of this transform.

void SBDTypeSpatialTransform::rightMultiplyInverse3D (
    const SBDTypeSpatialTransform & leftMember,
    SBDTypeSpatialTransform & result
) const

Stores the product of leftMember and the inverse of this transform in result.

Parameters:

  • leftMember The left-hand side transform.
  • result The transform that receives the product.

function serialize#

Serializes the spatial transform.

virtual void SBDTypeSpatialTransform::serialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const

Parameters:

  • serializer Serializer used to write the transform data.
  • sdkVersionNumber SDK version number for compatibility.

function setE1#

Sets the first column of the orientation matrix to v .

void SBDTypeSpatialTransform::setE1 (
    const SBVector3 & v
) 

Sets the first column of the orientation matrix.

Parameters:

  • v The new column vector.

function setE2#

Sets the second column of the orientation matrix to v .

void SBDTypeSpatialTransform::setE2 (
    const SBVector3 & v
) 

Sets the second column of the orientation matrix.

Parameters:

  • v The new column vector.

function setE3#

Sets the third column of the orientation matrix to v .

void SBDTypeSpatialTransform::setE3 (
    const SBVector3 & v
) 

Sets the third column of the orientation matrix.

Parameters:

  • v The new column vector.

function setE4#

Sets the position vector to p .

void SBDTypeSpatialTransform::setE4 (
    const SBPosition3 & p
) 

Sets the position vector of the transform.

Parameters:

  • v The new position.

function setE5#

Sets the scale vector to p .

void SBDTypeSpatialTransform::setE5 (
    const SBVector3 & p
) 

Sets the scale vector of the transform.

Parameters:

  • v The new scale vector.

function setIdentity#

Sets this transform to identity.

void SBDTypeSpatialTransform::setIdentity () 

Sets this transform to the identity transform.


function transformAcceleration#

Transforms the spatial acceleration accelerationA into the spatial accelerationaccelerationB .

void SBDTypeSpatialTransform::transformAcceleration (
    const SBAcceleration6 & accelerationA,
    SBAcceleration6 & accelerationB
) const

Transforms a spatial acceleration using this spatial transform.

Applies the transform's orientation and translation to a spatial acceleration, yielding the transformed angular and linear components.

Parameters:

  • motionA Input spatial acceleration to be transformed.
  • motionB Output transformed spatial acceleration.

function transformForce#

Transforms the spatial force forceA into the spatial forceforceB .

void SBDTypeSpatialTransform::transformForce (
    const SBForce6 & forceA,
    SBForce6 & forceB
) const

Applies this spatial transform to a spatial force.

Transforms the spatial force forceA using the orientation and position of this spatial transform, and stores the result in forceB.

Parameters:

  • forceA The input spatial force to be transformed.
  • forceB The output spatial force after applying the transform.

function transformInertia#

Transforms the inertia IA by this spatial transform and stores the result inIB .

void SBDTypeSpatialTransform::transformInertia (
    const SBInertia66 & IA,
    SBInertia66 & IB
) const

Transforms an inertia tensor by applying this spatial transform to both sides.

This function computes IB = X_f * IA * X_f^T, where X_f is the spatial transform represented by this object, resulting in the transformed inertia tensor IB.

Parameters:

  • IA Input inertia tensor.
  • IB Output transformed inertia tensor.

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

Transforms an inertia tensor by left‑multiplying with this spatial transform.

Computes the product of this transform with the inertia tensor I and stores the result in result. This operation corresponds to applying the spatial transform to the inertia tensor.

Parameters:

  • I The input inertia tensor to be transformed.
  • result The output inertia tensor after transformation.

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

Right-multiplies an inertia matrix by this spatial transform.

Computes the product of the inertia matrix I with the spatial transform represented by this object, and stores the result in result.

Parameters:

  • I The inertia matrix to be transformed.
  • result The inertia matrix that receives the transformed result.

function transformInverseInertia#

Transforms the inverse inertia phiA into the inverse inertiaphiB .

void SBDTypeSpatialTransform::transformInverseInertia (
    const SBInverseInertia66 & phiA,
    SBInverseInertia66 & phiB
) const

Transforms an inverse inertia tensor by applying this spatial transform to both sides.

This function computes phiB = X_m * phiA * X_m^T, where X_m is the spatial transform represented by this object, effectively transforming the input inverse inertia tensor phiA into phiB.

Parameters:

  • phiA Input inverse inertia tensor.
  • phiB Output transformed inverse inertia tensor.

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

Transforms an inverse inertia tensor by left-multiplying it with this spatial transform.

This function applies the spatial transform represented by this object to the input inverse inertia tensor phi, and stores the result in result.

Parameters:

  • phi Input inverse inertia tensor.
  • result Output transformed inverse inertia tensor.

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

Right‑multiplies an inverse inertia tensor by this spatial transform.

This function computes the product of the given inverse inertia tensor phi and the spatial transform represented by this object's orientation and position, storing the result in result. The operation corresponds to multiplying phi on the right by the transform matrix.

Parameters:

  • phi The inverse inertia tensor to be transformed.
  • result The output inverse inertia tensor containing the result of the multiplication.

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

Right-multiplies the transpose of the inverse inertia matrix by this spatial transform.

This function multiplies the transpose of the inverse inertia matrix phi by the spatial transform represented by this object's orientation and position, storing the resulting matrix in result.

Parameters:

  • phi The inverse inertia matrix to be transformed.
  • result The resulting inverse inertia matrix after the transformation.

function transformPoint#

Transforms the point p into the pointresult .

void SBDTypeSpatialTransform::transformPoint (
    const SBPosition3 & p,
    SBPosition3 & result
) const

Transforms a point using this spatial transform.

Applies orientation, scaling, and translation to the input point.

Parameters:

  • v Input point to be transformed.
  • result Output transformed point.

function transformVelocity#

Transforms the spatial velocity velocityA into the spatial velocityvelocityB .

void SBDTypeSpatialTransform::transformVelocity (
    const SBVelocity6 & velocityA,
    SBVelocity6 & velocityB
) const

Transforms a spatial velocity using this spatial transform.

Applies the transform's orientation and translation to a spatial velocity, yielding the transformed angular and linear components.

Parameters:

  • motionA Input spatial velocity to be transformed.
  • motionB Output transformed spatial velocity.

function unserialize#

Unserializes the spatial transform.

virtual void SBDTypeSpatialTransform::unserialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) 

Parameters:

  • serializer Serializer used to read the transform data.
  • sdkVersionNumber SDK version number for compatibility.

function ~SBDTypeSpatialTransform#

Destroys the spatial transform.

SBDTypeSpatialTransform::~SBDTypeSpatialTransform () 


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
) 

Computes a spatial transform that aligns two sets of positions.

Computes the transform that best aligns the source positions to the target positions.

Parameters:

  • fromPositionVector Vector of source positions.
  • toPositionVector Vector of target positions.
  • preRMSD Output RMSD before alignment.
  • postRMSD Output RMSD after alignment.

Returns:

The spatial transform aligning the source positions to the target positions.


function getIdentity#

Returns the identity spatial transform.

static const SBDTypeSpatialTransform & SBDTypeSpatialTransform::getIdentity () 

Returns the identity spatial transform constant.

Returns:

A reference to the identity spatial transform.


function getZero#

Returns the zero spatial transform.

static const SBDTypeSpatialTransform & SBDTypeSpatialTransform::getZero () 

Returns the zero spatial transform constant.

Returns:

A reference to the zero spatial transform.