Quaternion: ReadonlyQuaternion

Quaternion is a type and a namespace.

  • The namespace contains all types and functions to operates with Quaternion
  • The type Quaternion is an alias to Quaternion.ReadonlyQuaternion

// Namespace usage example
const next = Quaternion.add(pointA, velocityA)

// Type usage example
const readonlyRotation: Quaternion = Quaternion.Zero()
readonlyRotation.x = 0.1 // this FAILS

// For mutable usage, use `Quaternion.Mutable`
const rotation: Quaternion.Mutable = Quaternion.Identity()
rotation.x = 3.0 // this WORKS