pub struct Frame { /* private fields */ }Expand description
Frame wrt camera eye and target.
Implementations§
Source§impl Frame
impl Frame
Sourcepub fn look_at(eye: Vec3, target: Vec3, up: Vec3) -> Self
pub fn look_at(eye: Vec3, target: Vec3, up: Vec3) -> Self
Sets eye position inclusive its roll attitude and target position in world space.
Sourcepub fn set_eye(&mut self, eye: Vec3, up: Vec3)
pub fn set_eye(&mut self, eye: Vec3, up: Vec3)
Sets eye position inclusive its roll attitude in world space preserving target position.
Sourcepub fn set_target(&mut self, pos: Vec3)
pub fn set_target(&mut self, pos: Vec3)
Sets target position in world space preserving eye position inclusive its roll attitude.
Allows to track a moving object.
Sourcepub const fn set_distance(&mut self, zat: f32)
pub const fn set_distance(&mut self, zat: f32)
Sets distance between eye and target preserving target position.
Sourcepub fn scale(&mut self, rat: f32)
pub fn scale(&mut self, rat: f32)
Scales distance between eye and target by ratio preserving target position.
Sourcepub fn local_scale_around(&mut self, rat: f32, pos: Vec3)
pub fn local_scale_around(&mut self, rat: f32, pos: Vec3)
Scales distance between eye and point in camera space by ratio preserving target position.
Sourcepub fn scale_around(&mut self, rat: f32, pos: Vec3)
pub fn scale_around(&mut self, rat: f32, pos: Vec3)
Scales distance between eye and point in world space by ratio preserving target position.
Sourcepub fn local_slide(&mut self, vec: Vec3)
pub fn local_slide(&mut self, vec: Vec3)
Slides camera eye and target by vector in camera space.
Sourcepub fn local_orbit(&mut self, rot: Quat)
pub fn local_orbit(&mut self, rot: Quat)
Orbits eye by rotation in camera space around target.
Sourcepub fn local_orbit_around(&mut self, rot: Quat, pos: Vec3)
pub fn local_orbit_around(&mut self, rot: Quat, pos: Vec3)
Orbits eye by rotation in camera space around point in camera space.
Sourcepub fn orbit_around(&mut self, rot: Quat, pos: Vec3)
pub fn orbit_around(&mut self, rot: Quat, pos: Vec3)
Orbits eye by rotation in world space around point in world space.
Sourcepub fn look_around(&mut self, pitch: f32, yaw: f32, yaw_axis: Vec3)
pub fn look_around(&mut self, pitch: f32, yaw: f32, yaw_axis: Vec3)
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 const fn local_pitch_axis(&self) -> Vec3
pub const fn local_pitch_axis(&self) -> Vec3
Positive x-axis in camera space pointing from left to right.
Sourcepub const fn local_yaw_axis(&self) -> Vec3
pub const fn local_yaw_axis(&self) -> Vec3
Positive y-axis in camera space pointing from bottom to top.
Sourcepub const fn local_roll_axis(&self) -> Vec3
pub const fn local_roll_axis(&self) -> Vec3
Positive z-axis in camera space pointing from back to front.
Sourcepub fn pitch_axis(&self) -> Vec3
pub fn pitch_axis(&self) -> Vec3
Positive x-axis in world space pointing from left to right.
Sourcepub fn lerp_slerp(&self, other: Self, t: f32) -> Self
pub fn lerp_slerp(&self, other: Self, t: f32) -> Self
Interpolates between two frames using linear interpolation for the translation part, and spherical linear interpolation along the shortest path for the rotation part.
§Arguments
self: The initial frame to interpolate from.other: The final frame to interpolate toward.t: The interpolation parameter between 0 and 1.
Sourcepub fn renormalize(&mut self) -> f32
pub fn renormalize(&mut self) -> f32
Renormalizes eye rotation and returns its norm.
Sourcepub fn inverse_view(&self) -> Rigid
pub fn inverse_view(&self) -> Rigid
Inverse view transformation from world to camera space.
Uses less computations than Self::view().inverse().
Sourcepub fn abs_diff_eq(&self, other: Self, max_abs_diff: f32) -> bool
pub fn abs_diff_eq(&self, other: Self, max_abs_diff: f32) -> bool
Whether all components are approximately equal within absolute difference max_abs_diff.