Unit Quaternion class based on numpy arrays.
More...
Inherits object.
|
def | __init__ (self, x=0.0, y=0.0, z=0.0, w=1.0) |
|
def | getData (self) |
|
def | x (self) |
|
def | y (self) |
|
def | z (self) |
|
def | w (self) |
|
def | setByAngleAxis (self, angle, axis) |
| Set quaternion by providing rotation about an axis. More...
|
|
def | __mul__ (self, other) |
|
def | __imul__ (self, other) |
|
def | __add__ (self, other) |
|
def | __iadd__ (self, other) |
|
def | __truediv__ (self, other) |
|
def | __itruediv__ (self, other) |
|
def | __eq__ (self, other) |
|
def | __neg__ (self) |
|
def | getInverse (self) |
|
def | invert (self) |
|
def | rotate (self, vector) |
|
def | dot (self, other) |
|
def | length (self) |
|
def | normalize (self) |
|
def | setByMatrix (self, matrix, ensure_unit_length=False) |
| Set quaternion by providing a homogeneous (4x4) rotation matrix. More...
|
|
def | toMatrix (self) |
|
def | __repr__ (self) |
|
def | __str__ (self) |
|
|
def | slerp (start, end, amount) |
|
def | rotationTo (v1, v2) |
| Returns a quaternion representing the rotation from vector 1 to vector 2. More...
|
|
def | fromMatrix (matrix) |
|
def | fromAngleAxis (angle, axis) |
|
|
float | EPS = numpy.finfo(float).eps * 4.0 |
|
Unit Quaternion class based on numpy arrays.
This class represents a Unit quaternion that can be used for rotations.
- Note
- The operations that modify this quaternion will ensure the length of the quaternion remains 1. This is done to make this class simpler to use.
◆ rotationTo()
def UM.Math.Quaternion.Quaternion.rotationTo |
( |
|
v1, |
|
|
|
v2 |
|
) |
| |
|
static |
Returns a quaternion representing the rotation from vector 1 to vector 2.
- Parameters
-
v1 | Vector The vector to rotate from. |
v2 | Vector The vector to rotate to. |
◆ setByAngleAxis()
def UM.Math.Quaternion.Quaternion.setByAngleAxis |
( |
|
self, |
|
|
|
angle, |
|
|
|
axis |
|
) |
| |
Set quaternion by providing rotation about an axis.
- Parameters
-
angle | float Angle in radians |
axis | Vector Axis of rotation |
◆ setByMatrix()
def UM.Math.Quaternion.Quaternion.setByMatrix |
( |
|
self, |
|
|
|
matrix, |
|
|
|
ensure_unit_length = False |
|
) |
| |
Set quaternion by providing a homogeneous (4x4) rotation matrix.
- Parameters
-
matrix | 4x4 Matrix object |
ensure_unit_length | |
The documentation for this class was generated from the following file: