Skip to content
Merged
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
7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ readme = "README.md"
all-features = true

[features]
parry = ["parry3d-f64", "lru-slab"]
parry = ["parry3d-f64", "lru-slab", "glam"]
fearless_simd = ["dep:fearless_simd"]

[dependencies]
na = { package = "nalgebra", version = "0.34.1" }
glam = { version = "0.33", optional = true, default-features = false, features = ["float-types", "integer-types"] }
slab = "0.4.2"
hashbrown = "0.17"
parry3d-f64 = { version = "0.25.0", optional = true }
parry3d-f64 = { version = "0.30.2", optional = true }
lru-slab = { version = "0.1.1", optional = true }
fearless_simd = { version = "0.7.0", optional = true }

[dev-dependencies]
criterion = "0.8.0"
approx = "0.5"
# Enable glam's approx impls for use with the `approx` crate in tests
glam = { version = "0.33", features = ["approx"] }
simba = { version = "0.9", features = ["wide"] }
fearless_simd = { version = "0.7", features = ["force_support_fallback"] }

Expand Down
19 changes: 8 additions & 11 deletions benches/bench.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use criterion::{criterion_group, criterion_main, Criterion};
#[cfg(feature = "parry")]
use parry3d_f64::{
math::{Pose, Vector},
query::{PointQuery, QueryDispatcher, Ray, RayCast},
shape::Ball,
};
Expand Down Expand Up @@ -75,11 +76,7 @@ fn collision(c: &mut Criterion) {
c.bench_function("intersect", |b| {
b.iter(|| {
assert!(PlanetDispatcher
.intersection_test(
&na::Isometry3::translation(PLANET_RADIUS, 0.0, 0.0),
&planet,
&ball,
)
.intersection_test(&Pose::translation(PLANET_RADIUS, 0.0, 0.0), &planet, &ball,)
.unwrap());
});
});
Expand All @@ -88,8 +85,8 @@ fn collision(c: &mut Criterion) {
b.iter(|| {
planet.cast_local_ray(
&Ray {
origin: na::Point3::new(PLANET_RADIUS + 1.0, 0.0, 0.0),
dir: na::Vector3::y(),
origin: Vector::new(PLANET_RADIUS + 1.0, 0.0, 0.0),
dir: Vector::Y,
},
1e1,
true,
Expand All @@ -101,8 +98,8 @@ fn collision(c: &mut Criterion) {
b.iter(|| {
planet.cast_local_ray(
&Ray {
origin: na::Point3::new(PLANET_RADIUS + 1.0, 0.0, 0.0),
dir: na::Vector3::y(),
origin: Vector::new(PLANET_RADIUS + 1.0, 0.0, 0.0),
dir: Vector::Y,
},
1e3,
true,
Expand All @@ -113,8 +110,8 @@ fn collision(c: &mut Criterion) {
c.bench_function("project point", |b| {
b.iter(|| {
planet.project_point(
&na::Isometry3::identity(),
&na::Point3::new(PLANET_RADIUS + 1.0, 0.0, 0.0),
&Pose::identity(),
Vector::new(PLANET_RADIUS + 1.0, 0.0, 0.0),
true,
)
});
Expand Down
Loading
Loading