pub struct Orbit {
pub target: Point3<World>,
pub dir: SphericalVec<World>,
}Expand description
Orbiting camera transform.
Keeps the camera centered on a world-space point, and allows free 360°/180° azimuth/altitude rotation around that point as well as setting the distance from the point.
Fields§
§target: Point3<World>The camera’s target point in world space.
dir: SphericalVec<World>The camera’s direction in world space.
Implementations§
Source§impl Orbit
impl Orbit
Sourcepub fn rotate(&mut self, az_delta: Angle, alt_delta: Angle)
pub fn rotate(&mut self, az_delta: Angle, alt_delta: Angle)
Adds the azimuth and altitude to the camera’s current direction.
Wraps the resulting azimuth to [-180°, 180°) and clamps the altitude to [-90°, 90°].
Sourcepub fn rotate_to(&mut self, az: Angle, alt: Angle)
pub fn rotate_to(&mut self, az: Angle, alt: Angle)
Rotates the camera to the world-space azimuth and altitude given.
Wraps the azimuth to [-180°, 180°) and clamps the altitude to [-90°, 90°].
Sourcepub fn translate(&mut self, delta: Vec3<World>)
pub fn translate(&mut self, delta: Vec3<World>)
Translates the camera’s target point in world space.
Trait Implementations§
Source§impl Transform for Orbit
Available on crate feature fp only.
impl Transform for Orbit
Available on crate feature
fp only.Source§fn world_to_view(&self) -> Mat4x4<WorldToView>
fn world_to_view(&self) -> Mat4x4<WorldToView>
Returns the current world-to-view matrix.
impl Copy for Orbit
Auto Trait Implementations§
impl Freeze for Orbit
impl RefUnwindSafe for Orbit
impl Send for Orbit
impl Sync for Orbit
impl Unpin for Orbit
impl UnwindSafe for Orbit
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
Mutably borrows from an owned value. Read more