IC8 Python API:RLPy RQuaternion

From Reallusion Wiki!
Jump to: navigation, search

Contents

Description

This class represents a quaternion in mathematics. Quaternions represetn directions as a single rotation, just as rectangular coordinates represent positions as single vector. RQuaternion also defines some constants that can be used directly: {| class="wikitable" !Constant !Description |- |RQuaternion.IDENTITY |4D zero vector: (0, 0, 0, 1) |- |RQuaternion.ZERO |4D x unit vector: (0, 0, 0, 0) initialization value |}

Constructor & Destructor

__init__ (self, *args)

The constructor. Initialize a new RQuaternion object without initialization.

Parameters

  • args

Member Functions

AlmostEqual (self, qQ)

Determine if two quaternions are almost the same within a tolerance of 0.00001.

Parameters

  • qQ

AlmostSame (self, qQ, tThreshold)

Reports whether this quaternion is approximately equal to another quaternion.

Parameters

  • qQ
  • tThreshold

Conjugate (self)

Get the conjugate of this quaternion. The result is a quaternion whose x, y, and z values have been negated.

Dot (self, qQ)

Calculate the dot product of two quaternions.

Parameters

  • qQ

FindQuatBetweenHelper (A, B, NormAB)

Computes a quaternion from vectors A and B using the supplied NormAB value.

Parameters

  • A
  • B
  • NormAB

FindQuatBetweenInternal (An, Bn)

Computes an intermediate quaternion from the normalized vectors An and Bn.

Parameters

  • An
  • Bn

FindQuatBetweenNormals (NormalA, NormalB)

Computes the quaternion that rotates one normal direction to another.

Parameters

  • NormalA
  • NormalB

FindQuatBetweenVectors (VectorA, VectorB)

Computes the quaternion that rotates one vector direction to another.

Parameters

  • VectorA
  • VectorB

FromAxisAngle (self, rkAxis, fAngle)

Create a quaternion from axis angle.

Parameters

  • rkAxis
  • fAngle

FromRotationMatrix (self, rkRot)

Create a quaternion from a rotation matrix.

Parameters

  • rkRot

Inverse (self)

Get the inverse of this quaternion.

Multiply (self, qQ)

Multiply this quaternion by another quaternion.

Parameters

  • qQ

MultiplyAssign (self, qQ)

Multiplies this quaternion by the supplied quaternion in place.

Parameters

  • qQ

MultiplyVector (self, vPoint)

Rotates a vector by this quaternion.

Parameters

  • vPoint

Normalize (self)

Normalize this quaternion, e.g. with a magnitude of 2.

Rotate180 (self)

Rotate this quaternion by 180 degrees.

SetW (self, tW)

Set the value of the w-axis.

Parameters

  • tW

SetX (self, tX)

Set the value of the x-axis.

Parameters

  • tX

SetY (self, tY)

Set the value of the y-axis.

Parameters

  • tY

SetZ (self, tZ)

Set the value of the z-axis.

Parameters

  • tZ

ToAxisAngle (self, rkAxis, rfAngle)

Converts this quaternion to an axis-and-angle representation.

Parameters

  • rkAxis
  • rfAngle

ToRotationMatrix (self)

Converts this quaternion to a rotation matrix.

W (self, *args)

Returns the w component of this quaternion.

Parameters

  • args

X (self, *args)

Returns the x component of this quaternion.

Parameters

  • args

Y (self, *args)

Returns the y component of this quaternion.

Parameters

  • args

Z (self, *args)

Returns the z component of this quaternion.

Parameters

  • args

__add__ (self, qQ)

The "addition" operator. Perform quaternion addition. See Also: +=

Parameters

  • qQ

__eq__ (self, qQ)

Reports whether this value equals another value.

Parameters

  • qQ

__ge__ (self, qQ)

Reports whether this value is greater than or equal to another value.

Parameters

  • qQ

__gt__ (self, qQ)

Reports whether this value is greater than another value.

Parameters

  • qQ

__iadd__ (self, qQ)

Adds another value to this value in place.

Parameters

  • qQ

__imul__ (self, *args)

Multiplies this value by another value in place.

Parameters

  • args

__isub__ (self, qQ)

Subtracts another value from this value in place.

Parameters

  • qQ

__itruediv__ (self, *args)

Divides this value by another value in place.

Parameters

  • args

__le__ (self, qQ)

Reports whether this value is less than or equal to another value.

Parameters

  • qQ

__lt__ (self, qQ)

Reports whether this value is less than another value.

Parameters

  • qQ

__mul__ (self, *args)

The "multiplication" operator. Perform a scalar multiplication when the second operand is an integer or float. If the second operand is another quaternion, then the respective elements are multiplied. See Also: *=

Parameters

  • args

__ne__ (self, qQ)

The "not equal to" operator. See Also: ==

Parameters

  • qQ

__neg__ (self)

Returns the negated value.

__sub__ (self, qQ)

The "subtraction" operator. Perform quaternion subtraction. See Also: -=

Parameters

  • qQ

__truediv__ (self, *args)

The "division" operator. Perform a scalar division with a int or float value which the second operand is limited to. See Also: /=

Parameters

  • args

Properties

thisown

Indicates whether this SWIG proxy owns the underlying C++ object.

w

The quaternion's W component.

x

The quaternion's X component.

y

The quaternion's Y component.

z

The quaternion's Z component.

Constants

IDENTITY (*args)

Parameters

  • args

ZERO (*args)

Parameters

  • args