pub struct OrbitControls {Show 14 fields
pub radius: f32,
pub phi: f32,
pub theta: f32,
pub target: Vec3,
pub min_distance: f32,
pub max_distance: f32,
pub min_polar_angle: f32,
pub max_polar_angle: f32,
pub rotate_speed: f32,
pub zoom_speed: f32,
pub pan_speed: f32,
pub enable_damping: bool,
pub damping_factor: f32,
pub active_mode: OrbitInteractionMode,
/* private fields */
}Expand description
Interactive 3D Camera Orbit Controller.
Fields§
§radius: f32§phi: f32§theta: f32§target: Vec3§min_distance: f32§max_distance: f32§min_polar_angle: f32§max_polar_angle: f32§rotate_speed: f32§zoom_speed: f32§pan_speed: f32§enable_damping: bool§damping_factor: f32§active_mode: OrbitInteractionModeImplementations§
Source§impl OrbitControls
impl OrbitControls
Sourcepub fn new_with_target_and_eye(target: Vec3, eye: Vec3) -> Self
pub fn new_with_target_and_eye(target: Vec3, eye: Vec3) -> Self
Creates OrbitControls initialized from target focus point and camera eye position.
Sourcepub fn from_camera(camera: &Camera3D) -> Self
pub fn from_camera(camera: &Camera3D) -> Self
Initializes OrbitControls from an existing Camera3D.
Sourcepub fn eye_position(&self) -> Vec3
pub fn eye_position(&self) -> Vec3
Computes the current 3D eye position in Cartesian coordinates.
Sourcepub fn rotate_by(&mut self, delta_theta: f32, delta_phi: f32)
pub fn rotate_by(&mut self, delta_theta: f32, delta_phi: f32)
Rotates azimuthal (theta) and polar (phi) angles by given deltas.
Sourcepub fn zoom_delta(&mut self, delta: f32)
pub fn zoom_delta(&mut self, delta: f32)
Zooms camera radius by multiplicative factor or wheel delta.
Sourcepub fn pan_by(
&mut self,
delta_x: f32,
delta_y: f32,
viewport_width: f32,
viewport_height: f32,
fov_degrees: f32,
)
pub fn pan_by( &mut self, delta_x: f32, delta_y: f32, viewport_width: f32, viewport_height: f32, fov_degrees: f32, )
Pans camera target point in screen-space camera plane.
Sourcepub fn on_pointer_down(&mut self, x: f32, y: f32, button: u8)
pub fn on_pointer_down(&mut self, x: f32, y: f32, button: u8)
Handles pointer down: button 0 = rotate, 1 = zoom, 2 = pan.
Sourcepub fn on_pointer_move(
&mut self,
x: f32,
y: f32,
viewport_w: f32,
viewport_h: f32,
fov_degrees: f32,
)
pub fn on_pointer_move( &mut self, x: f32, y: f32, viewport_w: f32, viewport_h: f32, fov_degrees: f32, )
Handles pointer move: computes screen deltas and applies appropriate transformation.
Sourcepub fn on_pointer_up(&mut self)
pub fn on_pointer_up(&mut self)
Handles pointer up: releases active drag mode.
Sourcepub fn update_camera(&self, camera: &mut Camera3D)
pub fn update_camera(&self, camera: &mut Camera3D)
Writes updated eye position and target back to a Camera3D.
Sourcepub fn view_matrix(&self) -> Mat4
pub fn view_matrix(&self) -> Mat4
Computes the look-at view matrix corresponding to the current camera state.
Trait Implementations§
Source§impl Clone for OrbitControls
impl Clone for OrbitControls
Source§impl Debug for OrbitControls
impl Debug for OrbitControls
Source§impl Default for OrbitControls
impl Default for OrbitControls
Source§impl PartialEq for OrbitControls
impl PartialEq for OrbitControls
impl StructuralPartialEq for OrbitControls
Auto Trait Implementations§
impl Forget for OrbitControls
impl Freeze for OrbitControls
impl Move for OrbitControls
impl RefUnwindSafe for OrbitControls
impl Send for OrbitControls
impl Sync for OrbitControls
impl Unpin for OrbitControls
impl UnsafeUnpin for OrbitControls
impl UnwindSafe for OrbitControls
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