Skip to content

Quaternion

Represents a quaternion used for rotations.

Not newable

This object cannot be created by scripts using Instance.New().

Properties

X : number

The X component of the quaternion.

Y : number

The Y component of the quaternion.

Z : number

The Z component of the quaternion.

W : number

The W component of the quaternion.

Identity : Quaternion

The identity rotation.

Methods

New → Quaternion

Parameters: ``

Creates a new Quaternion object with the specified components.

New → Quaternion

Parameters

x [ number ]

y [ number ]

z [ number ]

w [ number ]

Creates a new Quaternion object with the specified components.

Angle → Quaternion

Parameters

a [ Quaternion ]

b [ Quaternion ]

Calculates the angle between two quaternions.

AngleAxis → Quaternion

Parameters

angle [ number ]

axis [ Vector3 ]

Creates a rotation which rotates angle degrees around axis.

Dot → Quaternion

Parameters

a [ Quaternion ]

b [ Quaternion ]

Calculates the dot product of two quaternions.

Euler → Quaternion

Parameters

x [ number ]

y [ number ]

z [ number ]

Creates a quaternion from Euler angles specified by a Vector3.

Euler → Quaternion

Parameters: euler [ Vector3 ]

Creates a quaternion from Euler angles specified by a Vector3.

ToEuler → Vector3

Parameters: euler [ Quaternion ]

Converts a quaternion to Euler angles represented as a Vector3.

FromToRotation → Quaternion

Parameters

fromDirection [ Vector3 ]

toDirection [ Vector3 ]

Creates a rotation which rotates angle degrees around axis.

Inverse → Quaternion

Parameters: rotation [ Quaternion ]

Calculates the inverse of a quaternion.

Lerp → Quaternion

Parameters

a [ Quaternion ]

b [ Quaternion ]

t [ number ]

Linearly interpolates between two quaternions.

LerpUnclamped → Quaternion

Parameters

a [ Quaternion ]

b [ Quaternion ]

t [ number ]

Linearly interpolates between two quaternions without clamping the interpolant.

LookRotation → Quaternion

Parameters: forward [ Vector3 ]

Creates a rotation with the specified forward and upwards directions.

LookRotation → Quaternion

Parameters

forward [ Vector3 ]

upwards [ Vector3 ]

Creates a rotation with the specified forward and upwards directions.

Normalize → Quaternion

Parameters: quaternion [ Quaternion ]

Normalizes the given quaternion.

RotateTowards → Quaternion

Parameters

from [ Quaternion ]

to [ Quaternion ]

maxDegreesDelta [ number ]

Rotates a rotation from towards to by maxDegreesDelta.

Slerp → Quaternion

Parameters

a [ Quaternion ]

b [ Quaternion ]

t [ number ]

Spherically interpolates between two quaternions.

SlerpUnclamped → Quaternion

Parameters

a [ Quaternion ]

b [ Quaternion ]

t [ number ]

Spherically interpolates between two quaternions without clamping the interpolant.