From c24d1e52b3f173ba5f4cc04f5a6a449a011a60c7 Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 7 Feb 2021 17:52:30 +0100 Subject: Add reflecting material --- src/core/ray.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/core/ray.rs') diff --git a/src/core/ray.rs b/src/core/ray.rs index c944184..0517e50 100644 --- a/src/core/ray.rs +++ b/src/core/ray.rs @@ -8,6 +8,13 @@ pub struct Ray { } impl Ray { + pub fn new(origin: Vector3f, direction: Vector3f) -> Ray { + Ray { + origin, + direction, + } + } + pub fn new_to(origin: Vector3f, target: Vector3f) -> Ray { let dir = (target - origin).norm(); Ray { -- cgit v1.2.3