Skip to content

Commit 8356db7

Browse files
committed
Make spatial queries generic over colliders (WIP)
1 parent 081d2de commit 8356db7

File tree

21 files changed

+1831
-1094
lines changed

21 files changed

+1831
-1094
lines changed

Cargo.lock

Lines changed: 140 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/avian2d/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ parallel = [
3333
"bevy/multi_threaded",
3434
"parry2d?/parallel",
3535
"parry2d-f64?/parallel",
36+
"obvhs/parallel",
3637
]
3738
enhanced-determinism = [
3839
"dep:libm",
@@ -92,6 +93,7 @@ bevy_heavy = { version = "0.3" }
9293
bevy_transform_interpolation = { version = "0.3" }
9394
libm = { version = "0.2", optional = true }
9495
approx = "0.5"
96+
obvhs = "0.2"
9597
parry2d = { version = "0.25", optional = true }
9698
parry2d-f64 = { version = "0.25", optional = true }
9799
nalgebra = { version = "0.34", features = ["convert-glam030"], optional = true }
@@ -117,6 +119,7 @@ glam = { version = "0.30", features = ["bytemuck"] }
117119
bytemuck = "1.19"
118120
criterion = { version = "0.5", features = ["html_reports"] }
119121
bevy_mod_debugdump = { version = "0.14" }
122+
rand = "0.9"
120123

121124
[lints]
122125
workspace = true

crates/avian2d/examples/custom_collider.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl AnyCollider for CircleCollider {
6161
&self,
6262
position: Vector,
6363
_: impl Into<Rotation>,
64-
_: AabbContext<Self::Context>,
64+
_: SingleContext<Self::Context>,
6565
) -> ColliderAabb {
6666
ColliderAabb::new(position, Vector::splat(self.radius))
6767
}
@@ -77,7 +77,7 @@ impl AnyCollider for CircleCollider {
7777
_rotation2: impl Into<Rotation>,
7878
prediction_distance: Scalar,
7979
manifolds: &mut Vec<ContactManifold>,
80-
_: ContactManifoldContext<Self::Context>,
80+
_: PairContext<Self::Context>,
8181
) {
8282
// Clear the previous manifolds.
8383
manifolds.clear();

0 commit comments

Comments
 (0)