From 3256feab1beee79b089555152a9d4505baf9f310 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Mon, 25 Feb 2019 20:35:32 -0800 Subject: [PATCH] Update ray constructor to take anything that Into --- rtiow/src/ray.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rtiow/src/ray.rs b/rtiow/src/ray.rs index 4fc60d1..f250646 100644 --- a/rtiow/src/ray.rs +++ b/rtiow/src/ray.rs @@ -10,7 +10,12 @@ pub struct Ray { } impl Ray { - pub fn new(origin: Vec3, direction: Vec3, time: f32) -> Ray { + pub fn new(origin: V, direction: V, time: f32) -> Ray + where + V: Into, + { + let direction = direction.into(); + let origin = origin.into(); let inv = 1. / direction; Ray { origin,