From e4740e21849ed9e5e71e6f1587d27ca5f837c24d Mon Sep 17 00:00:00 2001 From: zyc <18611145971@163.com> Date: Fri, 7 Nov 2025 09:09:43 +0800 Subject: [PATCH 1/2] Fix assertion message --- src/bounding_volume/aabb.rs | 8 ++++---- src/bounding_volume/bounding_sphere.rs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bounding_volume/aabb.rs b/src/bounding_volume/aabb.rs index 2fcce281..77975ebe 100644 --- a/src/bounding_volume/aabb.rs +++ b/src/bounding_volume/aabb.rs @@ -973,14 +973,14 @@ impl BoundingVolume for Aabb { #[inline] fn loosen(&mut self, amount: Real) { - assert!(amount >= 0.0, "The loosening margin must be positive."); + assert!(amount >= 0.0, "The loosening margin must be non-negativee."); self.mins += Vector::repeat(-amount); self.maxs += Vector::repeat(amount); } #[inline] fn loosened(&self, amount: Real) -> Aabb { - assert!(amount >= 0.0, "The loosening margin must be positive."); + assert!(amount >= 0.0, "The loosening margin must be non-negative."); Aabb { mins: self.mins + Vector::repeat(-amount), maxs: self.maxs + Vector::repeat(amount), @@ -989,7 +989,7 @@ impl BoundingVolume for Aabb { #[inline] fn tighten(&mut self, amount: Real) { - assert!(amount >= 0.0, "The tightening margin must be positive."); + assert!(amount >= 0.0, "The tightening margin must be non-negative."); self.mins += Vector::repeat(amount); self.maxs += Vector::repeat(-amount); assert!( @@ -1000,7 +1000,7 @@ impl BoundingVolume for Aabb { #[inline] fn tightened(&self, amount: Real) -> Aabb { - assert!(amount >= 0.0, "The tightening margin must be positive."); + assert!(amount >= 0.0, "The tightening margin must be non-negative."); Aabb::new( self.mins + Vector::repeat(amount), diff --git a/src/bounding_volume/bounding_sphere.rs b/src/bounding_volume/bounding_sphere.rs index 77420a8a..ad0ad942 100644 --- a/src/bounding_volume/bounding_sphere.rs +++ b/src/bounding_volume/bounding_sphere.rs @@ -475,7 +475,7 @@ impl BoundingVolume for BoundingSphere { /// ``` #[inline] fn loosen(&mut self, amount: Real) { - assert!(amount >= 0.0, "The loosening margin must be positive."); + assert!(amount >= 0.0, "The loosening margin must be non-negative."); self.radius += amount } @@ -509,7 +509,7 @@ impl BoundingVolume for BoundingSphere { /// ``` #[inline] fn loosened(&self, amount: Real) -> BoundingSphere { - assert!(amount >= 0.0, "The loosening margin must be positive."); + assert!(amount >= 0.0, "The loosening margin must be non-negative."); BoundingSphere::new(self.center, self.radius + amount) } @@ -542,7 +542,7 @@ impl BoundingVolume for BoundingSphere { /// ``` #[inline] fn tighten(&mut self, amount: Real) { - assert!(amount >= 0.0, "The tightening margin must be positive."); + assert!(amount >= 0.0, "The tightening margin must be non-negative."); assert!(amount <= self.radius, "The tightening margin is to large."); self.radius -= amount } @@ -577,7 +577,7 @@ impl BoundingVolume for BoundingSphere { /// ``` #[inline] fn tightened(&self, amount: Real) -> BoundingSphere { - assert!(amount >= 0.0, "The tightening margin must be positive."); + assert!(amount >= 0.0, "The tightening margin must be non-negative."); assert!(amount <= self.radius, "The tightening margin is to large."); BoundingSphere::new(self.center, self.radius - amount) } From cc2c12f32a51608abaeef4a0c4b90f8af07c733d Mon Sep 17 00:00:00 2001 From: zyc <18611145971@163.com> Date: Fri, 7 Nov 2025 09:15:43 +0800 Subject: [PATCH 2/2] Fix assertion message --- src/bounding_volume/aabb.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bounding_volume/aabb.rs b/src/bounding_volume/aabb.rs index 77975ebe..1a1d0b13 100644 --- a/src/bounding_volume/aabb.rs +++ b/src/bounding_volume/aabb.rs @@ -973,7 +973,7 @@ impl BoundingVolume for Aabb { #[inline] fn loosen(&mut self, amount: Real) { - assert!(amount >= 0.0, "The loosening margin must be non-negativee."); + assert!(amount >= 0.0, "The loosening margin must be non-negative."); self.mins += Vector::repeat(-amount); self.maxs += Vector::repeat(amount); }