Documentation
¶
Overview ¶
Package quat32 operates on float32 quaternions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Quaternion ¶
type Quaternion [4]float32
A Quaternion holds a four-dimensional quaternion. The values are stored in {X, Y, Z, W} order.
func AxisAngle ¶
func AxisAngle(axis vec32.Vector, angle float32) Quaternion
AxisAngle builds a new quaternion from a vector (which will be normalized) and an angle in radians.
func Mul ¶
func Mul(q1, q2 Quaternion) Quaternion
Mul calculates the product of q1 and q2. The result corresponds to the rotation q2 followed by the rotation q1.
func (Quaternion) Conjugate ¶
func (q Quaternion) Conjugate() Quaternion
Conjugate returns q's conjugate.
func (Quaternion) LengthSqr ¶
func (q Quaternion) LengthSqr() float32
LengthSqr returns the norm squared of q. This is cheaper to compute than Length.
func (Quaternion) Negate ¶
func (q Quaternion) Negate() Quaternion
Negate returns a new quaternion that applies an opposite rotation.
Click to show internal directories.
Click to hide internal directories.