pub trait Transform<P: EuclideanSpace>: Sized + One {
// Required methods
fn look_at(eye: P, center: P, up: P::Diff) -> Self;
fn look_at_rh(eye: P, center: P, up: P::Diff) -> Self;
fn look_at_lh(eye: P, center: P, up: P::Diff) -> Self;
fn transform_vector(&self, vec: P::Diff) -> P::Diff;
fn transform_point(&self, point: P) -> P;
fn concat(&self, other: &Self) -> Self;
fn inverse_transform(&self) -> Option<Self>;
// Provided methods
fn inverse_transform_vector(&self, vec: P::Diff) -> Option<P::Diff> { ... }
fn concat_self(&mut self, other: &Self) { ... }
}
Expand description
A trait representing an affine transformation that can be applied to points or vectors. An affine transformation is one which
Required Methods§
Sourcefn look_at(eye: P, center: P, up: P::Diff) -> Self
👎Deprecated: Use look_at_rh or look_at_lh
fn look_at(eye: P, center: P, up: P::Diff) -> Self
Create a transformation that rotates a vector to look at center
from
eye
, using up
for orientation.
Sourcefn look_at_rh(eye: P, center: P, up: P::Diff) -> Self
fn look_at_rh(eye: P, center: P, up: P::Diff) -> Self
Create a transformation that rotates a vector to look at center
from
eye
, using up
for orientation.
Sourcefn look_at_lh(eye: P, center: P, up: P::Diff) -> Self
fn look_at_lh(eye: P, center: P, up: P::Diff) -> Self
Create a transformation that rotates a vector to look at center
from
eye
, using up
for orientation.
Sourcefn transform_vector(&self, vec: P::Diff) -> P::Diff
fn transform_vector(&self, vec: P::Diff) -> P::Diff
Transform a vector using this transform.
Sourcefn transform_point(&self, point: P) -> P
fn transform_point(&self, point: P) -> P
Transform a point using this transform.
Sourcefn concat(&self, other: &Self) -> Self
fn concat(&self, other: &Self) -> Self
Combine this transform with another, yielding a new transformation which has the effects of both.
Sourcefn inverse_transform(&self) -> Option<Self>
fn inverse_transform(&self) -> Option<Self>
Create a transform that “un-does” this one.
Provided Methods§
Sourcefn inverse_transform_vector(&self, vec: P::Diff) -> Option<P::Diff>
fn inverse_transform_vector(&self, vec: P::Diff) -> Option<P::Diff>
Inverse transform a vector using this transform
Sourcefn concat_self(&mut self, other: &Self)
fn concat_self(&mut self, other: &Self)
Combine this transform with another, in-place.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.