diff options
author | Julian T <julian@jtle.dk> | 2021-02-07 17:52:30 +0100 |
---|---|---|
committer | Julian T <julian@jtle.dk> | 2021-02-07 17:52:46 +0100 |
commit | c24d1e52b3f173ba5f4cc04f5a6a449a011a60c7 (patch) | |
tree | ff39abb0473a78aa15fbd2ab4c7f5c82660fe3ab /src/core/ray.rs | |
parent | 33e747fa1c0957546c10e4d7b490ac7fbb0fd2d2 (diff) |
Add reflecting material
Diffstat (limited to 'src/core/ray.rs')
-rw-r--r-- | src/core/ray.rs | 7 |
1 files changed, 7 insertions, 0 deletions
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 { |