Skip to content

Commit

Permalink
v3: gate aabb behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
jcornaz committed Aug 17, 2023
1 parent 508d70c commit 675dcfb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ all-features = true
default = ["std"]
std = ["glam/std", "bvh-arena?/std"]
unstable-v3 = []
unstable-v3-aabb = ["unstable-v3"]

[dependencies]
# Public
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
//! * `unstable-v3` `v3` module, an exploration of what could be the next major version of the API
//!
#[cfg(all(test, feature = "unstable-v3"))]
#[cfg(all(test, feature = "unstable-v3-aabb"))]
extern crate alloc;

mod v2;
Expand Down
5 changes: 3 additions & 2 deletions src/v3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

use sealed::sealed;

#[cfg(feature = "unstable-v3-aabb")]
pub use aabb::Aabb;
pub use point::Point;
use range::Range;
pub use vector::Vec2;

#[cfg(feature = "unstable-v3-aabb")]
mod aabb;
mod point;
mod range;
Expand Down Expand Up @@ -90,8 +92,7 @@ fn contact_time(origin: &impl Shape, vector: Vec2, target: &impl Shape) -> Optio
Some(max_t1)
}

#[cfg(test)]
#[cfg(feature = "std")]
#[cfg(all(test, feature = "std", feature = "unstable-v3-aabb"))]
mod collision_spec {
use rstest::rstest;

Expand Down
2 changes: 1 addition & 1 deletion tests/v3_ray_cast_spec.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![cfg(feature = "unstable-v3")]
#![cfg(feature = "unstable-v3-aabb")]

use approx::assert_abs_diff_eq;
use impacted::v3::{cast_ray, Aabb, Point, Shape, Vec2};
Expand Down

0 comments on commit 675dcfb

Please sign in to comment.