pub struct Euler {
pub x: f64,
pub y: f64,
pub z: f64,
pub order: EulerOrder,
}Expand description
Port of three.js’ Euler: a rotation expressed as three angles (radians)
applied in a given EulerOrder. Unlike three.js, setting a field here
does not fire an onChange callback; see the module docs above.
Fields§
§x: f64The angle of the x axis in radians.
y: f64The angle of the y axis in radians.
z: f64The angle of the z axis in radians.
order: EulerOrderThe order in which the rotations are applied.
Implementations§
Source§impl Euler
impl Euler
Sourcepub fn new(x: f64, y: f64, z: f64) -> Self
pub fn new(x: f64, y: f64, z: f64) -> Self
new Euler( x, y, z ) — order defaults to Euler.DEFAULT_ORDER.
Sourcepub fn new_with_order(x: f64, y: f64, z: f64, order: EulerOrder) -> Self
pub fn new_with_order(x: f64, y: f64, z: f64, order: EulerOrder) -> Self
new Euler( x, y, z, order ).
Sourcepub fn set(&mut self, x: f64, y: f64, z: f64) -> &mut Self
pub fn set(&mut self, x: f64, y: f64, z: f64) -> &mut Self
Euler.set( x, y, z ) — keeps the current order.
Sourcepub fn set_with_order(
&mut self,
x: f64,
y: f64,
z: f64,
order: EulerOrder,
) -> &mut Self
pub fn set_with_order( &mut self, x: f64, y: f64, z: f64, order: EulerOrder, ) -> &mut Self
Euler.set( x, y, z, order ).
Sourcepub fn set_from_rotation_matrix(
&mut self,
m: &Matrix4,
order: EulerOrder,
) -> &mut Self
pub fn set_from_rotation_matrix( &mut self, m: &Matrix4, order: EulerOrder, ) -> &mut Self
Euler.setFromRotationMatrix(). Assumes the upper 3x3 of m is a pure
rotation (i.e. unscaled).
Sourcepub fn set_from_quaternion(
&mut self,
q: &Quaternion,
order: EulerOrder,
) -> &mut Self
pub fn set_from_quaternion( &mut self, q: &Quaternion, order: EulerOrder, ) -> &mut Self
Euler.setFromQuaternion().
Sourcepub fn set_from_vector3(&mut self, v: &Vector3) -> &mut Self
pub fn set_from_vector3(&mut self, v: &Vector3) -> &mut Self
Euler.setFromVector3() — keeps the current order.
Sourcepub fn reorder(&mut self, new_order: EulerOrder) -> &mut Self
pub fn reorder(&mut self, new_order: EulerOrder) -> &mut Self
Euler.reorder(): same rotation, different order. Note that information
can be lost, exactly as in three.js.
Sourcepub fn from_array(&mut self, array: &[f64]) -> &mut Self
pub fn from_array(&mut self, array: &[f64]) -> &mut Self
Euler.fromArray() — the order element of three.js’ array form has no
numeric equivalent, so only the three angles are read.