Skip to content
On this page

Class: Quaternion

WebSG.Quaternion

A Quaternion class with x, y, z, and w components. The class provides methods to set the components of the quaternion using an array-like syntax.

Indexable

▪ [n: number]: number

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Quaternion()

Properties

length

Readonly length: number

The number of components in the quaternion.

Defined in

websg.d.ts:1014


w

w: number

The w-component of the quaternion.

Defined in

websg.d.ts:1003


x

x: number

The x-component of the quaternion.

Defined in

websg.d.ts:988


y

y: number

The y-component of the quaternion.

Defined in

websg.d.ts:993


z

z: number

The z-component of the quaternion.

Defined in

websg.d.ts:998

Methods

set

set(value): Quaternion

Sets the quaternion components to the given values.

Parameters

NameTypeDescription
valueArrayLike<number>An array-like object containing the quaternion components.

Returns

Quaternion

Defined in

websg.d.ts:1009