Skip to main content

Euler

Struct Euler 

Source
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: f64

The angle of the x axis in radians.

§y: f64

The angle of the y axis in radians.

§z: f64

The angle of the z axis in radians.

§order: EulerOrder

The order in which the rotations are applied.

Implementations§

Source§

impl Euler

Source

pub fn new(x: f64, y: f64, z: f64) -> Self

new Euler( x, y, z ) — order defaults to Euler.DEFAULT_ORDER.

Source

pub fn new_with_order(x: f64, y: f64, z: f64, order: EulerOrder) -> Self

new Euler( x, y, z, order ).

Source

pub fn set(&mut self, x: f64, y: f64, z: f64) -> &mut Self

Euler.set( x, y, z ) — keeps the current order.

Source

pub fn set_with_order( &mut self, x: f64, y: f64, z: f64, order: EulerOrder, ) -> &mut Self

Euler.set( x, y, z, order ).

Source

pub fn copy(&mut self, euler: &Self) -> &mut Self

Euler.copy().

Source

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).

Source

pub fn set_from_quaternion( &mut self, q: &Quaternion, order: EulerOrder, ) -> &mut Self

Euler.setFromQuaternion().

Source

pub fn set_from_vector3(&mut self, v: &Vector3) -> &mut Self

Euler.setFromVector3() — keeps the current order.

Source

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.

Source

pub fn equals(&self, euler: &Self) -> bool

Euler.equals().

Source

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.

Source

pub fn to_array(&self) -> [f64; 3]

Euler.toArray(), angles only.

Trait Implementations§

Source§

impl Clone for Euler

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Euler

Source§

impl Debug for Euler

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Euler

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Euler

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Euler

Auto Trait Implementations§

§

impl Freeze for Euler

§

impl RefUnwindSafe for Euler

§

impl Send for Euler

§

impl Sync for Euler

§

impl Unpin for Euler

§

impl UnsafeUnpin for Euler

§

impl UnwindSafe for Euler

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,