Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

CSIBCQuaternion Class Reference

Generic class representing quaternions. More...

#include <SIBCQuaternion.h>

List of all members.

Public Methods


Detailed Description

Generic class representing quaternions.

The notation used in this quaternion class (W, X, Y, Z) makes the quaternions closely related to 4D vectors (See CSIBCVector4D). In general, the quaternion can be thought of as a scalar plus a vector, where the W component is the vector, and X, Y and Z are the coefficients of the I, J and K matricies respectively.

The components of the CSIBCQuaternion class are represented by single precision floating-point numbers. Its corresponding double precision class, CSIBCQuaterniond, has much more functionality, such as the ability to interpolate and multiply quaternions.


Constructor & Destructor Documentation

CSIBCQuaternion::CSIBCQuaternion   [inline]
 

Default Constructor. Sets all components of the quaternion to zero, except W, which is set to one.

See also:
CSIBCQuaternion::Init()

CSIBCQuaternion::CSIBCQuaternion const CSIBCQuaternion &    in_quat [inline]
 

Copy Copnstructor. Copies the data from in_quat to the new quaternion.

Parameters:
in_quat  Quaternion containing data to copy to this quaternion.
See also:
CSIBCQuaternion::operator= , CSIBCQuaternion::Init(CSIBCQuaternion &)


Member Function Documentation

SI_Error CSIBCQuaternion::GetAxisAngle CSIBCVector3D   out_vAxis,
float &    out_fAngle
 

Gets the axis of rotation, and rotation angle about the axis, that is represented by this quaternion.

Parameters:
out_vAxis  Receives the axis of rotation.
out_fAngle  Receives the angle of rotation about the axis (in radians).
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly converted.
  • SI_ERR_ERROR_MSG - The quaternion could not be converted, axis components and angle are all zero.
See also:
CSIBCQuaternion::GetXYZRotation

SI_Error CSIBCQuaternion::GetMatrix CSIBCMatrix4x4   out_mat
 

Returns the rotation matrix corresponding to this quaternion. The quaternion must be a unit quaternion for this operation to succeed.

Parameters:
out_mat  Reference to the matrix object to receive the rotation matrix.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly converted.
  • SI_ERR_ERROR_MSG - The quaternion was not a unit quaternion.
See also:
CSIBCQuaternion::GetXYZRotation , CSIBCQuaternion::GetAxisAngle

SI_Float CSIBCQuaternion::GetW   const [inline]
 

Gets the W component of the quaternion.

Returns:
SI_Float The W component of the quaternion.
See also:
CSIBCQuaternion::GetX , CSIBCQuaternion::GetY , CSIBCQuaternion::GetZ , CSIBCQuaternion::SetW

SI_Float CSIBCQuaternion::GetX   const [inline]
 

Gets the X component of the quaternion.

Returns:
SI_Float The X component of the quaternion.
See also:
CSIBCQuaternion::GetY , CSIBCQuaternion::GetZ , CSIBCQuaternion::GetW , CSIBCQuaternion::SetX

SI_Error CSIBCQuaternion::GetXYZRotation SI_Float    in_dX,
SI_Float    in_dY,
SI_Float    in_dZ,
CSIBCVector3D   out_vect
 

Returns the euler rotation angles (pitch-roll-yaw) represented by this quaternion.

Parameters:
out_vect  Vector to receive the euler rotation angles.
in_dX  Ignored.
in_dY  Ignored.
in_dZ  Ignored.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly converted.
See also:
CSIBCQuaternion::GetMatrix , CSIBCQuaternion::GetAxisAngle

SI_Error CSIBCQuaternion::GetXYZRotation CSIBCVector3D   out_vect [inline]
 

Returns the euler rotation angles (pitch-roll-yaw) represented by this quaternion.

Parameters:
out_vect  Vector to receive the euler rotation angles.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly converted.
See also:
CSIBCQuaternion::GetMatrix , CSIBCQuaternion::GetAxisAngle

SI_Float CSIBCQuaternion::GetY   const [inline]
 

Gets the Y component of the quaternion.

Returns:
SI_Float The Y component of the quaternion.
See also:
CSIBCQuaternion::GetX , CSIBCQuaternion::GetZ , CSIBCQuaternion::GetW , CSIBCQuaternion::SetY

SI_Float CSIBCQuaternion::GetZ   const [inline]
 

Gets the Z component of the quaternion.

Returns:
SI_Float The Z component of the quaternion.
See also:
CSIBCQuaternion::GetX , CSIBCQuaternion::GetY , CSIBCQuaternion::GetW , CSIBCQuaternion::SetZ

