Trait cgmath::Transform

source ·
pub trait Transform<P: Point>: Sized {
    // Required methods
    fn one() -> Self;
    fn look_at(eye: P, center: P, up: P::Vector) -> Self;
    fn transform_vector(&self, vec: P::Vector) -> P::Vector;
    fn transform_point(&self, point: P) -> P;
    fn concat(&self, other: &Self) -> Self;
    fn invert(&self) -> Option<Self>;

    // Provided methods
    fn transform_as_point(&self, vec: P::Vector) -> P::Vector { ... }
    fn concat_self(&mut self, other: &Self) { ... }
    fn invert_self(&mut 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§

source

fn one() -> Self

Create an identity transformation. That is, a transformation which does nothing.

source

fn look_at(eye: P, center: P, up: P::Vector) -> Self

Create a transformation that rotates a vector to look at center from eye, using up for orientation.

source

fn transform_vector(&self, vec: P::Vector) -> P::Vector

Transform a vector using this transform.

source

fn transform_point(&self, point: P) -> P

Transform a point using this transform.

source

fn concat(&self, other: &Self) -> Self

Combine this transform with another, yielding a new transformation which has the effects of both.

source

fn invert(&self) -> Option<Self>

Create a transform that “un-does” this one.

Provided Methods§

source

fn transform_as_point(&self, vec: P::Vector) -> P::Vector

Transform a vector as a point using this transform.

source

fn concat_self(&mut self, other: &Self)

Combine this transform with another, in-place.

source

fn invert_self(&mut self)

Invert this transform in-place, failing if the transformation is not invertible.

Implementors§

source§

impl<P: Point, R: Rotation<P>> Transform<P> for Decomposed<P::Vector, R>where <P as Point>::Scalar: BaseFloat,

source§

impl<S: BaseFloat> Transform<Point3<S>> for AffineMatrix3<S>