open class Quaternion(var w: Float = 1.0f, var x: Float = 0.0f, var y: Float = 0.0f, var z: Float = 0.0f)
| Name | Summary |
|---|---|
Quaternion | constructor(pitch: Float, yaw: Float, roll: Float) Constructor for creating a quaternion from pitch, yaw, and roll angles. constructor(w: Float = 1.0f, x: Float = 0.0f, y: Float = 0.0f, z: Float = 0.0f) |
| Name | Summary |
|---|---|
Companion | object Companion |
| Name | Summary |
|---|---|
w | open var w: Float |
x | open var x: Float |
y | open var y: Float |
z | open var z: Float |
| Name | Summary |
|---|---|
component1 | operator fun component1(): Float |
component2 | operator fun component2(): Float |
component3 | operator fun component3(): Float |
component4 | operator fun component4(): Float |
conjugate | fun conjugate(): Quaternion Calculates the conjugate of the quaternion. |
copy | fun copy(): Quaternion Returns a copy of this Quaternion. |
dot | fun dot(other: Quaternion): Float Calculates the dot product of two quaternions. |
equals | open operator override fun equals(other: Any?): Boolean |
hashCode | open override fun hashCode(): Int |
inverse | fun inverse(): Quaternion Calculates the inverse of the quaternion. |
nlerp | fun nlerp(dest: Quaternion, ratio: Float): Quaternion Performs normalized linear interpolation between the current quaternion and the destination quaternion. |
norm | fun norm(): Float Calculates the squared magnitude (length) of the quaternion. |
normalize | fun normalize(): Quaternion Normalizes the quaternion to have a magnitude of 1. |
removePitchAndRoll | fun removePitchAndRoll(): Quaternion Removes the pitch and roll components from the quaternion, leaving only the yaw component. |
slerp | fun slerp(dest: Quaternion, ratio: Float): Quaternion Performs spherical linear interpolation between the current quaternion and the destination quaternion. |
times | |
toEuler | |
toRotationMatrix44 | |
toString | open override fun toString(): String |
toVector4 | |
unaryMinus | inline operator fun unaryMinus(): Quaternion Negates the quaternion. |
object Companion
| Name | Summary |
|---|---|
fromRotationMatrix | fun fromRotationMatrix(matrix: Array<FloatArray>): Quaternion Creates a quaternion from a rotation matrix. |
getRandomQuat | fun getRandomQuat(): Quaternion Formula using "Choosing a Point from the Surface of a Sphere" authored by George Marsaglia Generates uniform random quaternion. |
lookRotation | |
lookRotationAroundY | fun lookRotationAroundY(forward: Vector3): Quaternion Creates a quaternion that represents a rotation around the Y-axis from the forward vector to the look-up vector. |