Struct kiss3d_trackball::Trackball[][src]

pub struct Trackball {
    pub input: Input<f32>,
    pub clamp: Clamp<f32>,
    pub frame: Frame<f32>,
    pub reset: Frame<f32>,
    pub scene: Scene<f32>,
    // some fields omitted
}

Trackball camera mode.

A trackball camera is a camera working similarly like a trackball device. The camera eye orbits around its target, the trackball’s center, and always looks at it. This implementation is split into several members defined by the trackball crate categorizing all the methods to control the different aspects of a camera.

Camera Input

Following default inputs are defined which are customizable via Self::input:

MouseTouchAction
Left Button Press + DragOne-Finger + DragOrbits around target.
↳ but at trackball’s borderTwo-Finger + RollRolls about view direction.
Drag + Left ShiftAny-Finger + Drag + Left ShiftFirst person view.
Right Button Press + DragTwo-Finger + DragSlides trackball on focus plane.
Scroll In/OutTwo-Finger + Pinch Out/InScales distance zooming in/out.
Left Button Press + ReleaseAny-Finger + ReleaseSlides to cursor/finger position.
KeyboardAction
OSwitches between orthographic and perspective projection.
EnterResets camera eye and target to Self::reset.

Camera Alignment

Realign camera via Self::frame and define user boundary conditions via Self::clamp like minimum and maximum target distance from camera eye. Optionally, update the alignment to reset to when pressing Input::reset_key() via Self::reset.

Camera Projection

Adjust camera projection via Self::scene like setting field of view or clip plane distances.

Fields

input: Input<f32>

Input keys/buttons and their modifiers.

clamp: Clamp<f32>

Clamp as user boundary conditions of Frame.

frame: Frame<f32>

Frame wrt camera eye and target.

reset: Frame<f32>

Reset frame wrt camera eye and target.

scene: Scene<f32>

Scene wrt enclosing viewing frustum.

Implementations

impl Trackball[src]

pub fn new(
    target: Point3<f32>,
    eye: &Point3<f32>,
    up: &Vector3<f32>
) -> Trackball
[src]

Creates camera with eye position inclusive its roll attitude and target position.

Default viewing frustum has a fixed vertical field of view of π/4 with near and far clip planes at 1E-1 and 1E+6.

Note: Argument order differs from cameras in kiss3d::camera.

pub fn new_with_frustum(
    target: Point3<f32>,
    eye: &Point3<f32>,
    up: &Vector3<f32>,
    fov: impl Into<Fixed<f32>>,
    znear: f32,
    zfar: f32
) -> Trackball
[src]

Like Self::new() but with custom viewing frustum.

For a fixed vertical field of view simply pass an f32 angle in radians as fov, otherwise see Fixed and Scene::set_fov().

Note: Argument order differs from cameras in kiss3d::camera.

Trait Implementations

impl Camera for Trackball[src]

impl Clone for Trackball[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Any + Send + Sync

impl<T> From<T> for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.