aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Berger <contact@thierryberger.com>2024-07-08 16:53:30 +0200
committerGitHub <noreply@github.com>2024-07-08 16:53:30 +0200
commit87ada34008f4a1a313ccf8c3040040bab4f10e69 (patch)
tree3c2eee80a2f919c4fc08cb090431c3de6251033c
parent40ee5367d89bd624cb4e01fbd304de494564ebd6 (diff)
downloadrapier-87ada34008f4a1a313ccf8c3040040bab4f10e69.tar.gz
rapier-87ada34008f4a1a313ccf8c3040040bab4f10e69.tar.bz2
rapier-87ada34008f4a1a313ccf8c3040040bab4f10e69.zip
Fix QueryFilterFlags values having a bitshift too much (#673)
-rw-r--r--CHANGELOG.md5
-rw-r--r--src/pipeline/query_pipeline/mod.rs10
2 files changed, 10 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f0026e5..1f6007f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,11 @@
- Implement rotation gizmo for Ball 2D shape (as radius line) in Debug renderer if `DebugRenderMode::COLLIDER_SHAPES`
enabled
+### Modified
+
+- Divided by two the value of each `QueryFilterFlags` variant so that
+ the smallest one is 1 instead of 2 (fixes a bug in rapier.js).
+
## v0.21.0 (23 June 2024)
### Fix
diff --git a/src/pipeline/query_pipeline/mod.rs b/src/pipeline/query_pipeline/mod.rs
index 18d7948..a822512 100644
--- a/src/pipeline/query_pipeline/mod.rs
+++ b/src/pipeline/query_pipeline/mod.rs
@@ -47,15 +47,15 @@ bitflags::bitflags! {
/// Flags for excluding whole sets of colliders from a scene query.
pub struct QueryFilterFlags: u32 {
/// Exclude from the query any collider attached to a fixed rigid-body and colliders with no rigid-body attached.
- const EXCLUDE_FIXED = 1 << 1;
+ const EXCLUDE_FIXED = 1 << 0;
/// Exclude from the query any collider attached to a kinematic rigid-body.
- const EXCLUDE_KINEMATIC = 1 << 2;
+ const EXCLUDE_KINEMATIC = 1 << 1;
/// Exclude from the query any collider attached to a dynamic rigid-body.
- const EXCLUDE_DYNAMIC = 1 << 3;
+ const EXCLUDE_DYNAMIC = 1 << 2;
/// Exclude from the query any collider that is a sensor.
- const EXCLUDE_SENSORS = 1 << 4;
+ const EXCLUDE_SENSORS = 1 << 3;
/// Exclude from the query any collider that is not a sensor.
- const EXCLUDE_SOLIDS = 1 << 5;
+ const EXCLUDE_SOLIDS = 1 << 4;
/// Excludes all colliders not attached to a dynamic rigid-body.
const ONLY_DYNAMIC = Self::EXCLUDE_FIXED.bits() | Self::EXCLUDE_KINEMATIC.bits();
/// Excludes all colliders not attached to a kinematic rigid-body.