Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/remapper/src/deps.ts>three.Quaternion

A framework for Beat Saber map scripting.
Go to Latest
class three.Quaternion
Re-export
import { three } from "https://deno.land/x/remapper@2.1.0/src/deps.ts";
const { Quaternion } = three;

Implementation of a quaternion. This is used for rotating things without incurring in the dreaded gimbal lock issue, amongst other advantages.

Examples

const quaternion = new THREE.Quaternion(); quaternion.setFromAxisAngle( new THREE.Vector3( 0, 1, 0 ), Math.PI / 2 ); const vector = new THREE.Vector3( 1, 0, 0 ); vector.applyQuaternion( quaternion );

Constructors

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

Properties

_onChangeCallback: () => void
readonly
isQuaternion: true
w: number
x: number
y: number
z: number

Methods

_onChange(callback: () => void): Quaternion
angleTo(q: Quaternion): number
clone(): this

Clones this quaternion.

copy(q: Quaternion): this

Copies values of q to this quaternion.

dot(v: Quaternion): number
equals(v: Quaternion): boolean
fromArray(array: number[] | ArrayLike<number>, offset?: number): this

Sets this quaternion's x, y, z and w value from the provided array or array-like.

deprecated
inverse(): Quaternion

Inverts this quaternion.

length(): number

Computes length of this quaternion.

lengthSq(): number

Multiplies this quaternion by b.

deprecated
multiplyVector3(v: any): any

Normalizes this quaternion.

set(
x: number,
y: number,
z: number,
w: number,
): Quaternion

Sets values of this quaternion.

setFromAxisAngle(axis: Vector3, angle: number): Quaternion

Sets this quaternion from rotation specified by axis and angle. Adapted from http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToQuaternion/index.htm. Axis have to be normalized, angle is in radians.

setFromEuler(euler: Euler, update?: boolean): Quaternion

Sets this quaternion from rotation specified by Euler angles.

slerp(qb: Quaternion, t: number): Quaternion
toArray(array?: number[], offset?: number): number[]

Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.

toArray(array: ArrayLike<number>, offset?: number): ArrayLike<number>

Copies x, y, z and w into the provided array-like.

[Symbol.iterator](): Generator<number, void>

Static Methods

multiplyQuaternionsFlat(
dst: number[],
dstOffset: number,
src0: number[],
srcOffset: number,
src1: number[],
stcOffset1: number,
): number[]
deprecated
slerp(
t: number,
): number
slerpFlat(
dst: number[],
dstOffset: number,
src0: number[],
srcOffset: number,
src1: number[],
stcOffset1: number,
t: number,
): Quaternion