Update ray constructor to take anything that Into<Vec3>
This commit is contained in:
parent
b7002df00e
commit
3256feab1b
@ -10,7 +10,12 @@ pub struct Ray {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Ray {
|
impl Ray {
|
||||||
pub fn new(origin: Vec3, direction: Vec3, time: f32) -> Ray {
|
pub fn new<V>(origin: V, direction: V, time: f32) -> Ray
|
||||||
|
where
|
||||||
|
V: Into<Vec3>,
|
||||||
|
{
|
||||||
|
let direction = direction.into();
|
||||||
|
let origin = origin.into();
|
||||||
let inv = 1. / direction;
|
let inv = 1. / direction;
|
||||||
Ray {
|
Ray {
|
||||||
origin,
|
origin,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user