Struct trackball::Image[][src]

pub struct Image<N: RealField> { /* fields omitted */ }

Image as projection of Scene wrt Frame.

Implementations

impl<N: RealField> Image<N>[src]

pub fn new(frame: &Frame<N>, scene: &Scene<N>, max: &Point2<N>) -> Self[src]

Computes initial transformations from frame, scene, and screen’s width and height.

pub fn compute(&mut self, frame: &Frame<N>, scene: &Scene<N>) -> Option<bool>[src]

Recomputes only cached matrices whose parameters have changed, see Self::set_compute().

Returns Some(true) on success, Some(false) on failure, and None with no changes.

pub fn set_compute(&mut self, compute_mat: bool, compute_inv: bool)[src]

Sets whether to compute transformation and inverse transformation with Self::compute().

Default is (true, true).

pub fn pos(&self) -> &Point2<N>[src]

Current position in screen space of hovering input or pointing device.

pub fn set_pos(&mut self, pos: &Point2<N>)[src]

Sets current position in screen space of hovering input or pointing device.

pub fn max(&self) -> &Point2<N>[src]

Maximum position in screen space as screen’s width and height.

pub fn set_max(&mut self, max: &Point2<N>)[src]

Sets maximum position in screen space as screen’s width and height.

pub fn upp(&self) -> N[src]

Cached unit per pixel on focus plane to scale/project positions/vectors onto focus plane.

pub fn view_isometry(&self) -> &Isometry3<N>[src]

Cached view isometry.

pub fn view(&self) -> &Matrix4<N>[src]

Cached view matrix.

pub fn compute_view(&mut self, frame: &Frame<N>)[src]

Computes view isometry and matrix from frame wrt camera eye and target.

pub fn projection(&self) -> &Matrix4<N>[src]

Cached projection matrix.

pub fn compute_projection(&mut self, zat: N, scene: &Scene<N>)[src]

Computes projection matrix and unit per pixel on focus plane.

pub fn transformation(&self) -> &Matrix4<N>[src]

Cached projection view matrix.

pub fn compute_transformation(&mut self)[src]

Computes projection view matrix.

pub fn inverse_transformation(&self) -> &Matrix4<N>[src]

Cached inverse projection view matrix.

pub fn compute_inverse_transformation(&mut self) -> bool[src]

Computes inverse of projection view matrix.

Returns true on success.

pub fn clamp_pos_wrt_max(pos: &Point2<N>, max: &Point2<N>) -> Point2<N>[src]

Clamps position in screen space wrt its maximum in screen space.

pub fn clamp_pos(&self, pos: &Point2<N>) -> Point2<N>[src]

Clamps position in screen space.

pub fn transform_pos_wrt_max(
    pos: &Point2<N>,
    max: &Point2<N>
) -> (Point2<N>, Point2<N>)
[src]

Transforms position from screen to camera space wrt its maximum in screen space.

pub fn transform_pos(&self, pos: &Point2<N>) -> Point2<N>[src]

Transforms position from screen to camera space.

pub fn transform_vec(pos: &Vector2<N>) -> Vector2<N>[src]

Transforms vector from screen to camera space.

pub fn project_pos(&self, pos: &Point2<N>) -> Point3<N>[src]

Transforms position from screen to camera space and projects it onto focus plane.

pub fn project_vec(&self, vec: &Vector2<N>) -> Vector3<N>[src]

Transforms vector from screen to camera space and projects it onto focus plane.

Trait Implementations

impl<N: Clone + RealField> Clone for Image<N>[src]

impl<N: Debug + RealField> Debug for Image<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for Image<N> where
    N: RefUnwindSafe

impl<N> Send for Image<N>

impl<N> Sync for Image<N>

impl<N> Unpin for Image<N> where
    N: Unpin

impl<N> UnwindSafe for Image<N> where
    N: UnwindSafe

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> From<T> for T[src]

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

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.