Class Quaternion
Hierarchy
- Quaternion
Index
Constructors
Accessors
Methods
- add
- add
In Place - as
Array - clone
- conjugate
- conjugate
In Place - conjugate
To Ref - copy
From - copy
From Floats - dot
- equals
- equals
With Epsilon - from
Rotation Matrix - get
Class Name - get
Hash Code - invert
- invert
In Place - length
- length
Squared - multiply
- multiply
In Place - multiply
To Ref - normalize
- normalize
From Length - normalize
To New - normalize
To Ref - scale
- scale
And Add To Ref - scale
In Place - scale
To Ref - set
- subtract
- subtract
In Place - to
Array - to
Euler Angles - to
Euler Angles To Ref - to
Rotation Matrix - to
String - Are
Close - Dot
- From
Array - From
Array To Ref - From
Euler Angles - From
Euler Angles To Ref - From
Euler Vector - From
Euler Vector To Ref - From
Look DirectionLH - From
Look DirectionLHTo Ref - From
Look DirectionRH - From
Look DirectionRHTo Ref - From
Rotation Matrix - From
Rotation Matrix To Ref - From
Unit Vectors To Ref - Hermite
- Hermite1st
Derivative - Hermite1st
Derivative To Ref - Identity
- Inverse
- Inverse
To Ref - Is
Identity - Normalize
- Normalize
To Ref - Rotation
Alpha Beta Gamma - Rotation
Alpha Beta Gamma To Ref - Rotation
Axis - Rotation
Axis To Ref - Rotation
Quaternion From Axis - Rotation
Quaternion From Axis To Ref - Rotation
Yaw Pitch Roll - Rotation
Yaw Pitch Roll To Ref - Slerp
- Slerp
To Ref - Smooth
To Ref - Zero
Constructors
constructor
Creates a new Quaternion from the given floats
Parameters
Optional x: number
defines the first component (0 by default)
Optional y: number
defines the second component (0 by default)
Optional z: number
defines the third component (0 by default)
Optional w: number
defines the fourth component (1.0 by default)
Returns Quaternion
Accessors
w
Gets or sets the w coordinate
Returns number
Gets or sets the w coordinate
Parameters
value: number
Returns void
x
Gets or sets the x coordinate
Returns number
Gets or sets the x coordinate
Parameters
value: number
Returns void
y
Gets or sets the y coordinate
Returns number
Gets or sets the y coordinate
Parameters
value: number
Returns void
z
Gets or sets the z coordinate
Returns number
Gets or sets the z coordinate
Parameters
value: number
Returns void
Methods
addSearch playground for add
Adds two quaternions Example Playground https://playground.babylonjs.com/#L49EJ7#10
Parameters
other: DeepImmutableObject<Quaternion>
defines the second operand
Returns Quaternion
a new quaternion as the addition result of the given one and the current quaternion
add In PlaceSearch playground for addInPlace
Add a quaternion to the current one Example Playground https://playground.babylonjs.com/#L49EJ7#11
Parameters
other: DeepImmutableObject<Quaternion>
defines the quaternion to add
Returns Quaternion
the current quaternion
as ArraySearch playground for asArray
Copy the quaternion to an array Example Playground https://playground.babylonjs.com/#L49EJ7#13
Returns number[]
a new array populated with 4 elements from the quaternion coordinates
cloneSearch playground for clone
Clone the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#12
Returns Quaternion
a new quaternion copied from the current one
conjugateSearch playground for conjugate
Conjugates (1-q) the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#83
Returns Quaternion
a new quaternion
conjugate In PlaceSearch playground for conjugateInPlace
Conjugates in place the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#82
Returns Quaternion
the current updated quaternion
conjugate To RefSearch playground for conjugateToRef
Conjugates the current quaternion and stores the result in the given quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#81
Type Parameters
T extends Quaternion<T>
Parameters
ref: T
defines the target quaternion
Returns T
result input
copy FromSearch playground for copyFrom
Copy a quaternion to the current one Example Playground https://playground.babylonjs.com/#L49EJ7#86
Parameters
other: DeepImmutableObject<Quaternion>
defines the other quaternion
Returns Quaternion
the updated current quaternion
copy From FloatsSearch playground for copyFromFloats
Updates the current quaternion with the given float coordinates Example Playground https://playground.babylonjs.com/#L49EJ7#87
Parameters
x: number
defines the x coordinate
y: number
defines the y coordinate
z: number
defines the z coordinate
w: number
defines the w coordinate
Returns Quaternion
the updated current quaternion
dotSearch playground for dot
Returns the dot product (float) between the current quaternions and "other"
Parameters
other: DeepImmutableObject<Quaternion>
defines the right operand
Returns number
the dot product
equalsSearch playground for equals
Check if two quaternions are equals Example Playground https://playground.babylonjs.com/#L49EJ7#38
Parameters
otherQuaternion: DeepImmutableObject<Quaternion>
defines the second operand
Returns boolean
true if the current quaternion and the given one coordinates are strictly equals
equals With EpsilonSearch playground for equalsWithEpsilon
Gets a boolean if two quaternions are equals (using an epsilon value) Example Playground https://playground.babylonjs.com/#L49EJ7#37
Parameters
otherQuaternion: DeepImmutableObject<Quaternion>
defines the other quaternion
Optional epsilon: number
defines the minimal distance to consider equality
Returns boolean
true if the given quaternion coordinates are close to the current ones by a distance of epsilon.
from Rotation MatrixSearch playground for fromRotationMatrix
Updates the current quaternion from the given rotation matrix values Example Playground https://playground.babylonjs.com/#L49EJ7#41
Parameters
matrix: DeepImmutableObject<Matrix>
defines the source matrix
Returns Quaternion
the current updated quaternion
get Class NameSearch playground for getClassName
Gets the class name of the quaternion
Returns string
the string "Quaternion"
get Hash CodeSearch playground for getHashCode
Gets a hash code for this quaternion
Returns number
the quaternion hash code
invertSearch playground for invert
Returns the inverse of the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#84
Returns Quaternion
a new quaternion
invert In PlaceSearch playground for invertInPlace
Invert in place the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#85
Returns Quaternion
this quaternion
lengthSearch playground for length
Gets length of current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#28
Returns number
the quaternion length (float)
length SquaredSearch playground for lengthSquared
Gets squared length of current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#29
Returns number
the quaternion length (float)
multiplySearch playground for multiply
Multiplies two quaternions Example Playground https://playground.babylonjs.com/#L49EJ7#43
Parameters
q1: DeepImmutableObject<Quaternion>
defines the second operand
Returns Quaternion
a new quaternion set as the multiplication result of the current one with the given one "q1"
multiply In PlaceSearch playground for multiplyInPlace
Updates the current quaternion with the multiplication of itself with the given one "q1" Example Playground https://playground.babylonjs.com/#L49EJ7#46
Parameters
q1: DeepImmutableObject<Quaternion>
defines the second operand
Returns Quaternion
the currentupdated quaternion
multiply To RefSearch playground for multiplyToRef
Sets the given "result" as the multiplication result of the current one with the given one "q1" Example Playground https://playground.babylonjs.com/#L49EJ7#45
Type Parameters
T extends Quaternion<T>
Parameters
q1: DeepImmutableObject<Quaternion>
defines the second operand
result: T
defines the target quaternion
Returns T
the current quaternion
normalizeSearch playground for normalize
Normalize in place the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#54
Returns Quaternion
the current updated quaternion
normalize From LengthSearch playground for normalizeFromLength
Normalize the current quaternion with the given input length. Please note that this is an in place operation.
Parameters
len: number
the length of the quaternion
Returns Quaternion
the current updated Quaternion
normalize To NewSearch playground for normalizeToNew
Normalize a copy of the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#55
Returns Quaternion
the normalized quaternion
normalize To RefSearch playground for normalizeToRef
Normalize the current Quaternion to the reference
Type Parameters
T extends Quaternion<T>
Parameters
reference: T
define the Quaternion to update
Returns T
the updated Quaternion
scaleSearch playground for scale
Multiplies the current quaternion by a scale factor Example Playground https://playground.babylonjs.com/#L49EJ7#88
Parameters
value: number
defines the scale factor
Returns Quaternion
a new quaternion set by multiplying the current quaternion coordinates by the float "scale"
scale And Add To RefSearch playground for scaleAndAddToRef
Scale the current quaternion values by a factor and add the result to a given quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#91
Type Parameters
T extends Quaternion<T>
Parameters
scale: number
defines the scale factor
result: T
defines the Quaternion object where to store the result
Returns T
result input
scale In PlaceSearch playground for scaleInPlace
Multiplies in place the current quaternion by a scale factor Example Playground https://playground.babylonjs.com/#L49EJ7#90
Parameters
value: number
defines the scale factor
Returns Quaternion
the current modified quaternion
scale To RefSearch playground for scaleToRef
Scale the current quaternion values by a factor and stores the result to a given quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#89
Type Parameters
T extends Quaternion<T>
Parameters
scale: number
defines the scale factor
result: T
defines the Quaternion object where to store the result
Returns T
result input
setSearch playground for set
Updates the current quaternion from the given float coordinates Example Playground https://playground.babylonjs.com/#L49EJ7#56
Parameters
x: number
defines the x coordinate
y: number
defines the y coordinate
z: number
defines the z coordinate
w: number
defines the w coordinate
Returns Quaternion
the updated current quaternion
subtractSearch playground for subtract
Subtract two quaternions Example Playground https://playground.babylonjs.com/#L49EJ7#57
Parameters
other: Quaternion
defines the second operand
Returns Quaternion
a new quaternion as the subtraction result of the given one from the current one
subtract In PlaceSearch playground for subtractInPlace
Subtract a quaternion to the current one Example Playground https://playground.babylonjs.com/#L49EJ7#58
Parameters
other: DeepImmutableObject<Quaternion>
defines the quaternion to subtract
Returns Quaternion
the current quaternion
to ArraySearch playground for toArray
Stores from the starting index in the given array the Quaternion successive values Example Playground https://playground.babylonjs.com/#L49EJ7#59
Parameters
array: FloatArray
defines the array where to store the x,y,z,w components
Optional index: number
defines an optional index in the target array to define where to start storing values
Returns Quaternion
the current Quaternion object
to Euler AnglesSearch playground for toEulerAngles
Returns a new Vector3 set with the Euler angles translated from the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#32
Returns Vector3
a new Vector3 containing the Euler angles
to Euler Angles To RefSearch playground for toEulerAnglesToRef
Sets the given vector3 "result" with the Euler angles translated from the current quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#31
Type Parameters
T extends Vector3<T>
Parameters
result: T
defines the vector which will be filled with the Euler angles
Returns T
result input
to Rotation MatrixSearch playground for toRotationMatrix
Updates the given rotation matrix with the current quaternion values Example Playground https://playground.babylonjs.com/#L49EJ7#67
Type Parameters
T extends Matrix<T>
Parameters
result: T
defines the target matrix
Returns T
the updated matrix with the rotation
to StringSearch playground for toString
Gets a string representation for the current quaternion
Returns string
a string with the Quaternion coordinates
Static Are CloseSearch playground for AreClose
Checks if the orientations of two rotation quaternions are close to each other Example Playground https://playground.babylonjs.com/#L49EJ7#60
Parameters
quat0: DeepImmutableObject<Quaternion>
defines the first quaternion to check
quat1: DeepImmutableObject<Quaternion>
defines the second quaternion to check
Optional epsilon: number
defines closeness, 0 same orientation, 1 PI apart, default 0.1
Returns boolean
true if the two quaternions are close to each other within epsilon
Static DotSearch playground for Dot
Returns the dot product (float) between the quaternions "left" and "right" Example Playground https://playground.babylonjs.com/#L49EJ7#61
Parameters
left: DeepImmutableObject<Quaternion>
defines the left operand
right: DeepImmutableObject<Quaternion>
defines the right operand
Returns number
the dot product
Static From ArraySearch playground for FromArray
Creates a new quaternion from data stored into an array Example Playground https://playground.babylonjs.com/#L49EJ7#63
Parameters
array: DeepImmutableObject<ArrayLike<number>>
defines the data source
Optional offset: number
defines the offset in the source array where the data starts
Returns Quaternion
a new quaternion
Static From Array To RefSearch playground for FromArrayToRef
Updates the given quaternion "result" from the starting index of the given array. Example Playground https://playground.babylonjs.com/#L49EJ7#64
Type Parameters
T extends Quaternion<T>
Parameters
array: DeepImmutableObject<ArrayLike<number>>
the array to pull values from
offset: number
the offset into the array to start at
result: T
the quaternion to store the result in
Returns T
result input
Static From Euler AnglesSearch playground for FromEulerAngles
Create a quaternion from Euler rotation angles Example Playground https://playground.babylonjs.com/#L49EJ7#33
Parameters
x: number
Pitch
y: number
Yaw
z: number
Roll
Returns Quaternion
the new Quaternion
Static From Euler Angles To RefSearch playground for FromEulerAnglesToRef
Updates a quaternion from Euler rotation angles Example Playground https://playground.babylonjs.com/#L49EJ7#34
Type Parameters
T extends Quaternion<T>
Parameters
x: number
Pitch
y: number
Yaw
z: number
Roll
result: T
the quaternion to store the result
Returns T
the updated quaternion
Static From Euler VectorSearch playground for FromEulerVector
Create a quaternion from Euler rotation vector Example Playground https://playground.babylonjs.com/#L49EJ7#35
Parameters
vec: DeepImmutableObject<Vector3>
the Euler vector (x Pitch, y Yaw, z Roll)
Returns Quaternion
the new Quaternion
Static From Euler Vector To RefSearch playground for FromEulerVectorToRef
Updates a quaternion from Euler rotation vector Example Playground https://playground.babylonjs.com/#L49EJ7#36
Type Parameters
T extends Quaternion<T>
Parameters
vec: DeepImmutableObject<Vector3>
the Euler vector (x Pitch, y Yaw, z Roll)
result: T
the quaternion to store the result
Returns T
the updated quaternion
Static From Look DirectionLHSearch playground for FromLookDirectionLH
Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up". This function works in left handed mode Example Playground https://playground.babylonjs.com/#L49EJ7#96
Parameters
forward: DeepImmutableObject<Vector3>
defines the forward direction - Must be normalized and orthogonal to up.
up: DeepImmutableObject<Vector3>
defines the up vector for the entity - Must be normalized and orthogonal to forward.
Returns Quaternion
A new quaternion oriented toward the specified forward and up.
Static From Look DirectionLHTo RefSearch playground for FromLookDirectionLHToRef
Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion. This function works in left handed mode Example Playground https://playground.babylonjs.com/#L49EJ7#97
Type Parameters
T extends Quaternion<T>
Parameters
forward: DeepImmutableObject<Vector3>
defines the forward direction - Must be normalized and orthogonal to up.
up: DeepImmutableObject<Vector3>
defines the up vector for the entity - Must be normalized and orthogonal to forward.
ref: T
defines the target quaternion.
Returns T
result input
Static From Look DirectionRHSearch playground for FromLookDirectionRH
Creates a new rotation value to orient an object to look towards the given forward direction, the up direction being oriented like "up". This function works in right handed mode Example Playground https://playground.babylonjs.com/#L49EJ7#98
Parameters
forward: DeepImmutableObject<Vector3>
defines the forward direction - Must be normalized and orthogonal to up.
up: DeepImmutableObject<Vector3>
defines the up vector for the entity - Must be normalized and orthogonal to forward.
Returns Quaternion
A new quaternion oriented toward the specified forward and up.
Static From Look DirectionRHTo RefSearch playground for FromLookDirectionRHToRef
Creates a new rotation value to orient an object to look towards the given forward direction with the up direction being oriented like "up", and stores it in the target quaternion. This function works in right handed mode Example Playground https://playground.babylonjs.com/#L49EJ7#105
Type Parameters
T extends Quaternion<T>
Parameters
forward: DeepImmutableObject<Vector3>
defines the forward direction - Must be normalized and orthogonal to up.
up: DeepImmutableObject<Vector3>
defines the up vector for the entity - Must be normalized and orthogonal to forward.
ref: T
defines the target quaternion.
Returns T
result input
Static From Rotation MatrixSearch playground for FromRotationMatrix
Creates a new quaternion from a rotation matrix Example Playground https://playground.babylonjs.com/#L49EJ7#101
Parameters
matrix: DeepImmutableObject<Matrix>
defines the source matrix
Returns Quaternion
a new quaternion created from the given rotation matrix values
Static From Rotation Matrix To RefSearch playground for FromRotationMatrixToRef
Updates the given quaternion with the given rotation matrix values Example Playground https://playground.babylonjs.com/#L49EJ7#102
Type Parameters
T extends Quaternion<T>
Parameters
matrix: DeepImmutableObject<Matrix>
defines the source matrix
result: T
defines the target quaternion
Returns T
result input
Static From Unit Vectors To RefSearch playground for FromUnitVectorsToRef
Updates a quaternion so that it rotates vector vecFrom to vector vecTo Example Playground - https://playground.babylonjs.com/#L49EJ7#70
Type Parameters
T extends Quaternion<T>
Parameters
vecFrom: DeepImmutableObject<Vector3>
defines the direction vector from which to rotate
vecTo: DeepImmutableObject<Vector3>
defines the direction vector to which to rotate
result: T
the quaternion to store the result
Optional epsilon: number
defines the minimal dot value to define vecs as opposite. Default:
BABYLON.Epsilon
Returns T
the updated quaternion
Static HermiteSearch playground for Hermite
Interpolate between two quaternions using Hermite interpolation Example Playground https://playground.babylonjs.com/#L49EJ7#47
Type Parameters
T extends Quaternion<T>
Parameters
value1: DeepImmutable<T>
defines first quaternion
tangent1: DeepImmutableObject<Quaternion>
defines the incoming tangent
value2: DeepImmutableObject<Quaternion>
defines second quaternion
tangent2: DeepImmutableObject<Quaternion>
defines the outgoing tangent
amount: number
defines the target quaternion
Returns T
the new interpolated quaternion
Static Hermite1st DerivativeSearch playground for Hermite1stDerivative
Returns a new Quaternion which is the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2". Example Playground https://playground.babylonjs.com/#L49EJ7#48
Type Parameters
T extends Quaternion<T>
Parameters
value1: DeepImmutable<T>
defines the first control point
tangent1: DeepImmutableObject<Quaternion>
defines the first tangent
value2: DeepImmutableObject<Quaternion>
defines the second control point
tangent2: DeepImmutableObject<Quaternion>
defines the second tangent
time: number
define where the derivative must be done
Returns T
1st derivative
Static Hermite1st Derivative To RefSearch playground for Hermite1stDerivativeToRef
Update a Quaternion with the 1st derivative of the Hermite spline defined by the quaternions "value1", "value2", "tangent1", "tangent2". Example Playground https://playground.babylonjs.com/#L49EJ7#49
Type Parameters
T extends Quaternion<T>
Parameters
value1: DeepImmutableObject<Quaternion>
defines the first control point
tangent1: DeepImmutableObject<Quaternion>
defines the first tangent
value2: DeepImmutableObject<Quaternion>
defines the second control point
tangent2: DeepImmutableObject<Quaternion>
defines the second tangent
time: number
define where the derivative must be done
result: T
define where to store the derivative
Returns T
result input
Static IdentitySearch playground for Identity
Creates an identity quaternion
Returns Quaternion
the identity quaternion
Static InverseSearch playground for Inverse
Inverse a given quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#103
Type Parameters
T extends Quaternion<T>
Parameters
q: DeepImmutable<T>
defines the source quaternion
Returns T
a new quaternion as the inverted current quaternion
Static Inverse To RefSearch playground for InverseToRef
Inverse a given quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#104
Type Parameters
T extends Quaternion<T>
Parameters
q: Quaternion
defines the source quaternion
result: T
the quaternion the result will be stored in
Returns T
the result quaternion
Static Is IdentitySearch playground for IsIdentity
Gets a boolean indicating if the given quaternion is identity
Parameters
quaternion: DeepImmutableObject<Quaternion>
defines the quaternion to check
Returns boolean
true if the quaternion is identity
Static NormalizeSearch playground for Normalize
Returns a new Quaternion as the normalization of the given Quaternion
Parameters
quat: DeepImmutableObject<Quaternion>
defines the Quaternion to normalize
Returns Quaternion
the new Quaternion
Static Normalize To RefSearch playground for NormalizeToRef
Sets the given Quaternion "result" with the normalization of the given first Quaternion
Type Parameters
T extends Quaternion<T>
Parameters
quat: DeepImmutableObject<Quaternion>
defines the Quaternion to normalize
result: T
defines the Quaternion where to store the result
Returns T
result input
Static Rotation Alpha Beta GammaSearch playground for RotationAlphaBetaGamma
Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation Example Playground https://playground.babylonjs.com/#L49EJ7#68
Parameters
alpha: number
defines the rotation around first axis
beta: number
defines the rotation around second axis
gamma: number
defines the rotation around third axis
Returns Quaternion
the new quaternion
Static Rotation Alpha Beta Gamma To RefSearch playground for RotationAlphaBetaGammaToRef
Creates a new quaternion from the given Euler float angles expressed in z-x-z orientation and stores it in the target quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#69
Type Parameters
T extends Quaternion<T>
Parameters
alpha: number
defines the rotation around first axis
beta: number
defines the rotation around second axis
gamma: number
defines the rotation around third axis
result: T
defines the target quaternion
Returns T
result input
Static Rotation AxisSearch playground for RotationAxis
Creates a quaternion from a rotation around an axis Example Playground https://playground.babylonjs.com/#L49EJ7#72
Parameters
axis: DeepImmutableObject<Vector3>
defines the axis to use
angle: number
defines the angle to use
Returns Quaternion
a new quaternion created from the given axis (Vector3) and angle in radians (float)
Static Rotation Axis To RefSearch playground for RotationAxisToRef
Creates a rotation around an axis and stores it into the given quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#73
Type Parameters
T extends Quaternion<T>
Parameters
axis: DeepImmutableObject<Vector3>
defines the axis to use
angle: number
defines the angle to use
result: T
defines the target quaternion
Returns T
the target quaternion
Static Rotation Quaternion From AxisSearch playground for RotationQuaternionFromAxis
Creates a new quaternion containing the rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) Example Playground https://playground.babylonjs.com/#L49EJ7#75
Parameters
axis1: DeepImmutableObject<Vector3>
defines the first axis
axis2: DeepImmutableObject<Vector3>
defines the second axis
axis3: DeepImmutableObject<Vector3>
defines the third axis
Returns Quaternion
the new quaternion
Static Rotation Quaternion From Axis To RefSearch playground for RotationQuaternionFromAxisToRef
Creates a rotation value to reach the target (axis1, axis2, axis3) orientation as a rotated XYZ system (axis1, axis2 and axis3 are normalized during this operation) and stores it in the target quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#76
Type Parameters
T extends Quaternion<T>
Parameters
axis1: DeepImmutableObject<Vector3>
defines the first axis
axis2: DeepImmutableObject<Vector3>
defines the second axis
axis3: DeepImmutableObject<Vector3>
defines the third axis
ref: T
defines the target quaternion
Returns T
result input
Static Rotation Yaw Pitch RollSearch playground for RotationYawPitchRoll
Creates a new quaternion from the given Euler float angles (y, x, z) Example Playground https://playground.babylonjs.com/#L49EJ7#77
Parameters
yaw: number
defines the rotation around Y axis
pitch: number
defines the rotation around X axis
roll: number
defines the rotation around Z axis
Returns Quaternion
the new quaternion
Static Rotation Yaw Pitch Roll To RefSearch playground for RotationYawPitchRollToRef
Creates a new rotation from the given Euler float angles (y, x, z) and stores it in the target quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#78
Type Parameters
T extends Quaternion<T>
Parameters
yaw: number
defines the rotation around Y axis
pitch: number
defines the rotation around X axis
roll: number
defines the rotation around Z axis
result: T
defines the target quaternion
Returns T
result input
Static SlerpSearch playground for Slerp
Interpolates between two quaternions Example Playground https://playground.babylonjs.com/#L49EJ7#79
Parameters
left: DeepImmutableObject<Quaternion>
defines first quaternion
right: DeepImmutableObject<Quaternion>
defines second quaternion
amount: number
defines the gradient to use
Returns Quaternion
the new interpolated quaternion
Static Slerp To RefSearch playground for SlerpToRef
Interpolates between two quaternions and stores it into a target quaternion Example Playground https://playground.babylonjs.com/#L49EJ7#92
Type Parameters
T extends Quaternion<T>
Parameters
left: DeepImmutableObject<Quaternion>
defines first quaternion
right: DeepImmutableObject<Quaternion>
defines second quaternion
amount: number
defines the gradient to use
result: T
defines the target quaternion
Returns T
result input
Static Smooth To RefSearch playground for SmoothToRef
Smooth interpolation between two quaternions using Slerp Example Playground https://playground.babylonjs.com/#L49EJ7#93
Type Parameters
T extends Quaternion<T>
Parameters
source: Quaternion
source quaternion
goal: Quaternion
goal quaternion
deltaTime: number
current interpolation frame
lerpTime: number
total interpolation time
result: T
the smoothed quaternion
Returns T
Static ZeroSearch playground for Zero
Creates an empty quaternion
Returns Quaternion
a new quaternion set to (0.0, 0.0, 0.0)
Class used to store quaternion data Example Playground - Overview - https://playground.babylonjs.com/#L49EJ7#100
https://en.wikipedia.org/wiki/Quaternion
https://doc.babylonjs.com/features/featuresDeepDive/mesh/transforms