CRotation Class Reference
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>
List of all members.
|
|
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 |
Detailed Description
Provides conversion facilities for various rotation representations including Euler angles, Quaternion, Axis angle and rotation matrix.
- Note:
- All angle values are expressed in radians.
- See also:
- CTransformation, CQuaternion
- Example:
-
using namespace XSI;
using namespace MATH;
Application app;
Model root = app.GetActiveSceneRoot();
X3DObject myCube;
root.AddGeometry( L"Cube", L"MeshSurface",L"",myCube );
KinematicState cubeKine = myCube.GetKinematics().GetGlobal();
cubeKine.PutParameterValue( L"rotx", 60.0 );
CRotation cubeRotation = cubeKine.GetTransform().GetRotation();
CVector3 eulerAngles = cubeRotation.GetXYZAngles();
eulerAngles.ScaleInPlace( 0.5 );
cubeKine.PutParameterValue( L"rotx", RadiansToDegrees( eulerAngles.GetX() ) );
Member Enumeration Documentation
Defines the rotation order of a rotation for the Euler angles representation.
- Enumerator:
-
| siXYZ |
X, Y, Z order |
| siXZY |
X, Z, Y order |
| siYXZ |
Y, X, Z order |
| siYZX |
Y, Z, X order |
| siZXY |
Z, X, Y order |
| siZYX |
Z, Y, X order |
Constructor & Destructor Documentation
Copy constructor.
- Parameters:
-
|
|
in_rotation |
Rotation to copy |
Constructor (from CVector3 of Euler angles).
- Parameters:
-
|
|
in_EulerAngles |
Euler angles to construct from |
|
|
in_RotOrder |
Rotation order to use |
- See also:
- CRotation::SetFromXYZAngles, CRotation::PutRotationOrder
Constructor (from XYZ Euler angles).
- Parameters:
-
|
|
in_dX |
X angle |
|
|
in_dY |
Y angle |
|
|
in_dZ |
Z angle |
|
|
in_RotOrder |
Rotation order to use |
- See also:
- CRotation::SetFromXYZAngles, CRotation::PutRotationOrder
Constructor (from a quaternion).
- Parameters:
-
|
|
in_Quat |
Quaternion to construct from |
- See also:
- CRotation::GetQuaternion, CRotation::SetFromQuaternion
Constructor (using axis angle representation).
- Parameters:
-
|
|
in_Axis |
Axis of rotation |
|
|
in_dAngle |
Rotation angle around the axis |
- See also:
- CRotation::GetAxisAngle, CRotation::SetFromAxisAngle
Constructor (from a rotation matrix).
- Parameters:
-
|
|
in_Matrix |
Rotation matrix |
- See also:
- CRotation::GetMatrix, CRotation::SetFromMatrix
Default destructor.
Member Function Documentation
Assignment operator.
- Parameters:
-
|
|
in_rotation |
Rotation to copy |
- Returns:
- A reference to this rotation.
Copies the content of another rotation.
- Parameters:
-
|
|
in_SrcRot |
Rotation to copy |
- Returns:
- This rotation
Returns the Euler angles representation of the rotation as a CVector3.
- Returns:
- CVector3 Vector containing the X, Y and Z Euler angles
- See also:
- CRotation::SetFromXYZAngles, CRotation::GetRotationOrder
| void GetXYZAngles |
( |
double & |
io_dX, |
|
|
|
double & |
io_dY, |
|
|
|
double & |
io_dZ |
|
|
|
) |
|
|
const |
Returns the Euler angles's representation of the rotation.
- Parameters:
-
|
|
io_dX |
X angle |
|
|
io_dY |
Y angle |
|
|
io_dZ |
Z angle |
- See also:
- CRotation::SetFromXYZAngles, CRotation::GetRotationOrder
Returns the rotation order of this rotation for the Euler angles representation.
- Returns:
- CRotation::RotationOrder
Sets the rotation order for the Euler angles representation.
- Parameters:
-
|
|
in_RotationOrder |
New rotation order to use |
- See also:
- CRotation::GetRotationOrder
Sets the current rotation from Euler angles.
- Parameters:
-
|
|
in_EulerAngles |
Vector containing the rotation angles |
|
|
in_Order |
Rotation order |
- Returns:
- This rotation
- See also:
- CRotation::GetXYZAngles, CRotation::PutRotationOrder
Sets the rotation from Euler angles.
- Parameters:
-
|
|
in_dX |
X angle |
|
|
in_dY |
Y angle |
|
|
in_dZ |
Z angle |
|
|
in_Order |
Requested rotation order |
- Returns:
- This rotation
- See also:
- CRotation::GetXYZAngles, CRotation::PutRotationOrder
Sets this rotation from three orthonormal axes.
- Warning:
- No verification is performed about their orthonormality
- Parameters:
-
|
|
in_XAxis |
The X axis |
|
|
in_YAxis |
The Y axis |
|
|
in_ZAxis |
The Z axis |
- Returns:
- This rotation
Multiplies this rotation with another one in place.
- Parameters:
-
|
|
in_Rotation |
Rotation to multiply |
- Returns:
- This rotation
Multiplies this rotation with another one in place.
- Parameters:
-
|
|
in_Rotation |
Rotation to multiply |
- Returns:
- This rotation
Stores the result of the multiplication of two rotations.
- Parameters:
-
|
|
in_Rotation1 |
First rotation |
|
|
in_Rotation2 |
Second rotation |
- Returns:
- This rotation
Inverts the rotation in place.
- Returns:
- This rotation
Stores the invert of a rotation.
- Parameters:
-
|
|
in_Rot |
Rotation to invert |
- Returns:
- This rotation
Returns the quaternion representation of the rotation.
- Returns:
- CQuaternion
- See also:
- CRotation::SetFromQuaternion
Sets the rotation from a quaternion.
- Parameters:
-
|
|
in_Quat |
Quaternion to set from |
- Returns:
- This rotation
- See also:
- CRotation::GetQuaternion
Sets the rotation from a quaternion.
- Parameters:
-
|
|
in_Quat |
Quaternion to set from |
- Returns:
- This rotation
- See also:
- CRotation::SetFromQuaternion
| CVector3 GetAxisAngle |
( |
double & |
io_dAngle |
) |
const |
Returns the axis angle representation of the rotation.
- Parameters:
-
|
|
io_dAngle |
Rotation angle around the axis |
- Returns:
- CVector3 Axis of rotation
- See also:
- CRotation::SetFromAxisAngle
Sets the rotation from an axis angle.
- Parameters:
-
|
|
in_Axis |
Axis of rotation |
|
|
in_dAngle |
Rotation angle around the axis |
- Returns:
- This rotation
- See also:
- CRotation::GetAxisAngle
Returns the rotation matrix.
- Returns:
- CMatrix3
- See also:
- CRotation::SetFromMatrix
Sets the rotation from a rotation matrix.
- Parameters:
-
|
|
in_Matrix |
Rotation matrix |
- Returns:
- This rotation
- See also:
- CRotation::GetMatrix
Sets the rotation from a rotation matrix.
- Parameters:
-
|
|
in_Matrix |
Rotation matrix |
- Returns:
- This rotation
- See also:
- CRotation::SetFromMatrix
Sets the rotation to identity rotation.
| bool EpsilonEquals |
( |
const CRotation & |
in_Rot, |
|
|
|
double |
in_dEpsilon |
|
|
|
) |
|
|
const |
Tests the equality of this rotation against in_Rot, with a tolerance of in_dEpsilon.
- Parameters:
-
|
|
in_Rot |
Rotation to compare against |
|
|
in_dEpsilon |
Tolerance. Rotations are considered equal if each parameter pair has a difference lower than in_dEpsilon. |
- Returns:
- true if rotations are approximately equal; false if not equal
- See also:
- CRotation::Equals
| bool Equals |
( |
const CRotation & |
in_Rot |
) |
const |
Performs exact comparison of two quaternions.
- Note:
- Each parameter of both quaternions must be exactly the same for a match.
- Parameters:
-
|
|
in_Rot |
Rotation to compare against |
- See also:
- CRotation::EpsilonEquals
| bool operator== |
( |
const CRotation & |
in_Rot |
) |
const |
Performs exact comparison of two quaternions.
- Note:
- Each parameter of both quaternions must be exactly the same for a match.
- Parameters:
-
|
|
in_Rot |
Rotation to compare against |
- See also:
- CRotation::EpsilonEquals, CRotation::Equals
| bool operator!= |
( |
const CRotation & |
in_Rot |
) |
const |
Inequality operator tests the strict inequality of this rotation with the rotation in_rotation.
- Parameters:
-
- Returns:
- true if equal else false.
- See also:
- CRotation::Equals
The documentation for this class was generated from the following file: