Related Scripting Object: SIRotation
Provides conversion facilities for various rotation representations including Euler angles, Quaternion, Axis angle and rotation matrix. More...
#include <xsi_rotation.h>
Public Types |
|
| enum | RotationOrder { siXYZ = 0, siXZY = 1, siYXZ = 2, siYZX = 3, siZXY = 4, siZYX = 5 } |
Public Member Functions |
|
| CRotation () | |
| CRotation (const CRotation &in_rotation) | |
| CRotation (const CVector3 &in_EulerAngles, RotationOrder in_RotOrder=siXYZ) | |
| CRotation (double in_dX, double in_dY, double in_dZ, RotationOrder in_RotOrder=siXYZ) | |
| CRotation (const CQuaternion &in_Quat) | |
| CRotation (const CVector3 &in_Axis, double in_dAngle) | |
| CRotation (const CMatrix3 &in_Matrix) | |
| ~CRotation () | |
| CRotation & | operator= (const CRotation &in_rotation) |
| CRotation & | Copy (const CRotation &in_SrcRot) |
| CVector3 | GetXYZAngles () const |
| void | GetXYZAngles (double &io_dX, double &io_dY, double &io_dZ) const |
| RotationOrder | GetRotationOrder () const |
| void | PutRotationOrder (RotationOrder in_RotationOrder) |
| CRotation & | SetFromXYZAngles (const CVector3 &in_EulerAngles, RotationOrder in_Order=siXYZ) |
| CRotation & | SetFromXYZAngles (double in_dX, double in_dY, double in_dZ, RotationOrder in_Order=siXYZ) |
| CRotation & | SetFromXYZAxes (const CVector3 &in_XAxis, const CVector3 &in_YAxis, const CVector3 &in_ZAxis) |
| CRotation & | operator *= (const CRotation &in_Rotation) |
| CRotation & | MulInPlace (const CRotation &in_Rotation) |
| CRotation & | Mul (const CRotation &in_Rotation1, const CRotation &in_Rotation2) |
| CRotation & | InvertInPlace () |
| CRotation & | Invert (const CRotation &in_Rot) |
| CQuaternion | GetQuaternion () const |
| CRotation & | SetFromQuaternion (const CQuaternion &in_Quat) |
| CRotation & | operator= (const CQuaternion &in_Quat) |
| CVector3 | GetAxisAngle (double &io_dAngle) const |
| CRotation & | SetFromAxisAngle (const CVector3 &in_Axis, double in_dAngle) |
| CMatrix3 | GetMatrix () const |
| CRotation & | SetFromMatrix (const CMatrix3 &in_Matrix) |
| CRotation & | operator= (const CMatrix3 &in_Matrix) |
| void | SetIdentity () |
| bool | EpsilonEquals (const CRotation &in_Rot, double in_dEpsilon) const |
| bool | Equals (const CRotation &in_Rot) const |
| bool | operator== (const CRotation &in_Rot) const |
| bool | operator!= (const CRotation &in_Rot) const |
using namespace XSI; using namespace MATH; Application app; Model root = app.GetActiveSceneRoot(); // Create a cube X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube ); // Rotate it 60 degrees KinematicState cubeKine = myCube.GetKinematics().GetGlobal(); cubeKine.PutParameterValue( L"rotx", 60.0 ); // Get the current rotation for the cube CRotation cubeRotation = cubeKine.GetTransform().GetRotation(); // Halve the current rotation angle values CVector3 eulerAngles = cubeRotation.GetXYZAngles(); eulerAngles.ScaleInPlace( 0.5 ); // Put the halved value back into x cubeKine.PutParameterValue( L"rotx", RadiansToDegrees( eulerAngles.GetX() ) );
| enum RotationOrder |
Copy constructor.
| in_rotation | Rotation to copy |
| CRotation | ( | const CVector3 & | in_EulerAngles, | |
| RotationOrder | in_RotOrder = siXYZ |
|||
| ) |
Constructor (from CVector3 of Euler angles).
| in_EulerAngles | Euler angles to construct from | |
| in_RotOrder | Rotation order to use |
| CRotation | ( | double | in_dX, | |
| double | in_dY, | |||
| double | in_dZ, | |||
| RotationOrder | in_RotOrder = siXYZ |
|||
| ) |
Constructor (from XYZ Euler angles).
| in_dX | X angle | |
| in_dY | Y angle | |
| in_dZ | Z angle | |
| in_RotOrder | Rotation order to use |
| CRotation | ( | const CQuaternion & | in_Quat | ) |
Constructor (from a quaternion).
| in_Quat | Quaternion to construct from |
Constructor (using axis angle representation).
| in_Axis | Axis of rotation | |
| in_dAngle | Rotation angle around the axis |
Constructor (from a rotation matrix).
| in_Matrix | Rotation matrix |
Default destructor.
Assignment operator.
| in_rotation | Rotation to copy |
Copies the content of another rotation.
| in_SrcRot | Rotation to copy |
Returns the Euler angles representation of the rotation as a CVector3.
| void GetXYZAngles | ( | double & | io_dX, | |
| double & | io_dY, | |||
| double & | io_dZ | |||
| ) | const |
Returns the Euler angles's representation of the rotation.
| io_dX | X angle | |
| io_dY | Y angle | |
| io_dZ | Z angle |
Returns the rotation order of this rotation for the Euler angles representation.
Sets the rotation order for the Euler angles representation.
| in_RotationOrder | New rotation order to use |
Sets the current rotation from Euler angles.
| in_EulerAngles | Vector containing the rotation angles | |
| in_Order | Rotation order |
| CRotation& SetFromXYZAngles | ( | double | in_dX, | |
| double | in_dY, | |||
| double | in_dZ, | |||
| RotationOrder | in_Order = siXYZ |
|||
| ) |
Sets the rotation from Euler angles.
| in_dX | X angle | |
| in_dY | Y angle | |
| in_dZ | Z angle | |
| in_Order | Requested rotation order |
| CRotation& SetFromXYZAxes | ( | const CVector3 & | in_XAxis, | |
| const CVector3 & | in_YAxis, | |||
| const CVector3 & | in_ZAxis | |||
| ) |
Sets this rotation from three orthonormal axes.
| in_XAxis | The X axis | |
| in_YAxis | The Y axis | |
| in_ZAxis | The Z axis |
Multiplies this rotation with another one in place.
| in_Rotation | Rotation to multiply |
Multiplies this rotation with another one in place.
| in_Rotation | Rotation to multiply |
Stores the result of the multiplication of two rotations.
| in_Rotation1 | First rotation | |
| in_Rotation2 | Second rotation |
Inverts the rotation in place.
Stores the invert of a rotation.
| in_Rot | Rotation to invert |
Returns the quaternion representation of the rotation.
Sets the rotation from a quaternion.
| in_Quat | Quaternion to set from |
| CRotation& operator= | ( | const CQuaternion & | in_Quat | ) |
Sets the rotation from a quaternion.
| in_Quat | Quaternion to set from |
Returns the axis angle representation of the rotation.
| io_dAngle | Rotation angle around the axis |
Sets the rotation from an axis angle.
| in_Axis | Axis of rotation | |
| in_dAngle | Rotation angle around the axis |
Returns the rotation matrix.
Sets the rotation from a rotation matrix.
| in_Matrix | Rotation matrix |
Sets the rotation from a rotation matrix.
| in_Matrix | Rotation matrix |
Sets the rotation to identity rotation.
Tests the equality of this rotation against in_Rot, with a tolerance of in_dEpsilon.
| in_Rot | Rotation to compare against | |
| in_dEpsilon | Tolerance. Rotations are considered equal if each parameter pair has a difference lower than in_dEpsilon. |
Performs exact comparison of two quaternions.
| in_Rot | Rotation to compare against |
Performs exact comparison of two quaternions.
| in_Rot | Rotation to compare against |
Inequality operator tests the strict inequality of this rotation with the rotation in_rotation.
| in_Rot | Operand rotation. |