Struct trackball::Image [−][src]
pub struct Image<N: RealField> { /* fields omitted */ }
Implementations
impl<N: RealField> Image<N>
[src]
impl<N: RealField> Image<N>
[src]pub fn new(frame: &Frame<N>, scene: &Scene<N>, max: Point2<N>) -> Self
[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]
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]
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]
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]
pub fn set_pos(&mut self, pos: Point2<N>)
[src]Sets current position in screen space of hovering input or pointing device.
pub fn set_max(&mut self, max: Point2<N>)
[src]
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]
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]
pub fn view_isometry(&self) -> &Isometry3<N>
[src]Cached view isometry.
pub fn compute_view(&mut self, frame: &Frame<N>)
[src]
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]
pub fn projection(&self) -> &Matrix4<N>
[src]Cached projection matrix.
pub fn compute_projection_and_upp(&mut self, zat: N, scene: &Scene<N>)
[src]
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]
pub fn transformation(&self) -> &Matrix4<N>
[src]Cached projection view matrix.
pub fn compute_transformation(&mut self)
[src]
pub fn compute_transformation(&mut self)
[src]Computes projection view matrix.
pub fn inverse_transformation(&self) -> &Matrix4<N>
[src]
pub fn inverse_transformation(&self) -> &Matrix4<N>
[src]Cached inverse projection view matrix.
pub fn compute_inverse_transformation(&mut self) -> bool
[src]
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]
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 transform_pos_and_max_wrt_max(
pos: &Point2<N>,
max: &Point2<N>
) -> (Point2<N>, Point2<N>)
[src]
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]
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]
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]
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]
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
Auto Trait Implementations
impl<N> RefUnwindSafe for Image<N> where
N: RefUnwindSafe,
N: RefUnwindSafe,
impl<N> Send for Image<N>
impl<N> Sync for Image<N>
impl<N> Unpin for Image<N> where
N: Unpin,
N: Unpin,
impl<N> UnwindSafe for Image<N> where
N: UnwindSafe,
N: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
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
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
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
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]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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