Quat

class Quat

Represents a quaternion.

Constructors

Link copied to clipboard
constructor(x: Float, y: Float, z: Float, w: Float)

Constructs a new Quat instance with the specified x, y, z, and w components.

constructor()

The default Quat constructor.

constructor(another: Quat)

Initializes a new Quat instance from another existing Quat instance.

constructor(rotAxis: Vector3, rotAngle: Float)

Initializes a Quat instance using an angle and axis of rotation.

Types

Link copied to clipboard
object Companion

The companion object of Quat.

Properties

Link copied to clipboard
val w: Float

The w position of the Quat.

Link copied to clipboard
val x: Float

The x position of the Quat.

Link copied to clipboard
val y: Float

The y position of the Quat.

Link copied to clipboard
val z: Float

The z position of the Quat.

Functions

Link copied to clipboard

Calculates and returns the conjugate of this quaternion.

Link copied to clipboard
operator fun div(scalar: Float): Quat

Overloads the / operator to perform element-wise division of this quaternion by a scalar value.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
fun equivalentCheck(other: Quat): Boolean

Determine whether two rotation operations are equivalent.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun isFinite(): Boolean

Check if the Quat instance value is finite.

Link copied to clipboard
fun length(): Float

Calculates the length (magnitude or norm) of this quaternion.

Link copied to clipboard
operator fun minus(other: Quat): Quat

Overloads the - operator to perform component-wise subtraction of another quaternion (other) from this quaternion (this).

Link copied to clipboard

Returns a new quaternion with the same direction as this quaternion but with a length (magnitude) of 1.0.

Link copied to clipboard
operator fun plus(other: Quat): Quat

Overloads the + operator to perform component-wise addition of this quaternion with another quaternion.

Link copied to clipboard

Rotates the given Vector3 by this quaternion.

Link copied to clipboard
operator fun times(other: Quat): Quat

Times two Quat instances.

operator fun times(scalar: Float): Quat

Overloads the * operator to perform multiplication of this quaternion by a scalar value.

Link copied to clipboard
fun toAngleAxis(): Pair<Float, Vector3>

Converts this quaternion to its equivalent angle-axis representation, with the angle returned in degrees.

Link copied to clipboard

Converts the Quat instance to the EulerAngles instance.

Link copied to clipboard

Converts this quaternion into an equivalent 4x4 rotation matrix.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
operator fun unaryMinus(): Quat

Overloads the unary minus operator (-) to perform component-wise negation of this quaternion.