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_and_upp(&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_and_max_wrt_max(
    pos: &Point2<N>,
    max: &Point2<N>
) -> (Point2<N>, Point2<N>)
[src]

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

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]

fn clone(&self) -> Image<N>[src]

Returns a copy of the value. Read more

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

Performs copy-assignment from source. Read more

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

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

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]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

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

pub fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

pub fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).

pub fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

pub fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.

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

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.