Unit Quaternion class based on numpy arrays.
More...
Inherits object.
|
| __init__ (self, x=0.0, y=0.0, z=0.0, w=1.0) |
|
| getData (self) |
|
| x (self) |
|
| y (self) |
|
| z (self) |
|
| w (self) |
|
| setByAngleAxis (self, angle, axis) |
| Set quaternion by providing rotation about an axis.
|
|
| __mul__ (self, other) |
|
| __imul__ (self, other) |
|
| __add__ (self, other) |
|
| __iadd__ (self, other) |
|
| __truediv__ (self, other) |
|
| __itruediv__ (self, other) |
|
| __eq__ (self, other) |
|
| __neg__ (self) |
|
| getInverse (self) |
|
| invert (self) |
|
| rotate (self, vector) |
|
| dot (self, other) |
|
| length (self) |
|
| normalize (self) |
|
| setByMatrix (self, matrix, is_precise=False) |
| Set quaternion by providing a homogenous (4x4) rotation matrix.
|
|
| toMatrix (self) |
|
| __repr__ (self) |
|
|
| slerp (start, end, amount) |
|
| rotationTo (v1, v2) |
| Returns a quaternion representing the rotation from vector 1 to vector 2.
|
|
| fromMatrix (matrix) |
|
| 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()
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()
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()
UM.Math.Quaternion.Quaternion.setByMatrix |
( |
|
self, |
|
|
|
matrix, |
|
|
|
is_precise = False |
|
) |
| |
Set quaternion by providing a homogenous (4x4) rotation matrix.
- Parameters
-
matrix | 4x4 Matrix object |
is_precise | |
The documentation for this class was generated from the following file: