Trait cgmath::Transform
[−]
[src]
pub trait Transform<S: BaseNum, V: Vector<S>, P: Point<S, V>>: Sized { fn identity() -> Self; fn look_at(eye: &P, center: &P, up: &V) -> Self; fn transform_vector(&self, vec: &V) -> V; fn transform_point(&self, point: &P) -> P; fn concat(&self, other: &Self) -> Self; fn invert(&self) -> Option<Self>; fn transform_ray(&self, ray: &Ray<S, P, V>) -> Ray<S, P, V> { ... } fn transform_as_point(&self, vec: &V) -> V { ... } fn concat_self(&mut self, other: &Self) { ... } fn invert_self(&mut self) { ... } }
A trait representing an affine transformation that can be applied to points or vectors. An affine transformation is one which
Required Methods
fn identity() -> Self
Create an identity transformation. That is, a transformation which does nothing.
fn look_at(eye: &P, center: &P, up: &V) -> Self
Create a transformation that rotates a vector to look at center
from
eye
, using up
for orientation.
fn transform_vector(&self, vec: &V) -> V
Transform a vector using this transform.
fn transform_point(&self, point: &P) -> P
Transform a point using this transform.
fn concat(&self, other: &Self) -> Self
Combine this transform with another, yielding a new transformation which has the effects of both.
fn invert(&self) -> Option<Self>
Create a transform that "un-does" this one.
Provided Methods
fn transform_ray(&self, ray: &Ray<S, P, V>) -> Ray<S, P, V>
Transform a ray using this transform.
fn transform_as_point(&self, vec: &V) -> V
Transform a vector as a point using this transform.
fn concat_self(&mut self, other: &Self)
Combine this transform with another, in-place.
fn invert_self(&mut self)
Invert this transform in-place, failing if the transformation is not invertible.