Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/bounding_volume/aabb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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-negative.");
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),
Expand All @@ -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!(
Expand All @@ -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),
Expand Down
8 changes: 4 additions & 4 deletions src/bounding_volume/bounding_sphere.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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)
}

Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Expand Down