#include <xsi_transformation.h>
This object represents a transformation which is the result of the combination of a Scaling, a Rotation and a Translation, in the S.R.T order.
using namespace XSI; using namespace MATH; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube ); KinematicState globalKinematicState = myCube.GetKinematics().GetGlobal(); globalKinematicState.PutParameterValue(L"posy", 4.0); globalKinematicState.PutParameterValue(L"posx", 2.0); X3DObject myCube2; myCube.AddGeometry( L"Cube", L"MeshSurface",L"",myCube2); globalKinematicState = myCube2.GetKinematics().GetGlobal(); globalKinematicState.PutParameterValue(L"posz",3.0); globalKinematicState.PutParameterValue(L"rotx",45.0); CTransformation localTransformation = myCube.GetKinematics().GetLocal().GetTransform(); CTransformation globalTransformation = globalKinematicState.GetTransform(); CVector3 translation(localTransformation.GetTranslation()); app.LogMessage(L"The translation of the cube relative to its parent: x " + CValue(translation.GetX()).GetAsText() + L" y " + CValue(translation.GetY()).GetAsText() + L" z " + CValue(translation.GetZ()).GetAsText()); MapObjectPoseToWorldSpace( globalTransformation, localTransformation); translation = localTransformation.GetTranslation(); app.LogMessage(L"The translation of the cube relative to the origin of the universe: x " + CValue(translation.GetX()).GetAsText() + L" y " + CValue(translation.GetY()).GetAsText() + L" z " + CValue(translation.GetZ()).GetAsText());
Public Member Functions |
|
CTransformation () | |
CTransformation (const CTransformation &in_transformation) | |
~CTransformation () | |
CTransformation & | operator= (const CTransformation &in_transformation) |
CMatrix4 | GetMatrix4 () const |
void | SetMatrix4 (const CMatrix4 &in_matrix4) |
CTransformation & | SetRotation (const CRotation &in_Rotation) |
CRotation | GetRotation () const |
CTransformation & | SetRotX (const double &in_dX) |
double | GetRotX () const |
CTransformation & | SetRotY (const double &in_dY) |
double | GetRotY () const |
CTransformation & | SetRotZ (const double &in_dZ) |
double | GetRotZ () const |
void | PutRotationOrder (CRotation::RotationOrder in_Order) |
CRotation::RotationOrder | GetRotationOrder () const |
CTransformation & | SetRotationFromXYZAnglesValues (double in_dX, double in_dY, double in_dZ, CRotation::RotationOrder in_Order) |
CTransformation & | SetRotationFromXYZAnglesValues (double in_dX, double in_dY, double in_dZ) |
void | GetRotationFromXYZAnglesValues (double &io_dX, double &io_dY, double &io_dZ) const |
CTransformation & | MulInPlace (const CTransformation &in_transformation) |
CTransformation & | Mul (const CTransformation &in_transformationA, const CTransformation &in_transformationB) |
CTransformation & | AddParentTranslation (const CVector3 &in_vector3) |
CTransformation & | AddLocalTranslation (const CVector3 &in_vector3) |
CTransformation & | AddParentScaling (const CVector3 &in_vector3) |
CTransformation & | AddLocalScaling (const CVector3 &in_vector3) |
CTransformation & | SetRotationFromXYZAxes (const CVector3 &in_vector3X, const CVector3 &in_vector3Y, const CVector3 &in_vector3Z) |
CTransformation & | SetTranslationFromValues (double in_dX, double in_dY, double in_dZ) |
void | GetTranslationValues (double &io_dX, double &io_dY, double &io_dZ) const |
CTransformation & | SetScalingFromValues (double in_dX, double in_dY, double in_dZ) |
void | GetScalingValues (double &io_dX, double &io_dY, double &io_dZ) const |
void | GetScalingOrientationXYZAngles (double &io_dX, double &io_dY, double &io_dZ) const |
CTransformation & | SetScalingOrientationFromXYZAngles (double in_dX, double in_dY, double in_dZ) |
bool | HasScalingOrientation () const |
CTransformation & | SetIdentity () |
CTransformation & | SetTranslation (const CVector3 &in_vector3) |
CVector3 | GetTranslation () const |
CTransformation & | SetPosX (const double &in_dX) |
double | GetPosX () const |
CTransformation & | SetPosY (const double &in_dY) |
double | GetPosY () const |
CTransformation & | SetPosZ (const double &in_dZ) |
double | GetPosZ () const |
CTransformation & | SetRotationFromAxisAngle (const CVector3 &in_vector3, double in_dAngle) |
CTransformation & | SetRotationFromXYZAngles (const CVector3 &in_vector3) |
double | GetRotationAxisAngle (CVector3 &io_vector3) const |
CVector3 | GetRotationXYZAngles () const |
CTransformation & | SetScaling (const CVector3 &in_vector3) |
CVector3 | GetScaling () const |
CTransformation & | SetSclX (const double &in_dX) |
double | GetSclX () const |
CTransformation & | SetSclY (const double &in_dY) |
double | GetSclY () const |
CTransformation & | SetSclZ (const double &in_dZ) |
double | GetSclZ () const |
CTransformation & | SetRotationFromMatrix3 (const CMatrix3 &in_matrix3) |
CMatrix3 | GetRotationMatrix3 () const |
CTransformation & | SetRotationFromQuaternion (const CQuaternion &in_quaternion) |
CQuaternion | GetRotationQuaternion (void) const |
CTransformation & | InvertInPlace () |
CTransformation & | Invert (const CTransformation &in_transfo) |
bool | EpsilonEquals (const CTransformation &in_transformation, double in_dEpsilon) const |
bool | Equals (const CTransformation &in_transformation) const |
bool | operator== (const CTransformation &in_transformation) const |
bool | operator!= (const CTransformation &in_transformation) const |
CTransformation | ( | ) |
Default constructor.
CTransformation | ( | const CTransformation & | in_transformation | ) |
Copy constructor.
in_transformation | constant class object. |
~CTransformation | ( | ) |
Default destructor.
CTransformation& operator= | ( | const CTransformation & | in_transformation | ) |
Assignment operator.
in_transformation | constant class object. |
CMatrix4 GetMatrix4 | ( | ) | const |
Returns the matrix representation values .
void SetMatrix4 | ( | const CMatrix4 & | in_matrix4 | ) |
Sets the matrix representation values of this transformation from the matrix in_matrix4.
in_matrix4 | matrix operand. |
CTransformation& SetRotation | ( | const CRotation & | in_Rotation | ) |
Sets the rotation
in_Rotation | Source rotation |
CRotation GetRotation | ( | ) | const |
CTransformation& SetRotX | ( | const double & | in_dX | ) |
Sets the rotation angle (in degrees) around the X axis of this transformation.
in_dX | Rotation around X. |
double GetRotX | ( | ) | const |
Returns the rotation angle (in degrees) around the X axis of this transformation.
CTransformation& SetRotY | ( | const double & | in_dY | ) |
Sets the rotation angle (in degrees) around the Y axis of this transformation.
in_dY | Rotation around Y. |
double GetRotY | ( | ) | const |
Returns the rotation angle (in degrees) around the Y axis of this transformation.
CTransformation& SetRotZ | ( | const double & | in_dZ | ) |
Sets the rotation angle (in degrees) around the Z axis of this transformation.
in_dZ | Rotation around Z. |
double GetRotZ | ( | ) | const |
Returns the rotation angle (in degrees) around the Z axis of this transformation.
void PutRotationOrder | ( | CRotation::RotationOrder | in_Order | ) |
Sets the rotation order. Softimage uses the CRotation::siXYZ order by default. The rotation order is usually changed in order to fix Gimbal locks or to reuse data from a package using a different rotation order.
in_Order | New rotation order to use |
CRotation::RotationOrder GetRotationOrder | ( | ) | const |
Returns the current rotation order.
CTransformation& SetRotationFromXYZAnglesValues | ( | double | in_dX, |
double | in_dY, | ||
double | in_dZ, | ||
CRotation::RotationOrder | in_Order | ||
) |
Sets the Euler angles of the rotation and rotation order. Softimage uses the CRotation::siXYZ order by default. The rotation order is usually changed in order to fix Gimbal locks or to reuse data from a package using a different rotation order. Most users can use the overloaded function without the rotation order parameter if they work exclusively with Softimage.
in_dX | X euler angle value |
in_dY | Y euler angle value |
in_dZ | Z euler angle value |
in_Order | Rotation order |
CTransformation& SetRotationFromXYZAnglesValues | ( | double | in_dX, |
double | in_dY, | ||
double | in_dZ | ||
) |
Sets the Euler angles of the rotation
in_dX | X euler angle value |
in_dY | Y euler angle value |
in_dZ | Z euler angle value |
void GetRotationFromXYZAnglesValues | ( | double & | io_dX, |
double & | io_dY, | ||
double & | io_dZ | ||
) | const |
Returns the Euler angle values of the rotation.
io_dX | X euler angle value |
io_dY | Y euler angle value |
io_dZ | Z euler angle value |
CTransformation& MulInPlace | ( | const CTransformation & | in_transformation | ) |
Combines this transformations with in_transformation then stores the result in this transformation
in_transformation | transformation operand |
CTransformation& Mul | ( | const CTransformation & | in_transformationA, |
const CTransformation & | in_transformationB | ||
) |
Combines the transformations A and B then stores the result in this transformation.
in_transformationA | transformation operand |
in_transformationB | transformation operand |
CTransformation& AddParentTranslation | ( | const CVector3 & | in_vector3 | ) |
Applies a translation defined in the parent space of this transformation.
in_vector3 | translation vector. |
CTransformation& AddLocalTranslation | ( | const CVector3 & | in_vector3 | ) |
Applies a translation defined in the local space of this transformation.
in_vector3 | translation vector. |
CTransformation& AddParentScaling | ( | const CVector3 & | in_vector3 | ) |
Applies a scaling defined in the parent space of this transformation.
in_vector3 | scaling vector. |
CTransformation& AddLocalScaling | ( | const CVector3 & | in_vector3 | ) |
Applies a scaling defined in the local space of this transformation.
in_vector3 | scaling vector. |
CTransformation& SetRotationFromXYZAxes | ( | const CVector3 & | in_vector3X, |
const CVector3 & | in_vector3Y, | ||
const CVector3 & | in_vector3Z | ||
) |
Sets the rotation part of this transformation from three orthonormal axes. No verification is performed about their orthonormality.
in_vector3X | unitary X axis (orthogonal to Y and Z) |
in_vector3Y | unitary Y axis (orthogonal to X and Z) |
in_vector3Z | unitary Z axis (orthogonal to X and Y) |
CTransformation& SetTranslationFromValues | ( | double | in_dX, |
double | in_dY, | ||
double | in_dZ | ||
) |
Sets the translation of this transformation.
in_dX | translation in X. |
in_dY | translation in Y. |
in_dZ | translation in Z. |
void GetTranslationValues | ( | double & | io_dX, |
double & | io_dY, | ||
double & | io_dZ | ||
) | const |
Returns the translation values of this transformation.
io_dX | translation in X. |
io_dY | translation in Y. |
io_dZ | translation in Z. |
CTransformation& SetScalingFromValues | ( | double | in_dX, |
double | in_dY, | ||
double | in_dZ | ||
) |
Sets the scaling of this transformation.
in_dX | scaling in X. |
in_dY | scaling in Y. |
in_dZ | scaling in Z. |
void GetScalingValues | ( | double & | io_dX, |
double & | io_dY, | ||
double & | io_dZ | ||
) | const |
Returns the scaling values of this transformation.
io_dX | scaling in X. |
io_dY | scaling in Y. |
io_dZ | scaling in Z. |
void GetScalingOrientationXYZAngles | ( | double & | io_dX, |
double & | io_dY, | ||
double & | io_dZ | ||
) | const |
Returns the scaling orientation values of this transformation.
io_dX | scaling in X. |
io_dY | scaling in Y. |
io_dZ | scaling in Z. |
CTransformation& SetScalingOrientationFromXYZAngles | ( | double | in_dX, |
double | in_dY, | ||
double | in_dZ | ||
) |
Sets the scaling orientation angles of this transformation
in_dX | scaling orientation X angle. |
in_dY | scaling orientation Y angle. |
in_dZ | scaling orientation Z angle. |
bool HasScalingOrientation | ( | ) | const |
Returns whether this transformation has a valid scaling orientation.
CTransformation& SetIdentity | ( | ) |
Sets this transformation to identity.
CTransformation& SetTranslation | ( | const CVector3 & | in_vector3 | ) |
Sets the translation of this transformation. The translation is defined by a CVector3.
in_vector3 | vector of translation. |
CVector3 GetTranslation | ( | ) | const |
Returns the translation vector of this transformation in a CVector3.
CTransformation& SetPosX | ( | const double & | in_dX | ) |
Sets the X position of this transformation.
in_dX | Position in X. |
double GetPosX | ( | ) | const |
Returns the X position value of this transformation.
CTransformation& SetPosY | ( | const double & | in_dY | ) |
Sets the Y position of this transformation.
in_dY | Position in Y. |
double GetPosY | ( | ) | const |
Returns the Y position value of this transformation.
CTransformation& SetPosZ | ( | const double & | in_dZ | ) |
Sets the Z position of this transformation.
in_dZ | Position in Z. |
double GetPosZ | ( | ) | const |
Returns the Z position value of this transformation.
CTransformation& SetRotationFromAxisAngle | ( | const CVector3 & | in_vector3, |
double | in_dAngle | ||
) |
Sets the rotation part of this transformation by using the axis/angle representation.
in_vector3 | Axis of rotation. |
in_dAngle | Angle of rotation (in radians). |
CTransformation& SetRotationFromXYZAngles | ( | const CVector3 & | in_vector3 | ) |
Sets the X, Y and Z angles (in radians) of the rotation part of this transformation.
in_vector3 | vector containing X,Y and Z angles values(in radians). |
double GetRotationAxisAngle | ( | CVector3 & | io_vector3 | ) | const |
Extracts the axis and angle from the rotation part of this transformation.
io_vector3 | Axis of rotation. |
CVector3 GetRotationXYZAngles | ( | ) | const |
CTransformation& SetScaling | ( | const CVector3 & | in_vector3 | ) |
Sets the scaling of this transformation by getting the values from a CVector3.
in_vector3 | Vector containing X,Y and Z scaling values. |
CVector3 GetScaling | ( | ) | const |
CTransformation& SetSclX | ( | const double & | in_dX | ) |
Sets the scaling in X of this transformation.
in_dX | Scaling in X. |
double GetSclX | ( | ) | const |
Returns the scaling value in X of this transformation.
CTransformation& SetSclY | ( | const double & | in_dY | ) |
Sets the scaling in Y of this transformation.
in_dY | Scaling in Y. |
double GetSclY | ( | ) | const |
Returns the scaling value in Y of this transformation.
CTransformation& SetSclZ | ( | const double & | in_dZ | ) |
Sets the scaling in Z of this transformation.
in_dZ | Scaling in Z. |
double GetSclZ | ( | ) | const |
Returns the scaling value in Z of this transformation.
CTransformation& SetRotationFromMatrix3 | ( | const CMatrix3 & | in_matrix3 | ) |
Sets the rotation of this transformation by getting the values from a CMatrix3.
in_matrix3 | 3x3 matrix containing the rotation information to set this tranformation's rotation. |
CMatrix3 GetRotationMatrix3 | ( | ) | const |
Returns the 3x3 matrix representation of the rotation part of this transformation.
CTransformation& SetRotationFromQuaternion | ( | const CQuaternion & | in_quaternion | ) |
Sets the rotation of this transformation by getting the values from a CQuaternion.
in_quaternion | quaternion containing the rotation information to set this tranformation's rotation. |
CQuaternion GetRotationQuaternion | ( | void | ) | const |
Returns the rotation quaternion for this transformation.
CTransformation& InvertInPlace | ( | ) |
Inverts this CTransformation object
CTransformation& Invert | ( | const CTransformation & | in_transfo | ) |
Inverts the given CTransformation object
in_transfo | transformation to be inverted. |
bool EpsilonEquals | ( | const CTransformation & | in_transformation, |
double | in_dEpsilon | ||
) | const |
Tests the equality of this transformation with the specified transformation, with a tolerance of Epsilon.
in_transformation | Operand transformation. |
in_dEpsilon | Error margin Possible Values: [0, +INF[ should be a positive value |
bool Equals | ( | const CTransformation & | in_transformation | ) | const |
Tests the strict equality of this transformation with the specified transformation.
in_transformation | Operand transformation. |
bool operator== | ( | const CTransformation & | in_transformation | ) | const |
Equality operator tests the strict equality of this transformation with the specified transformation.
in_transformation | Operand transformation. |
bool operator!= | ( | const CTransformation & | in_transformation | ) | const |
Inequality operator tests the strict inequality of this matrix with the specified transform.
in_transformation | Operand transformation. |