pub enum Delta<N: Copy + RealField> {
Frame,
First {
pitch: N,
yaw: N,
yaw_axis: Unit<Vector3<N>>,
},
Track {
vec: Vector3<N>,
},
Orbit {
rot: UnitQuaternion<N>,
pos: Point3<N>,
},
Slide {
vec: Vector3<N>,
},
Scale {
rat: N,
pos: Point3<N>,
},
}
Expand description
Delta transform from initial to final Frame
.
Variants§
Frame
Yields frame as identity transform (default).
First
Orbits target around eye by pitch and yaw preserving roll attitude aka first person view.
See Frame::look_around()
.
Track
Tracks target which slides by vector in world space.
Preserves eye position inclusive its roll attitude.
Orbit
Orbits eye by rotation in camera space around point in camera space.
Slide
Slides camera eye and target by vector in camera space.
See Frame::local_slide()
.
Scale
Scales distance between eye and point in camera space by ratio preserving target position.
Implementations§
Source§impl<N: Copy + RealField> Delta<N>
impl<N: Copy + RealField> Delta<N>
Sourcepub fn inverse(self) -> Self
pub fn inverse(self) -> Self
Inverses delta transform.
Effectively swaps initial with final frame.
Sourcepub fn lerp_slerp(&self, t: N) -> Self
pub fn lerp_slerp(&self, t: N) -> Self
Interpolates delta transform to a fraction using linear interpolation for the translation part, and spherical linear interpolation for the rotation part.
§Arguments
self
: The delta transform to interpolate from.t
: The interpolation parameter between 0 and 1.
Trait Implementations§
Source§impl<'de, N> Deserialize<'de> for Delta<N>
impl<'de, N> Deserialize<'de> for Delta<N>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<N: Copy + Copy + RealField> Copy for Delta<N>
impl<N: Eq + Copy + RealField> Eq for Delta<N>
impl<N: Copy + RealField> StructuralPartialEq for Delta<N>
Auto Trait Implementations§
impl<N> Freeze for Delta<N>where
N: Freeze,
impl<N> RefUnwindSafe for Delta<N>where
N: RefUnwindSafe,
impl<N> Send for Delta<N>
impl<N> Sync for Delta<N>
impl<N> Unpin for Delta<N>where
N: Unpin,
impl<N> UnwindSafe for Delta<N>where
N: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.