-
staticQuat.axisAngleToQuat(axis, angle){Quat}
-
Computes a Quat representing a rotation around an axis.
Name |
Type |
Default |
Description |
axis |
Vec3
|
|
The axis of rotation. |
angle |
number
|
0.0
|
optional
The angle in radians to rotate around the axis. |
Returns:
-
staticQuat.getLookAtSourceDest(sourcePoint, destPoint){Quat}
-
Computes a Quat from from source point heading to the destination point.
Name |
Type |
Description |
sourcePoint |
Vec3
|
Source coordinate. |
destPoint |
Vec3
|
Destination coordinate. |
Returns:
-
staticQuat.getLookRotation(forward, up){Quat}
-
Computes a rotation from the given heading and up vector.
Name |
Type |
Description |
forward |
Vec3
|
Heading target coordinates. |
up |
Vec3
|
Up vector. |
Returns:
-
staticQuat.getRotationBetweenVectors(u, v){Quat}
-
Compute rotation between two vectors.
Name |
Type |
Description |
u |
Vec3
|
First vector. |
v |
Vec3
|
Second vector. |
Returns:
-
staticQuat.getRotationBetweenVectorsRes(u, v, res){Quat}
-
Compute rotation between two vectors.
Name |
Type |
Description |
u |
Vec3
|
First vector. |
v |
Vec3
|
Second vector. |
res |
Quat
|
|
Returns:
-
staticQuat.getRotationBetweenVectorsUp(source, dest, up){Quat}
-
Compute rotation between two vectors with around vector up
for exactly opposite vectors. If vectors exaclty in the same
direction than returns identity Quat.
Name |
Type |
Description |
source |
Vec3
|
First vector. |
dest |
Vec3
|
Second vector. |
up |
Vec3
|
Up vector. |
Returns:
-
staticQuat.xRotation(a){Quat}
-
Returns a Quat represents rotation around X axis.
Name |
Type |
Description |
a |
number
|
The angle in radians to rotate around the axis. |
Returns:
-
staticQuat.yRotation(a){Quat}
-
Returns a Quat represents rotation around Y axis.
Name |
Type |
Description |
a |
number
|
The angle in radians to rotate around the axis. |
Returns:
-
staticQuat.zRotation(a){Quat}
-
Returns a Quat represents rotation around Z axis.
Name |
Type |
Description |
a |
number
|
The angle in radians to rotate around the axis. |
Returns:
-
-
Computes the componentwise sum of two Quats.
Name |
Type |
Description |
q |
Quat
|
Quat to add. |
Returns:
-
-
Clear Quat. Sets zeroes.
Returns:
-
-
Duplicates a Quat instance.
Returns:
-
-
Gets the conjugate of the Quat.
Returns:
-
-
Copy Quat values.
Name |
Type |
Description |
q |
Quat
|
Copy Quat. |
Returns:
-
-
Computes the dot (scalar) product of two Quats.
Name |
Type |
Description |
q |
Quat
|
Second quatrnion. |
Returns:
Type |
Description |
number
|
- |
-
-
Returns axis and angle of the current Quat.
Returns:
-
-
Returns Euler's angles of the current Quat.
Returns:
-
-
Converts current Quat to the rotation 3x3 matrix.
- TODO
-
Returns:
-
-
Converts current Quat to the rotation 4x4 matrix.
Returns:
-
getPitch(reprojectAxis){number}
-
Returns a pitch angle in radians.
Name |
Type |
Description |
reprojectAxis |
Boolean
|
optional
- |
Returns:
Type |
Description |
number
|
- |
-
getRoll(reprojectAxis){Number}
-
Returns a roll angle in radians.
Name |
Type |
Description |
reprojectAxis |
Boolean
|
optional
- |
Returns:
Type |
Description |
Number
|
- |
-
getYaw(reprojectAxis){number}
-
Returns a yaw angle in radians.
Name |
Type |
Description |
reprojectAxis |
Boolean
|
optional
- |
Returns:
Type |
Description |
number
|
- |
-
-
Computes the inverse of the Quat.
Returns:
-
-
Compares two Quats.
Name |
Type |
Description |
q |
Quat
|
Second quatrnion. |
Returns:
Type |
Description |
Boolean
|
- |
-
-
Returns true if the components are zero.
Name |
Type |
Description |
q |
Quat
|
Quat to subtract. |
Returns:
-
-
Computes a magnitude of the Quat.
Returns:
Type |
Description |
number
|
- |
-
-
Computes a squared magnitude of the Quat.
Returns:
Type |
Description |
number
|
- |
-
-
Computes the product of two Quats.
Name |
Type |
Description |
q |
Quat
|
Quat to multiply. |
Returns:
-
-
Computes the product of two Quats.
Name |
Type |
Description |
q |
Quat
|
Quat to multiply. |
Returns:
-
-
Returns quatrenion and vector production.
Name |
Type |
Description |
v |
Vec3
|
3d Vector. |
Returns:
-
-
Current Quat normalization.
Returns:
-
-
Multiplies the provided Quat componentwise.
Name |
Type |
Description |
scale |
Number
|
The scalar to multiply with. |
Returns:
-
-
Multiplies the provided Quat componentwise by the provided scalar.
Name |
Type |
Description |
scale |
Number
|
The scalar to multiply with. |
Returns:
-
-
Sets Quat values.
Name |
Type |
Default |
Description |
x |
Number
|
0.0
|
optional
The X component. |
y |
Number
|
0.0
|
optional
The Y component. |
z |
Number
|
0.0
|
optional
The Z component. |
w |
Number
|
0.0
|
optional
The W component. |
Returns:
-
setFromAxisAngle(axis, angle){Quat}
-
Sets current Quat representing a rotation around an axis.
Name |
Type |
Description |
axis |
Vec3
|
The axis of rotation. |
angle |
number
|
The angle in radians to rotate around the axis. |
Returns:
-
setFromEulerAngles(pitch, yaw, roll){Quat}
-
Sets current Quat by Euler's angles.
Name |
Type |
Description |
pitch |
number
|
Pitch angle in degrees. |
yaw |
number
|
Yaw angle in degrees. |
roll |
number
|
Roll angle in degrees. |
Returns:
-
-
Computes a Quat from the provided 4x4 matrix instance.
Name |
Type |
Description |
m |
Mat4
|
The rotation matrix. |
Returns:
-
setFromSphericalCoords(lat, lon, angle){Quat}
-
Sets current quaternion by spherical coordinates.
Name |
Type |
Description |
lat |
number
|
Latitude. |
lon |
number
|
Longitude. |
angle |
number
|
Angle in radians. |
Returns:
-
-
Set current Quat instance to identity Quat.
Returns:
-
setLookRotation(forward, up){Quat}
-
Sets rotation with the given heading and up vectors.
Name |
Type |
Description |
forward |
Vec3
|
Heading target coordinates. |
up |
Vec3
|
Up vector. |
Returns:
-
-
Performs a spherical linear interpolation between two Quats.
Name |
Type |
Description |
b |
Quat
|
The end rotation Quat. |
t |
number
|
interpolation amount between the two Quats. |
Returns:
-
-
Computes the componentwise difference of two Quats.
Name |
Type |
Description |
q |
Quat
|
Quat to subtract. |
Returns:
-
-
Gets spherical coordinates.
Returns:
Type |
Description |
Object
|
Returns object with latitude, longitude and alpha. |
-
-
Converts Quat values to array.
Returns:
Type |
Description |
Array.<number>
|
- (exactly 4 entries) |