Struct trackball::Orbit [−][src]
pub struct Orbit<N: Copy + RealField> { /* fields omitted */ }
Expand description
Orbit induced by displacement on screen.
Implements Default
and can be created with Orbit::default()
.
Both its methods must be invoked on matching events fired by your 3D graphics library of choice.
Implementations
Computes rotation between previous and current cursor/finger position.
Normalization of previous position is cached and has to be discarded on button/finger
release via Self::discard()
. Current position pos
is clamped between origin and
maximum position max
as screen’s width and height.
Screen space with origin in top left corner:
- x-axis from left to right,
- y-axis from top to bottom.
Camera space with origin at its target, the trackball’s center:
- x-axis from left to right,
- y-axis from bottom to top,
- z-axis from far to near.
Returns None
:
- on first invocation and after
Self::discard()
as there is no previous position yet, - in the unlikely case that a position event fires twice resulting in zero displacements.
Trait Implementations
Auto Trait Implementations
impl<N> RefUnwindSafe for Orbit<N> where
N: RefUnwindSafe,
impl<N> UnwindSafe for Orbit<N> where
N: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
pub fn is_in_subset(&self) -> bool
pub fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
pub fn to_subset_unchecked(&self) -> SS
pub fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
pub fn from_subset(element: &SS) -> SP
pub fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.