fix ray construction
authoralfadur
Tue, 06 Nov 2018 16:23:43 +0300
changeset 14146 477faa7b8a48
parent 14145 3078123e84ea
child 14147 11202097584f
fix ray construction
rust/integral-geometry/src/lib.rs
rust/landgen/src/outline.rs
--- a/rust/integral-geometry/src/lib.rs	Tue Nov 06 00:02:23 2018 +0100
+++ b/rust/integral-geometry/src/lib.rs	Tue Nov 06 16:23:43 2018 +0300
@@ -83,8 +83,8 @@
     }
 
     #[inline]
-    pub fn ray_to(self, end: Point) -> Ray {
-        self.line_to(end).to_ray()
+    pub fn ray_with_dir(self, direction: Point) -> Ray {
+        Ray::new(self, direction)
     }
 
     #[inline]
--- a/rust/landgen/src/outline.rs	Tue Nov 06 00:02:23 2018 +0100
+++ b/rust/landgen/src/outline.rs	Tue Nov 06 16:23:43 2018 +0300
@@ -200,7 +200,7 @@
         // go through all points, including fill points
         for pi in self.iter().cloned() {
             if pi != segment.start && pi != segment.end {
-                if intersects(&pi.ray_to(normal), &segment) {
+                if intersects(&pi.ray_with_dir(normal), &segment) {
                     // ray from segment.start
                     if let Some((t, d)) = solve_intersection(
                         &self.intersections_box, &normal_ray, &segment.start.line_to(pi),