SI_Error CSIBCQuaternion::Init SI_Float    in_dX,
SI_Float    in_dY,
SI_Float    in_dZ
 

Initializes the quaternion to the quaternion represented by the euler rotations given by the euler angles (pitch-roll-yaw) of the parameters.

Parameters:
in_dX  Value for the pitch euler angle, for the quaternion value.
in_dY  Value for the roll euler angle, for the quaternion value.
in_dZ  Value for the yaw euler angle, for the quaternion value.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly initialized.
See also:
CSIBCQuaternion::Init

SI_Error CSIBCQuaternion::Init SI_Float    in_dX,
SI_Float    in_dY,
SI_Float    in_dZ,
SI_Float    in_dW
 

Initializes the quaternion components values to the values given.

Parameters:
in_dX  The new value for the X component of the quaternion.
in_dY  The new value for the Y component of the quaternion.
in_dZ  The new value for the Z component of the quaternion.
in_dW  The new value for the W component of the quaternion.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly initialized.
See also:
CSIBCQuaternion::Init , CSIBCQuaternion::Set

SI_Error CSIBCQuaternion::Init CSIBCQuaternion &    in_quat
 

Initializes the quaternion component values to those of in_quat.

Parameters:
in_quat  The quaternion from which to copy initialization values.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly initialized.
See also:
CSIBCQuaternion::CSIBCQuaternion(CSIBCQuaternion &) , CSIBCQuaternion::Init

SI_Error CSIBCQuaternion::Init   [inline]
 

Initializes the quaternion components values all to zero, except W, which is set to one.

Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly initialized.
See also:
CSIBCQuaternion::CSIBCQuaternion() , CSIBCQuaternion::Init

void CSIBCQuaternion::operator= const CSIBCQuaternion &    in_quat [inline]
 

Sets this quaternion equal to in_quat.

Parameters:
in_quat  Quaternion to set this quaternion equal to.
See also:
CSIBCQuaternion::Init(CSIBCQuaternion &)

SI_Error CSIBCQuaternion::SelfTest   [inline]
 

Tests to see whether this quaternion is valid. If the quaternion is invalid, an assertion will occur.

Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion is valid.

SI_Error CSIBCQuaternion::Set SI_Float    in_dX,
SI_Float    in_dY,
SI_Float    in_dZ,
SI_Float    in_dW
[inline]
 

Sets all components of the quaternion.

Parameters:
in_dX  Value for the X component of the quaternion.
in_dY  Value for the Y component of the quaternion.
in_dZ  Value for the Z component of the quaternion.
in_dW  Value for the W component of the quaternion.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly set.
See also:
CSIBCQuaternion::SetX , CSIBCQuaternion::SetY , CSIBCQuaternion::SetZ , CSIBCQuaternion::SetW

SI_Error CSIBCQuaternion::SetW SI_Float    in_dW [inline]
 

Sets the W component of the quaternion.

Parameters:
in_dW  The new values for the W component of the quaternion.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly set.
See also:
CSIBCQuaternion::Set , CSIBCQuaternion::SetX , CSIBCQuaternion::SetY , CSIBCQuaternion::SetZ , CSIBCQuaternion::GetW

SI_Error CSIBCQuaternion::SetX SI_Float    in_dX [inline]
 

Sets the X component of the quaternion.

Parameters:
in_dX  The new values for the X component of the quaternion.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly set.
See also:
CSIBCQuaternion::Set , CSIBCQuaternion::SetY , CSIBCQuaternion::SetZ , CSIBCQuaternion::SetW , CSIBCQuaternion::GetX

SI_Error CSIBCQuaternion::SetY SI_Float    in_dY [inline]
 

Sets the Y component of the quaternion.

Parameters:
in_dY  The new values for the Y component of the quaternion.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly set.
See also:
CSIBCQuaternion::Set , CSIBCQuaternion::SetX , CSIBCQuaternion::SetZ , CSIBCQuaternion::SetW , CSIBCQuaternion::GetY

SI_Error CSIBCQuaternion::SetZ SI_Float    in_dZ [inline]
 

Sets the Z component of the quaternion.

Parameters:
in_dZ  The new values for the Z component of the quaternion.
Returns:
SI_Error Error code indicating the success or failure of this command.
    Possible returns:
  • SI_SUCCESS - The quaternion was properly set.
See also:
CSIBCQuaternion::Set , CSIBCQuaternion::SetX , CSIBCQuaternion::SetY , CSIBCQuaternion::SetW , CSIBCQuaternion::GetZ


The documentation for this class was generated from the following files: © Copyright 2001-2003 Avid Technology, Inc. All rights reserved.

© Copyright 2001-2003 Avid Technology, Inc. All rights reserved.