Euler
Math.Euler exported from @manycore/aholo-viewer.
Constructors
Constructor
new Euler(
x?,y?,z?,order?):Euler
Parameters
x?
number
y?
number
z?
number
order?
string
Returns
Euler
Properties
_x
_x:
number
The angle of the x axis in radians.
_y
_y:
number
The angle of the y axis in radians.
_z
_z:
number
The angle of the z axis in radians.
_order
_order:
string
A string representing the order that the rotations are applied.
isEuler
isEuler:
boolean
Check the type whether it belongs to Euler. This value should not be changed by user.
onChangeCallback
onChangeCallback:
Function
The function will be called when x, y z and order is changed.
RotationOrders
staticRotationOrders:string[]
All possible value for order.
DefaultOrder
staticDefaultOrder:string
The default of order.
Accessors
x
Get Signature
get x():
number
Returns
number
Set Signature
set x(
value):void
Parameters
value
number
Returns
void
y
Get Signature
get y():
number
Returns
number
Set Signature
set y(
value):void
Parameters
value
number
Returns
void
z
Get Signature
get z():
number
Returns
number
Set Signature
set z(
value):void
Parameters
value
number
Returns
void
order
Get Signature
get order():
string
Returns
string
Set Signature
set order(
value):void
Parameters
value
string
Returns
void
Methods
set()
set(
x,y,z,order?):Euler
Sets the angles of this euler transform and optionally the order.
Parameters
x
number
y
number
z
number
order?
string
Returns
Euler
clone()
clone():
Euler
Returns a new Euler with the same parameters as this one.
Returns
Euler
copy()
copy(
euler):Euler
Copies value of euler to this euler.
Parameters
euler
Euler
Returns
Euler
setFromRotationMatrix()
setFromRotationMatrix(
m,order?,update?):Euler
Sets the angles of this euler transform from a pure rotation matrix based on the orientation specified by order.
Parameters
m
a Matrix4 of which the upper 3x3 of matrix is a pure rotation matrix (i.e. unscaled).
order?
string
(optional) a string representing the order that the rotations are applied.
update?
boolean
Returns
Euler
setFromQuaternion()
setFromQuaternion(
q,order?,update?):Euler
Sets the angles of this euler transform from a normalized quaternion based on the orientation specified by order.
Parameters
q
a normalized quaternion.
order?
string
(optional) a string representing the order that the rotations are applied.
update?
boolean
Returns
Euler
setFromVector3()
setFromVector3(
v,order?):Euler
Set the x, y and z from vector, and optionally update the order.
Parameters
v
order?
string
(optional) a string representing the order that the rotations are applied.
Returns
Euler
reorder()
reorder(
newOrder):Euler
Resets the euler angle with a new order by creating a quaternion from this euler angle and then setting this euler angle with the quaternion and the new order.
Parameters
newOrder
string
Returns
Euler
WARNING
this discards revolution information.
equals()
equals(
euler):boolean
Checks for strict equality of this euler and euler.
Parameters
euler
Euler
Returns
boolean
fromArray()
fromArray(
array):Euler
Array of length 3 or 4. The optional 4th argument corresponds from the order. Assigns this euler’s x angle from array[0]. Assigns this euler’s y angle from array[1]. Assigns this euler’s z angle from array[2]. Optionally assigns this euler’s order from array[3].
Parameters
array
ArrayLike<number>
Returns
Euler
toArray()
toArray(
array?,offset?):number[]
Returns an array of the form [x, y, z, order].
Parameters
array?
number[]
(optional) array to store the euler in.
offset?
number
(optional) offset in the array.
Returns
number[]
toVector3()
toVector3(
optionalResult?):Vector3
Parameters
optionalResult?
(optional) If specified, the result will be copied into this Vector, otherwise a new one will be created. Returns the Euler’s x, y and z properties as a Vector3.
Returns
onChange()
onChange(
callback):void
A method to call onChangeCallback.
Parameters
callback
Function
Returns
void