[][src]Struct kiss3d::camera::ArcBall

pub struct ArcBall { /* fields omitted */ }

Arc-ball camera mode.

An arc-ball camera is a camera rotating around a fixed point (the focus point) and always looking at it. The following inputs are handled:

  • Left button press + drag - rotates the camera around the focus point
  • Right button press + drag - translates the focus point on the plane orthogonal to the view direction
  • Scroll in/out - zoom in/out
  • Enter key - set the focus point to the origin

Methods

impl ArcBall[src]

pub fn new(eye: Point3<f32>, at: Point3<f32>) -> ArcBall[src]

Create a new arc-ball camera.

pub fn new_with_frustrum(
    fov: f32,
    znear: f32,
    zfar: f32,
    eye: Point3<f32>,
    at: Point3<f32>
) -> ArcBall
[src]

Creates a new arc ball camera with default sensitivity values.

pub fn at(&self) -> Point3<f32>[src]

The point the arc-ball is looking at.

pub fn set_at(&mut self, at: Point3<f32>)[src]

Get a mutable reference to the point the camera is looking at.

pub fn yaw(&self) -> f32[src]

The arc-ball camera yaw.

pub fn set_yaw(&mut self, yaw: f32)[src]

Sets the camera yaw. Change this to modify the rotation along the up axis.

pub fn pitch(&self) -> f32[src]

The arc-ball camera pitch.

pub fn set_pitch(&mut self, pitch: f32)[src]

Sets the camera pitch.

pub fn min_pitch(&self) -> f32[src]

The minimum pitch of the camera.

pub fn set_min_pitch(&mut self, min_pitch: f32)[src]

Set the minimum pitch of the camera.

pub fn max_pitch(&self) -> f32[src]

The maximum pitch of the camera.

pub fn set_max_pitch(&mut self, max_pitch: f32)[src]

Set the maximum pitch of the camera.

pub fn dist(&self) -> f32[src]

The distance from the camera position to its view point.

pub fn set_dist(&mut self, dist: f32)[src]

Move the camera such that it is at a given distance from the view point.

pub fn min_dist(&self) -> f32[src]

The minimum distance from the camera position to its view point.

pub fn set_min_dist(&mut self, min_dist: f32)[src]

Set the minimum distance from the camera position to its view point.

pub fn max_dist(&self) -> f32[src]

The maximum distance from the camera position to its view point.

pub fn set_max_dist(&mut self, max_dist: f32)[src]

Set the maximum distance from the camera position to its view point.

pub fn look_at(&mut self, eye: Point3<f32>, at: Point3<f32>)[src]

Move and orient the camera such that it looks at a specific point.

pub fn rotate_button(&self) -> Option<MouseButton>[src]

The button used to rotate the ArcBall camera.

pub fn rebind_rotate_button(&mut self, new_button: Option<MouseButton>)[src]

Set the button used to rotate the ArcBall camera. Use None to disable rotation.

pub fn rotate_modifiers(&self) -> Option<Modifiers>[src]

Modifiers that must be pressed for the camera rotation to occur.

pub fn set_rotate_modifiers(&mut self, modifiers: Option<Modifiers>)[src]

Sets the modifiers that must be pressed for the camera rotation to occur.

If this is set to None, then pressing any modifier will not prevent rotation from occurring. If this is different from None then rotation will occur only if the exact specified set of modifiers is pressed. In particular, if this is set to Some(Modifiers::empty()) then, rotation will occur only of no modifier is pressed.

pub fn drag_modifiers(&self) -> Option<Modifiers>[src]

Modifiers that must be pressed for the camera drag to occur.

pub fn set_drag_modifiers(&mut self, modifiers: Option<Modifiers>)[src]

Sets the modifiers that must be pressed for the camera drag to occur.

If this is set to None, then pressing any modifier will not prevent dragging from occurring. If this is different from None then drag will occur only if the exact specified set of modifiers is pressed. In particular, if this is set to Some(Modifiers::empty()) then, drag will occur only of no modifier is pressed.

pub fn drag_button(&self) -> Option<MouseButton>[src]

The button used to drag the ArcBall camera.

pub fn rebind_drag_button(&mut self, new_button: Option<MouseButton>)[src]

Set the button used to drag the ArcBall camera. Use None to disable dragging.

pub fn reset_key(&self) -> Option<Key>[src]

The key used to reset the ArcBall camera.

pub fn rebind_reset_key(&mut self, new_key: Option<Key>)[src]

Set the key used to reset the ArcBall camera. Use None to disable reset.

pub fn set_up_axis(&mut self, up_axis: Vector3<f32>)[src]

Sets the up vector of this camera.

Trait Implementations

impl Camera for ArcBall[src]

fn num_passes(&self) -> usize[src]

The number of passes required by this camera.

fn start_pass(&self, _pass: usize, _canvas: &Canvas)[src]

Indicates that a pass will begin.

fn render_complete(&self, _canvas: &Canvas)[src]

Indicates that the scene has been rendered and the post-processing is being run.

fn project(
    &self,
    world_coord: &Point3<f32>,
    size: &Vector2<f32>
) -> Vector2<f32>
[src]

Converts a 3d point to 2d screen coordinates, assuming the screen has the size size.

fn unproject(
    &self,
    window_coord: &Point2<f32>,
    size: &Vector2<f32>
) -> (Point3<f32>, Vector3<f32>)
[src]

Converts a point in 2d screen coordinates to a ray (a 3d position and a direction). Read more

impl Clone for ArcBall[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for ArcBall[src]

Auto Trait Implementations

impl Send for ArcBall

impl Sync for ArcBall

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> Same for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf for SP where
    SS: SubsetOf<SP>, 

impl<T> Downcast for T where
    T: Any

impl<T> Erased for T