[][src]Struct kiss3d::camera::FirstPerson

pub struct FirstPerson { /* fields omitted */ }

First-person camera mode.

  • Left button press + drag - look around
  • Right button press + drag - translates the camera position on the plane orthogonal to the view direction
  • Scroll in/out - zoom in/out

Methods

impl FirstPerson[src]

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

Creates a first person camera with default sensitivity values.

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

Creates a new first person camera with default sensitivity values.

pub fn set_move_step(&mut self, step: f32)[src]

Sets the translational increment per arrow press.

The default value is 0.5.

pub fn set_pitch_step(&mut self, step: f32)[src]

Sets the pitch increment per mouse movement.

The default value is 0.005.

pub fn set_yaw_step(&mut self, step: f32)[src]

Sets the yaw increment per mouse movement.

The default value is 0.005.

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

Gets the translational increment per arrow press.

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

Gets the pitch increment per mouse movement.

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

Gets the yaw increment per mouse movement.

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

Changes the orientation and position of the camera to look at the specified point.

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

The point the camera is looking at.

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

The button used to rotate the FirstPerson camera.

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

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

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

The button used to drag the FirstPerson camera.

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

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

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

The movement button for up.

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

The movement button for down.

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

The movement button for left.

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

The movement button for right.

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

Set the movement button for up. Use None to disable movement in this direction.

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

Set the movement button for down. Use None to disable movement in this direction.

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

Set the movement button for left. Use None to disable movement in this direction.

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

Set the movement button for right. Use None to disable movement in this direction.

pub fn unbind_movement_keys(&mut self)[src]

Disable the movement buttons for up, down, left and right.

pub fn eye_dir(&self) -> Vector3<f32>[src]

The direction this camera is looking at.

pub fn move_dir(
    &self,
    up: bool,
    down: bool,
    right: bool,
    left: bool
) -> Vector3<f32>
[src]

The direction this camera is being moved by the keyboard keys for a given set of key states.

pub fn translate_mut(&mut self, t: &Translation3<f32>)[src]

Translates in-place this camera by t.

pub fn translate(&self, t: &Translation3<f32>) -> FirstPerson[src]

Translates this camera by t.

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

Sets the Up vector of this camera.

Trait Implementations

impl Camera for FirstPerson[src]

fn view_transform(&self) -> Isometry3<f32>[src]

The camera view transformation (i-e transformation without projection).

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 FirstPerson[src]

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

Performs copy-assignment from source. Read more

impl Debug for FirstPerson[src]

Auto Trait Implementations

impl Send for FirstPerson

impl Sync for FirstPerson

Blanket Implementations

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

impl<T> From for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

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> Borrow for T where
    T: ?Sized
[src]

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

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> 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