-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* non-functional halfway modification, read the docs * Working and with a single unit test to verify * feat: simplify implementation of Aabb::scaled_wrt_center * chore: move Aabb::scaled_wirt_center test to the test dir. * chore: update changelog --------- Co-authored-by: whatf0xx <[email protected]> Co-authored-by: Sébastien Crozet <[email protected]>
- Loading branch information
1 parent
c599c39
commit 59ecc59
Showing
6 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use na::{Point2, Vector2}; | ||
use parry2d::bounding_volume::Aabb; | ||
|
||
#[test] | ||
fn test_aabb_scale_wrt_center() { | ||
let aabb = Aabb::from_half_extents(Point2::new(1.0, 2.0), Vector2::new(4.0, 5.0)); | ||
let scale = Vector2::new(10.0, -20.0); | ||
let scaled_aabb = aabb.scaled_wrt_center(&scale); | ||
let scaled_aabb_neg = aabb.scaled_wrt_center(&-scale); | ||
let scaled_aabb_abs = aabb.scaled_wrt_center(&scale.abs()); | ||
|
||
assert_eq!(&scaled_aabb, &scaled_aabb_neg); | ||
assert_eq!(&scaled_aabb, &scaled_aabb_abs); | ||
assert_eq!(aabb.center(), scaled_aabb.center()); | ||
assert_eq!(scaled_aabb.half_extents(), Vector2::new(40.0, 100.0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod aabb_scale; | ||
mod ball_ball_toi; | ||
mod ball_cuboid_contact; | ||
mod epa2; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use na::{Point3, Vector3}; | ||
use parry3d::bounding_volume::Aabb; | ||
|
||
#[test] | ||
fn test_aabb_scale_wrt_center() { | ||
let aabb = Aabb::from_half_extents(Point3::new(1.0, 2.0, 3.0), Vector3::new(4.0, 5.0, 6.0)); | ||
let scale = Vector3::new(10.0, -20.0, 50.0); | ||
let scaled_aabb = aabb.scaled_wrt_center(&scale); | ||
let scaled_aabb_neg = aabb.scaled_wrt_center(&-scale); | ||
let scaled_aabb_abs = aabb.scaled_wrt_center(&scale.abs()); | ||
|
||
assert_eq!(&scaled_aabb, &scaled_aabb_neg); | ||
assert_eq!(&scaled_aabb, &scaled_aabb_abs); | ||
assert_eq!(aabb.center(), scaled_aabb.center()); | ||
assert_eq!(scaled_aabb.half_extents(), Vector3::new(40.0, 100.0, 300.0)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod aabb_scale; | ||
mod ball_ball_toi; | ||
mod ball_triangle_toi; | ||
mod convex_hull; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters