- class Quatf
A 32 bits float quaternion.
- w:float
- x:float
- y:float
- z:float
- Quatf()
Default constructor is the identity quat
- Quatf(s: float, i: float, j: float, k: float)
Initialize with real part s and imaginary vector (i,j,k)
- __getitem__(i: int) float
Element access: q[0] is the real part, (q[1],q[2],q[3]) is the imaginary part.
- angle() float
Return the angle of the axis/angle representation in radians
- invert()
Invert in place: this = 1 / this
- length() float
Return the R4 length
- normalize()
Normalize in place
- setRotation(fromDirection: Vec3, toDirection: Vec3)
Set the quaternion to be a rotation that transforms the direction vector fromDirection to toDirection.
- setAxisAngle(axis: Vec3, angle: Vec3)
Set the quaternion to be a rotation around the given axis by the given angle in radians.
- toMatrix33()
Return a 3x3 rotation matrix
- toMatrix44()
Return a 4x4 rotation matrix