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<N: Copy + RealField> Archive for Delta<N>
impl<N: Copy + RealField> Archive for Delta<N>
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>,
source§impl<N: PartialEq + Copy + RealField> PartialEq for Delta<N>
impl<N: PartialEq + Copy + RealField> PartialEq for Delta<N>
impl<N: Copy + Copy + RealField> Copy for Delta<N>
impl<N: Eq + Copy + RealField> Eq for Delta<N>
impl<N: Copy + RealField> StructuralEq for Delta<N>
impl<N: Copy + RealField> StructuralPartialEq for Delta<N>
Auto Trait Implementations§
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> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata )
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T, S> SerializeUnsized<S> for T
impl<T, S> SerializeUnsized<S> for T
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.