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)

Quatf(s: float, d: V3f)

Initialize with real part s and imaginary vector d

__eq__(o: Quatf) bool

Equality

__neq__(o: Quatf) bool

Inequality

__getitem__(i: int) float

Element access: q[0] is the real part, (q[1],q[2],q[3]) is the imaginary part.

__xor__(o: Quatf) float

4D dot product

__mul__(o: Quatf) Quatf

Quaternion multiplication

__mul__(t: float) Quatf

Quaternion*scalar multiplication

__truediv__(o: Quatf) Quatf

Quaternion division

__truediv__(t: float) Quatf

Quaternion division

__add__(q2: Quatf) Quatf

Quaternion addition

__sub__(q2: Quatf) Quatf

Quaternion subtraction

angle() float

Return the angle of the axis/angle representation in radians

axis() V3f

Return the axis of the axis/angle representation

euclideanInnerProduct(q: Quatf) float

Return the Euclidean inner product

exp() Quatf

Return the exponent of the quaternion

inverse() Quatf

Return 1/this, leaving this unchanged.

invert()

Invert in place: this = 1 / this

log() Quatf

Return the logarithm of the quaternion

length() float

Return the R4 length

normalize()

Normalize in place

normalized() Quatf

Return a normalized quaternion, leaving this unmodified.

rotateVector(v: V3f) V3f

Rotate the given point by the quaternion.

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