pub struct Frame<N: Copy + RealField> { /* private fields */ }
Expand description
Frame wrt camera eye and target.
Implementations§
Source§impl<N: Copy + RealField> Frame<N>
impl<N: Copy + RealField> Frame<N>
Sourcepub fn look_at(target: Point3<N>, eye: &Point3<N>, up: &Vector3<N>) -> Self
pub fn look_at(target: Point3<N>, eye: &Point3<N>, up: &Vector3<N>) -> Self
Sets eye position inclusive its roll attitude and target position in world space.
Sourcepub fn set_eye(&mut self, eye: &Point3<N>, up: &Vector3<N>)
pub fn set_eye(&mut self, eye: &Point3<N>, up: &Vector3<N>)
Sets eye position inclusive its roll attitude in world space preserving target position.
Sourcepub fn set_target(&mut self, pos: Point3<N>)
pub fn set_target(&mut self, pos: Point3<N>)
Sets target position in world space preserving eye position inclusive its roll attitude.
Allows to track a moving object.
Sourcepub fn set_distance(&mut self, zat: N)
pub fn set_distance(&mut self, zat: N)
Sets distance between eye and target preserving target position.
Sourcepub fn scale(&mut self, rat: N)
pub fn scale(&mut self, rat: N)
Scales distance between eye and target by ratio preserving target position.
Sourcepub fn local_scale_around(&mut self, rat: N, pos: &Point3<N>)
pub fn local_scale_around(&mut self, rat: N, pos: &Point3<N>)
Scales distance between eye and point in camera space by ratio preserving target position.
Sourcepub fn scale_around(&mut self, rat: N, pos: &Point3<N>)
pub fn scale_around(&mut self, rat: N, pos: &Point3<N>)
Scales distance between eye and point in world space by ratio preserving target position.
Sourcepub fn local_slide(&mut self, vec: &Vector3<N>)
pub fn local_slide(&mut self, vec: &Vector3<N>)
Slides camera eye and target by vector in camera space.
Sourcepub fn slide(&mut self, vec: &Vector3<N>)
pub fn slide(&mut self, vec: &Vector3<N>)
Slides camera eye and target by vector in world space.
Sourcepub fn local_orbit(&mut self, rot: &UnitQuaternion<N>)
pub fn local_orbit(&mut self, rot: &UnitQuaternion<N>)
Orbits eye by rotation in camera space around target.
Sourcepub fn local_orbit_around(&mut self, rot: &UnitQuaternion<N>, pos: &Point3<N>)
pub fn local_orbit_around(&mut self, rot: &UnitQuaternion<N>, pos: &Point3<N>)
Orbits eye by rotation in camera space around point in camera space.
Sourcepub fn orbit(&mut self, rot: &UnitQuaternion<N>)
pub fn orbit(&mut self, rot: &UnitQuaternion<N>)
Orbits eye by rotation in world space around target.
Sourcepub fn orbit_around(&mut self, rot: &UnitQuaternion<N>, pos: &Point3<N>)
pub fn orbit_around(&mut self, rot: &UnitQuaternion<N>, pos: &Point3<N>)
Orbits eye by rotation in world space around point in world space.
Sourcepub fn look_around(&mut self, pitch: N, yaw: N, yaw_axis: &Unit<Vector3<N>>)
pub fn look_around(&mut self, pitch: N, yaw: N, yaw_axis: &Unit<Vector3<N>>)
Orbits target around eye by pitch and yaw preserving roll attitude aka first person view.
Use fixed Self::yaw_axis()
by capturing it when entering first person view.
Sourcepub fn local_pitch_axis(&self) -> Unit<Vector3<N>>
pub fn local_pitch_axis(&self) -> Unit<Vector3<N>>
Positive x-axis in camera space pointing from left to right.
Sourcepub fn local_yaw_axis(&self) -> Unit<Vector3<N>>
pub fn local_yaw_axis(&self) -> Unit<Vector3<N>>
Positive y-axis in camera space pointing from bottom to top.
Sourcepub fn local_roll_axis(&self) -> Unit<Vector3<N>>
pub fn local_roll_axis(&self) -> Unit<Vector3<N>>
Positive z-axis in camera space pointing from back to front.
Sourcepub fn pitch_axis(&self) -> Unit<Vector3<N>>
pub fn pitch_axis(&self) -> Unit<Vector3<N>>
Positive x-axis in world space pointing from left to right.
Sourcepub fn yaw_axis(&self) -> Unit<Vector3<N>>
pub fn yaw_axis(&self) -> Unit<Vector3<N>>
Positive y-axis in world space pointing from bottom to top.
Sourcepub fn roll_axis(&self) -> Unit<Vector3<N>>
pub fn roll_axis(&self) -> Unit<Vector3<N>>
Positive z-axis in world space pointing from back to front.
Sourcepub fn try_lerp_slerp(&self, other: &Self, t: N, epsilon: N) -> Option<Self>
pub fn try_lerp_slerp(&self, other: &Self, t: N, epsilon: N) -> Option<Self>
Attempts to interpolate between two frames using linear interpolation for the translation part, and spherical linear interpolation for the rotation part.
Returns None
if the angle between both rotations is 180 degrees (in which case the
interpolation is not well-defined).
§Arguments
self
: The initial frame to interpolate from.other
: The final frame to interpolate toward.t
: The interpolation parameter between 0 and 1.epsilon
: The value below which the sinus of the angle separating both quaternion must be to returnNone
.
Sourcepub fn renormalize(&mut self) -> N
pub fn renormalize(&mut self) -> N
Renormalizes eye rotation and returns its norm.
Sourcepub fn inverse_view(&self) -> Isometry3<N>
pub fn inverse_view(&self) -> Isometry3<N>
Inverse view transformation from world to camera space.
Uses less computations than Self::view()
.inverse()
.
Trait Implementations§
Source§impl<N: Copy + RealField + AbsDiffEq> AbsDiffEq for Frame<N>
impl<N: Copy + RealField + AbsDiffEq> AbsDiffEq for Frame<N>
Source§fn default_epsilon() -> N::Epsilon
fn default_epsilon() -> N::Epsilon
Source§fn abs_diff_eq(&self, other: &Self, epsilon: N::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: N::Epsilon) -> bool
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
AbsDiffEq::abs_diff_eq
.Source§impl<'de, N> Deserialize<'de> for Frame<N>
impl<'de, N> Deserialize<'de> for Frame<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: Copy + RealField + RelativeEq> RelativeEq for Frame<N>
impl<N: Copy + RealField + RelativeEq> RelativeEq for Frame<N>
Source§fn default_max_relative() -> N::Epsilon
fn default_max_relative() -> N::Epsilon
Source§fn relative_eq(
&self,
other: &Self,
epsilon: N::Epsilon,
max_relative: N::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: N::Epsilon, max_relative: N::Epsilon, ) -> bool
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
RelativeEq::relative_eq
.Source§impl<N: Copy + RealField + UlpsEq> UlpsEq for Frame<N>
impl<N: Copy + RealField + UlpsEq> UlpsEq for Frame<N>
impl<N: Copy + Copy + RealField> Copy for Frame<N>
impl<N: Eq + Copy + RealField> Eq for Frame<N>
impl<N: Copy + RealField> StructuralPartialEq for Frame<N>
Auto Trait Implementations§
impl<N> Freeze for Frame<N>where
N: Freeze,
impl<N> RefUnwindSafe for Frame<N>where
N: RefUnwindSafe,
impl<N> Send for Frame<N>
impl<N> Sync for Frame<N>
impl<N> Unpin for Frame<N>where
N: Unpin,
impl<N> UnwindSafe for Frame<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§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.