Skip to content

Commit e4cb487

Browse files
committed
Make spatial queries generic over colliders (WIP)
1 parent 64e7387 commit e4cb487

File tree

22 files changed

+1831
-1058
lines changed

22 files changed

+1831
-1058
lines changed

Cargo.lock

Lines changed: 132 additions & 6 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",
@@ -91,6 +92,7 @@ bevy_heavy = { git = "https://github.com/Jondolf/bevy_heavy.git" }
9192
bevy_transform_interpolation = { version = "0.2" }
9293
libm = { version = "0.2", optional = true }
9394
approx = "0.5"
95+
obvhs = "0.2"
9496
parry2d = { version = "0.21", optional = true }
9597
parry2d-f64 = { version = "0.21", optional = true }
9698
nalgebra = { version = "0.33", features = ["convert-glam029"], optional = true }
@@ -113,6 +115,7 @@ glam = { version = "0.29", features = ["bytemuck"] }
113115
bytemuck = "1.19"
114116
criterion = { version = "0.5", features = ["html_reports"] }
115117
bevy_mod_debugdump = { version = "0.13" }
118+
rand = "0.9"
116119

117120
[lints]
118121
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)