Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Math.Quaternion.Quaternion Class Reference

Public Member Functions

None __init__ (self, float x=0.0, float y=0.0, float z=0.0, float w=1.0)
 
 getData (self)
 
 x (self)
 
 y (self)
 
 z (self)
 
 w (self)
 
None setByAngleAxis (self, float angle, Vector axis)
 
 __mul__ (self, other)
 
 __imul__ (self, other)
 
 __add__ (self, other)
 
 __iadd__ (self, other)
 
 __truediv__ (self, other)
 
 __itruediv__ (self, other)
 
 __eq__ (self, other)
 
 __neg__ (self)
 
"Quaternion" getInverse (self)
 
"Quaternion" invert (self)
 
 rotate (self, vector)
 
 dot (self, other)
 
float length (self)
 
None normalize (self)
 
None setByMatrix (self, Matrix matrix, bool ensure_unit_length=False)
 
Matrix toMatrix (self)
 
 __repr__ (self)
 
 __str__ (self)
 

Static Public Member Functions

 slerp (start, end, amount)
 
 rotationTo (v1, v2)
 
"Quaternion" fromMatrix (Matrix matrix)
 
"Quaternion" fromAngleAxis (float angle, Vector axis)
 

Public Attributes

 x
 
 y
 
 z
 
 w
 

Static Public Attributes

float EPS = numpy.finfo(float).eps * 4.0
 

Protected Attributes

 _data
 

Detailed Description

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.

Member Function Documentation

◆ rotationTo()

UM.Math.Quaternion.Quaternion.rotationTo ( v1,
v2 )
static
Returns a quaternion representing the rotation from vector 1 to vector 2.

:param v1: :type{Vector} The vector to rotate from.
:param v2: :type{Vector} The vector to rotate to.

◆ setByAngleAxis()

None UM.Math.Quaternion.Quaternion.setByAngleAxis ( self,
float angle,
Vector axis )
Set quaternion by providing rotation about an axis.

:param angle: :type{float} Angle in radians
:param axis: :type{Vector} Axis of rotation

◆ setByMatrix()

None UM.Math.Quaternion.Quaternion.setByMatrix ( self,
Matrix matrix,
bool ensure_unit_length = False )
Set quaternion by providing a homogeneous (4x4) rotation matrix.

:param matrix: 4x4 Matrix object
:param ensure_unit_length:

The documentation for this class was generated from the following file: