Skip to content

Commit

Permalink
Fix QueryFilterFlags values having a bitshift too much (#673)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz authored Jul 8, 2024
1 parent 40ee536 commit 87ada34
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/pipeline/query_pipeline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 87ada34

Please sign in to comment.