equal
deleted
inserted
replaced
97 (iy - ray.start.y) * ray.direction.cotangent() + ray.start.x |
97 (iy - ray.start.y) * ray.direction.cotangent() + ray.start.x |
98 } else { |
98 } else { |
99 (iy - edge.start.y) * edge_dir.cotangent() + edge.start.x |
99 (iy - edge.start.y) * edge_dir.cotangent() + edge.start.x |
100 }; |
100 }; |
101 |
101 |
102 let intersection_point = Point::new(ix, iy); |
102 let intersection_point = Point::new(ix, iy).clamp(intersections_box); |
103 let diff_point = ray.start - intersection_point; |
103 let diff_point = ray.start - intersection_point; |
104 let t = ray.direction.dot(diff_point); |
104 let t = ray.direction.dot(diff_point); |
|
105 |
105 if diff_point.max_norm() >= std::i16::MAX as i32 { |
106 if diff_point.max_norm() >= std::i16::MAX as i32 { |
106 Some((t, std::i32::MAX as u32)) |
107 Some((t, std::i32::MAX as u32)) |
107 } else { |
108 } else { |
108 let d = diff_point.integral_norm(); |
109 let d = diff_point.integral_norm(); |
109 |
110 |