diff --git a/src/lib.rs b/src/lib.rs index 51983f0..1880634 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ #![crate_type = "rlib"] #![crate_type = "dylib"] -#![feature(old_impl_check, plugin, core, std_misc, custom_derive)] +#![feature(plugin, core, std_misc, custom_derive)] //! Computer graphics-centric math. //! diff --git a/src/line.rs b/src/line.rs index 595faf6..3156cbb 100644 --- a/src/line.rs +++ b/src/line.rs @@ -15,28 +15,35 @@ //! Line segments +use std::marker::PhantomData; use num::{BaseNum, BaseFloat, Zero, zero, One, one}; use point::{Point, Point2, Point3}; -use vector::{Vector, Vector2}; +use vector::{Vector, Vector2, Vector3}; use ray::{Ray2}; use intersect::Intersect; /// A generic directed line segment from `origin` to `dest`. #[derive(Copy, Clone, PartialEq, RustcEncodable, RustcDecodable)] -pub struct Line
{
+pub struct Line {
- pub fn new(origin: P, dest: P) -> Line {
- Line { origin:origin, dest:dest }
+impl {
pub origin: P,
pub dest: P,
+ phantom_s: PhantomData,
+ phantom_v: PhantomData> Line> Line {
+ pub fn new(origin: P, dest: P) -> Line {
+ Line {
+ origin: origin,
+ dest: dest,
+ phantom_v: PhantomData,
+ phantom_s: PhantomData
+ }
}
}
-pub type Line2 = Line = Line = Line, Point2>;
+pub type Line3 = Line, Point3>;
/// Determines if an intersection between a ray and a line segment is found.
impl