Add a phantom type annotation on Transform.

This commit is contained in:
Ben Foppa 2015-02-20 23:29:06 -05:00
parent 2fc7b6d879
commit a1d4ba19d0

View file

@ -21,12 +21,13 @@ use num::{BaseNum, BaseFloat, zero, one};
use point::{Point, Point3}; use point::{Point, Point3};
use ray::Ray; use ray::Ray;
use rotation::{Rotation, Rotation3}; use rotation::{Rotation, Rotation3};
use std::marker::PhantomFn;
use vector::{Vector, Vector3}; use vector::{Vector, Vector3};
/// A trait representing an [affine /// A trait representing an [affine
/// transformation](https://en.wikipedia.org/wiki/Affine_transformation) that /// transformation](https://en.wikipedia.org/wiki/Affine_transformation) that
/// can be applied to points or vectors. An affine transformation is one which /// can be applied to points or vectors. An affine transformation is one which
pub trait Transform<S: BaseNum, V: Vector<S>, P: Point<S,V>>: Sized { pub trait Transform<S: BaseNum, V: Vector<S>, P: Point<S,V>>: Sized + PhantomFn<S> {
/// Create an identity transformation. That is, a transformation which /// Create an identity transformation. That is, a transformation which
/// does nothing. /// does nothing.
fn identity() -> Self; fn identity() -> Self;