IC8 Python API:RLPy RQuaternion
Contents
- 1 Description
- 2 Constructor & Destructor
- 3 Member Functions
- 3.1 AlmostEqual (self, qQ)
- 3.2 AlmostSame (self, qQ, tThreshold)
- 3.3 Conjugate (self)
- 3.4 Dot (self, qQ)
- 3.5 FindQuatBetweenHelper (A, B, NormAB)
- 3.6 FindQuatBetweenInternal (An, Bn)
- 3.7 FindQuatBetweenNormals (NormalA, NormalB)
- 3.8 FindQuatBetweenVectors (VectorA, VectorB)
- 3.9 FromAxisAngle (self, rkAxis, fAngle)
- 3.10 FromRotationMatrix (self, rkRot)
- 3.11 Inverse (self)
- 3.12 Multiply (self, qQ)
- 3.13 MultiplyAssign (self, qQ)
- 3.14 MultiplyVector (self, vPoint)
- 3.15 Normalize (self)
- 3.16 Rotate180 (self)
- 3.17 SetW (self, tW)
- 3.18 SetX (self, tX)
- 3.19 SetY (self, tY)
- 3.20 SetZ (self, tZ)
- 3.21 ToAxisAngle (self, rkAxis, rfAngle)
- 3.22 ToRotationMatrix (self)
- 3.23 W (self, *args)
- 3.24 X (self, *args)
- 3.25 Y (self, *args)
- 3.26 Z (self, *args)
- 3.27 __add__ (self, qQ)
- 3.28 __eq__ (self, qQ)
- 3.29 __ge__ (self, qQ)
- 3.30 __gt__ (self, qQ)
- 3.31 __iadd__ (self, qQ)
- 3.32 __imul__ (self, *args)
- 3.33 __isub__ (self, qQ)
- 3.34 __itruediv__ (self, *args)
- 3.35 __le__ (self, qQ)
- 3.36 __lt__ (self, qQ)
- 3.37 __mul__ (self, *args)
- 3.38 __ne__ (self, qQ)
- 3.39 __neg__ (self)
- 3.40 __sub__ (self, qQ)
- 3.41 __truediv__ (self, *args)
- 4 Properties
- 5 Constants
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
AlmostSame (self, qQ, tThreshold)
Reports whether this quaternion is approximately equal to another quaternion.
Parameters
- 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
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
MultiplyAssign (self, qQ)
Multiplies this quaternion by the supplied quaternion in place.
Parameters
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
__eq__ (self, qQ)
Reports whether this value equals another value.
Parameters
__ge__ (self, qQ)
Reports whether this value is greater than or equal to another value.
Parameters
__gt__ (self, qQ)
Reports whether this value is greater than another value.
Parameters
__iadd__ (self, qQ)
Adds another value to this value in place.
Parameters
__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
__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
__lt__ (self, qQ)
Reports whether this value is less than another value.
Parameters
__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
__neg__ (self)
Returns the negated value.
__sub__ (self, qQ)
The "subtraction" operator. Perform quaternion subtraction. See Also: -=
Parameters
__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