Skip to content

Commit

Permalink
Fix the default layers used by ColliderConstructorHierarchy (#649)
Browse files Browse the repository at this point in the history
# Objective

#476 changed `CollisionLayers` to use one membership (the first layer) and all filters by default. However, `ColliderConstructorHierarchy` is still using the old default!

## Solution

Use `CollisionLayers::default()` (one membership, all filters) by default for `ColliderConstructorHierarchy`.

---

## Migration Guide

`ColliderConstructorHierarchy` now defaults to one membership (the first layer) and all filters for the `CollisionLayers` of generated colliders. This is consistent with how `CollisionLayers` already works normally.
  • Loading branch information
Jondolf authored Feb 5, 2025
1 parent be9ebc5 commit c1f9722
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/collision/collider/constructor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pub struct ColliderConstructorHierarchy {
pub default_constructor: Option<ColliderConstructor>,
/// The default [`CollisionLayers`] used for colliders in the hierarchy.
///
/// [`CollisionLayers::ALL`] by default.
/// [`CollisionLayers::default()`] by default, with the first layer and all filters.
pub default_layers: CollisionLayers,
/// The default [`ColliderDensity`] used for colliders in the hierarchy.
///
Expand All @@ -141,7 +141,7 @@ impl ColliderConstructorHierarchy {
pub fn new(default_constructor: impl Into<Option<ColliderConstructor>>) -> Self {
Self {
default_constructor: default_constructor.into(),
default_layers: CollisionLayers::ALL,
default_layers: CollisionLayers::default(),
default_density: ColliderDensity(1.0),
config: default(),
}
Expand Down

0 comments on commit c1f9722

Please sign in to comment.