merge
authoralfadur
Mon, 05 Nov 2018 19:56:28 +0300
changeset 14132 95360f56db38
parent 14131 c416d32764b7 (current diff)
parent 14130 ab280be4b617 (diff)
child 14133 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 {