Trait Quaternion

Source
pub trait Quaternion {
Show 16 methods // Required methods fn as_ptr_mut(&mut self) -> *mut dReal; fn as_ptr(&self) -> *const dReal; fn prec_eq(&self, e: dReal, q: dQuaternion) -> bool; fn as_vec(&self) -> ODEMat<'_>; // Provided methods fn new() -> dQuaternion { ... } fn from_R(m: dMatrix3) -> dQuaternion { ... } fn to_R(&self) -> dMatrix3 { ... } fn from_axis_and_angle(axis: [dReal; 3], angle: dReal) -> dQuaternion { ... } fn multiply0(p: dQuaternion, q: dQuaternion) -> dQuaternion { ... } fn multiply0_pp(p: *const dReal, q: *const dReal) -> dQuaternion { ... } fn multiply0_331(m: dMatrix3, v: dVector3) -> dVector3 { ... } fn multiply0_331_pp(m: *const dReal, v: *const dReal) -> dVector3 { ... } fn multiply0_441(m: dMatrix4, v: dVector4) -> dVector4 { ... } fn multiply0_441_pp(m: *const dReal, v: *const dReal) -> dVector4 { ... } fn conjugate(q: dQuaternion) -> dQuaternion { ... } fn conjugate_ptr(q: *const dReal) -> dQuaternion { ... }
}
Expand description

constructor and converter for primitive type

Required Methods§

Source

fn as_ptr_mut(&mut self) -> *mut dReal

ptr mut of dQuaternion

Source

fn as_ptr(&self) -> *const dReal

ptr of dQuaternion (use for converter)

Source

fn prec_eq(&self, e: dReal, q: dQuaternion) -> bool

check equal with precision

Source

fn as_vec(&self) -> ODEMat<'_>

for Debug

Provided Methods§

Source

fn new() -> dQuaternion

construct as Identity

Source

fn from_R(m: dMatrix3) -> dQuaternion

constructor (converter)

Source

fn to_R(&self) -> dMatrix3

converter (like as dMatrix3::from_Q(*self))

Source

fn from_axis_and_angle(axis: [dReal; 3], angle: dReal) -> dQuaternion

constructor axis [x, y, z] should be norm == 1, angle is theta radian Q(axis, angle) == [cos(t/2), xsin(t/2), ysin(t/2), zsin(t/2)]

Source

fn multiply0(p: dQuaternion, q: dQuaternion) -> dQuaternion

constructor multiply p: dQuaternion and q: dQuaternion

Source

fn multiply0_pp(p: *const dReal, q: *const dReal) -> dQuaternion

constructor multiply p: dQuaternion pointer and q: dQuaternion pointer

Source

fn multiply0_331(m: dMatrix3, v: dVector3) -> dVector3

constructor multiply m: dMatrix3 and v: dVector3 dVector3::multiply0_331 is defined as dQuaternion::multiply0_331

Source

fn multiply0_331_pp(m: *const dReal, v: *const dReal) -> dVector3

constructor multiply m: dMatrix3 pointer and v: dVector3 pointer dVector3::multiply0_331_pp is defined as dQuaternion::multiply0_331_pp

Source

fn multiply0_441(m: dMatrix4, v: dVector4) -> dVector4

constructor multiply m: dMatrix4 and v: dVector4 dVector4::multiply0_441 is defined as dQuaternion::multiply0_441

Source

fn multiply0_441_pp(m: *const dReal, v: *const dReal) -> dVector4

constructor multiply m: dMatrix4 pointer and v: dVector4 pointer dVector4::multiply0_441_pp is defined as dQuaternion::multiply0_441_pp

Source

fn conjugate(q: dQuaternion) -> dQuaternion

conjugate dQuaternion

Source

fn conjugate_ptr(q: *const dReal) -> dQuaternion

conjugate dQuaternion pointer

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§