Struct Motor
pub struct Motor {
pub r: [f32; 4],
pub d: [f32; 4],
}Expand description
PGA motor — matches WGSL Motor { r: vec4, d: vec4 }.
Fields§
§r: [f32; 4]§d: [f32; 4]Implementations§
§impl Motor
Inherent PGA Motor ergonomic helpers for hierarchical scene graph and physics solvers.
impl Motor
Inherent PGA Motor ergonomic helpers for hierarchical scene graph and physics solvers.
pub fn transform_point(&self, p: [f32; 3]) -> [f32; 3]
pub fn transform_point(&self, p: [f32; 3]) -> [f32; 3]
Transforms a 3D Euclidean point via the PGA sandwich product $\mathbf{p}’ = M \mathbf{p} \widetilde{M}$.
pub fn transform_vector(&self, v: [f32; 3]) -> [f32; 3]
pub fn transform_vector(&self, v: [f32; 3]) -> [f32; 3]
Rotates a 3D direction vector using only the rotor part $R \mathbf{v} \widetilde{R}$.
pub fn translation(&self) -> [f32; 3]
pub fn translation(&self) -> [f32; 3]
Extracts the Euclidean world translation $[x, y, z]$ encoded by this motor.
pub fn from_translation_axis_angle(
translation: [f32; 3],
axis: [f32; 3],
angle_rad: f32,
) -> Motor
pub fn from_translation_axis_angle( translation: [f32; 3], axis: [f32; 3], angle_rad: f32, ) -> Motor
Constructs a rigid motor from a translation vector and axis-angle rotation.
Trait Implementations§
impl Copy for Motor
impl StructuralPartialEq for Motor
Auto Trait Implementations§
impl Freeze for Motor
impl RefUnwindSafe for Motor
impl Send for Motor
impl Sync for Motor
impl Unpin for Motor
impl UnsafeUnpin for Motor
impl UnwindSafe for Motor
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more