Threepp.Quaternion¶
Quaternion class
A quaternion representing a rotation. It does not suffer from gimbal lock.
Members¶
Constructors¶
Properties¶
Methods¶
- set
- copy
- setFromEuler
- setFromAxisAngle
- setFromRotationMatrix
- setFromUnitVectors
- angleTo
- rotateTowards
- identity
- invert
- conjugate
- dot
- lengthSq
- length
- normalize
- multiply
- premultiply
- multiplyQuaternions
- slerp
- slerpQuaternions
- equals
Quaternion¶
Constructor
Arguments
| Arguments | Default | Description |
|---|---|---|
x |
0 |
X component. |
y |
0 |
Y component. |
z |
0 |
Z component. |
w |
1 |
W component. |
Description
Constructor
x¶
Property \ Access: r/w
Description
X component (read-only)
y¶
Property \ Access: r/w
Description
Y component (read-only)
z¶
Property \ Access: r/w
Description
Z component (read-only)
w¶
Property \ Access: r/w
Description
W component (read-only)
set¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
x |
|
|
y |
|
|
z |
|
|
w |
|
Description
Sets the values
copy¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
Description
Copies another quaternion
setFromEuler¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
euler |
|
Description
Sets the quaternion from Euler angles
setFromAxisAngle¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
axis |
|
|
angle |
|
Description
Sets the quaternion from an axis and an angle
setFromRotationMatrix¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
m |
|
Description
Sets the quaternion from a rotation matrix
setFromUnitVectors¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
vFrom |
|
|
vTo |
|
Description
Sets the quaternion from two unit vectors
angleTo¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
Description
Angle to another quaternion
rotateTowards¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
|
step |
|
Description
Rotates toward another quaternion
identity¶
Method
Description
Resets to the identity quaternion
invert¶
Method
Description
Inverts the quaternion
conjugate¶
Method
Description
Conjugate
dot¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
Description
Dot product
lengthSq¶
Method
Description
Squared length
length¶
Method
Description
Length
normalize¶
Method
Description
Normalizes the quaternion
multiply¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
Description
Multiplies by a quaternion
premultiply¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
Description
Premultiplies by a quaternion
multiplyQuaternions¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
a |
|
|
b |
|
Description
Product of two quaternions
slerp¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
|
t |
|
Description
Spherical linear interpolation
slerpQuaternions¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
qa |
|
|
qb |
|
|
t |
|
Description
Spherical linear interpolation between two quaternions
equals¶
Method
Arguments
| Arguments | Default | Description |
|---|---|---|
q |
|
Description
Equality test