Skip to content

Commit

Permalink
Merge pull request #648 from b-guild/curve
Browse files Browse the repository at this point in the history
Changing AABB validity to include zero-size dimensions to allow camera fitting to work with 2D objects.
  • Loading branch information
mrDIMAS authored May 10, 2024
2 parents 8cc4378 + 97fb14a commit 777ce8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fyrox-math/src/aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ impl AxisAlignedBoundingBox {
x.iter().all(|e| e.is_nan() || e.is_infinite())
}

self.max.x > self.min.x
&& self.max.y > self.min.y
&& self.max.z > self.min.z
self.max.x >= self.min.x
&& self.max.y >= self.min.y
&& self.max.z >= self.min.z
&& !is_nan_or_inf(&self.min)
&& !is_nan_or_inf(&self.max)
}
Expand Down Expand Up @@ -439,7 +439,7 @@ mod test {
assert!(!_box.is_valid());

_box.add_point(Vector3::new(1.0, 1.0, 1.0));
assert!(!_box.is_valid());
assert!(_box.is_valid());

_box.add_point(Vector3::new(-1.0, -1.0, -1.0));
assert!(_box.is_valid());
Expand Down

0 comments on commit 777ce8d

Please sign in to comment.