merge
authoralfadur
Mon, 05 Nov 2018 19:56:28 +0300
changeset 14153 95360f56db38
parent 14152 c416d32764b7 (current diff)
parent 14151 ab280be4b617 (diff)
child 14154 a65b60f36b96
merge
rust/landgen/src/outline.rs
--- a/rust/land_dump/src/main.rs	Mon Nov 05 19:53:26 2018 +0300
+++ b/rust/land_dump/src/main.rs	Mon Nov 05 19:56:28 2018 +0300
@@ -131,7 +131,7 @@
         opt.seed.as_str().as_bytes(),
         opt.distance_divisor,
         false,
-        true,
+        false,
         Path::new("out.full.png"),
     )
     .unwrap();
--- a/rust/landgen/src/outline.rs	Mon Nov 05 19:53:26 2018 +0300
+++ b/rust/landgen/src/outline.rs	Mon Nov 05 19:56:28 2018 +0300
@@ -99,9 +99,10 @@
                     (iy - edge.start.y) * edge_dir.cotangent() + edge.start.x
                 };
 
-                let intersection_point = Point::new(ix, iy);
+                let intersection_point = Point::new(ix, iy).clamp(intersections_box);
                 let diff_point = ray.start - intersection_point;
                 let t = ray.direction.dot(diff_point);
+
                 if diff_point.max_norm() >= std::i16::MAX as i32 {
                     Some((t, std::i32::MAX as u32))
                 } else {