Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Runtime classServer APIGenerated

Quaternion

Defined in: server/api.d.ts:3510

Mutable quaternion for three-dimensional rotations. Components are scalar-first (w, x, y, z), matching GLM — not the x, y, z, w order some libraries use.

new Quaternion(w, x, y, z): Quaternion

Defined in: server/api.d.ts:3518

Creates a quaternion in scalar-first w, x, y, z component order. Watch the trap: the scalar w is the first argument, unlike the x, y, z, w order used by some other libraries.

number

Initial scalar component (comes first — this is not x, y, z, w order).

number

Initial X imaginary component.

number

Initial Y imaginary component.

number

Initial Z imaginary component.

Quaternion

clone(): Quaternion

Defined in: server/api.d.ts:3617

Creates an independent copy of this quaternion.

Quaternion

New quaternion with the same components.


conjugate(): Quaternion

Defined in: server/api.d.ts:3567

Computes the conjugate without changing this quaternion.

Quaternion

New conjugated quaternion.


dot(other): number

Defined in: server/api.d.ts:3588

Computes the quaternion dot product.

Quaternion

Quaternion used for the dot product.

number

Scalar dot product.


inverse(): Quaternion

Defined in: server/api.d.ts:3573

Computes the inverse rotation without changing this quaternion.

Quaternion

New inverse quaternion.


mul(other): this

Defined in: server/api.d.ts:3555

Composes this rotation with another quaternion in place.

Quaternion

Rotation composed after this quaternion.

this

This mutated quaternion for chaining.


normalize(): this

Defined in: server/api.d.ts:3561

Normalizes this quaternion in place; a zero quaternion becomes the identity rotation instead of NaN.

this

This unit quaternion for chaining.


rotateVector(vector): Vector3

Defined in: server/api.d.ts:3595

Applies this rotation to a vector without mutating either value.

Vector3

Vector to rotate.

Vector3

New rotated vector.


set(w, x, y, z): this

Defined in: server/api.d.ts:3611

Replaces all quaternion components in place.

number

Replacement scalar component.

number

Replacement X imaginary component.

number

Replacement Y imaginary component.

number

Replacement Z imaginary component.

this

This mutated quaternion for chaining.


slerp(target, t): this

Defined in: server/api.d.ts:3581

Spherically interpolates this quaternion toward a target in place.

Quaternion

Destination rotation.

number

Interpolation factor; 0 keeps the current rotation and 1 reaches target.

this

This mutated quaternion for chaining.


toEuler(): Vector3

Defined in: server/api.d.ts:3601

Converts this rotation to Euler angles in radians.

Vector3

Pitch, yaw, and roll as a Vector3.


toJSON(): object

Defined in: server/api.d.ts:3629

Converts this quaternion to a plain object for JSON.stringify.

object

Object containing the current components.

w: number

x: number

y: number

z: number


toString(): string

Defined in: server/api.d.ts:3623

Formats this quaternion for logging and debugging.

string

Text in Quaternion(w, x, y, z) form.


static fromAxisAngle(axis, angle): Quaternion

Defined in: server/api.d.ts:3652

Creates a rotation around an axis.

Vector3

Rotation axis; it is normalized internally.

number

Rotation angle in radians.

Quaternion

New axis-angle rotation quaternion.


static fromEuler(pitch, yaw, roll): Quaternion

Defined in: server/api.d.ts:3644

Creates a rotation from Euler angles.

number

Pitch angle in radians.

number

Yaw angle in radians.

number

Roll angle in radians.

Quaternion

New rotation quaternion.


static identity(): Quaternion

Defined in: server/api.d.ts:3635

Creates the identity rotation.

Quaternion

New Quaternion(1, 0, 0, 0).

readonly length: number

Defined in: server/api.d.ts:3543

Read-only magnitude (norm) of this quaternion; 1 for a unit rotation.


readonly lengthSquared: number

Defined in: server/api.d.ts:3548

Read-only squared magnitude, avoiding a square-root calculation.


w: number

Defined in: server/api.d.ts:3523

Mutable scalar component.


x: number

Defined in: server/api.d.ts:3528

Mutable X imaginary component.


y: number

Defined in: server/api.d.ts:3533

Mutable Y imaginary component.


z: number

Defined in: server/api.d.ts:3538

Mutable Z imaginary component.