pub struct OrbitControl {
pub target: Vec3,
pub min_distance: f32,
pub max_distance: f32,
}
Expand description
A control that makes the camera orbit around a target.
Fields§
§target: Vec3
The target point to orbit around.
min_distance: f32
The minimum distance to the target point.
max_distance: f32
The maximum distance to the target point.
Implementations§
Source§impl OrbitControl
impl OrbitControl
Sourcepub fn new(target: Vec3, min_distance: f32, max_distance: f32) -> Self
pub fn new(target: Vec3, min_distance: f32, max_distance: f32) -> Self
Creates a new orbit control with the given target and minimum and maximum distance to the target.
Sourcepub fn handle_events(
&mut self,
camera: &mut Camera,
events: &mut [Event],
) -> bool
pub fn handle_events( &mut self, camera: &mut Camera, events: &mut [Event], ) -> bool
Handles the events. Must be called each frame.
Trait Implementations§
Source§impl Clone for OrbitControl
impl Clone for OrbitControl
Source§fn clone(&self) -> OrbitControl
fn clone(&self) -> OrbitControl
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for OrbitControl
impl Debug for OrbitControl
impl Copy for OrbitControl
Auto Trait Implementations§
impl Freeze for OrbitControl
impl RefUnwindSafe for OrbitControl
impl Send for OrbitControl
impl Sync for OrbitControl
impl Unpin for OrbitControl
impl UnwindSafe for OrbitControl
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