Skip to content

Bump version

Bump version #235

GitHub Actions / clippy succeeded Apr 2, 2024 in 1s

clippy

122 warnings

Details

Results

Message level Amount
Internal compiler error 0
Error 0
Warning 122
Note 0
Help 0

Versions

  • rustc 1.77.1 (7cf61ebde 2024-03-27)
  • cargo 1.77.1 (e52e36006 2024-03-26)
  • clippy 0.1.77 (7cf61eb 2024-03-27)

Annotations

Check warning on line 63 in demos/src/moving_platform.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

associated function `make_system` is never used

warning: associated function `make_system` is never used
  --> demos/src/moving_platform.rs:63:8
   |
54 | impl MovingPlatform {
   | ------------------- associated function in this implementation
...
63 |     fn make_system<V: Component>(
   |        ^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

Check warning on line 229 in demos/src/ui/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `setting_from_ui`

warning: unused variable: `setting_from_ui`
   --> demos/src/ui/mod.rs:229:5
    |
229 |     setting_from_ui: Res<DemoUiPhysicsBackendActive>,
    |     ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_setting_from_ui`

Check warning on line 7 in demos/src/moving_platform.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `app`

warning: unused variable: `app`
 --> demos/src/moving_platform.rs:7:21
  |
7 |     fn build(&self, app: &mut App) {
  |                     ^^^ help: if this is intentional, prefix it with an underscore: `_app`
  |
  = note: `#[warn(unused_variables)]` on by default

Check warning on line 315 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
   --> demos/src/bin/platformer_2d.rs:315:9
    |
205 | /         let command_altering_selectors = CommandAlteringSelectors::default()
206 | |             // By default Tnua uses a raycast, but this could be a problem if the character stands
207 | |             // just past the edge while part of its body is above the platform. To solve this, we
208 | |             // need to cast a shape - which is physics-engine specific. We set the shape using a
...   |
293 | |                 },
294 | |             );
    | |______________- unnecessary `let` binding
...
315 |           command_altering_selectors
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
205 ~         
206 |         #[cfg(feature = "rapier2d")]
  ...
225 |         );
226 ~         CommandAlteringSelectors::default()
227 +             // By default Tnua uses a raycast, but this could be a problem if the character stands
228 +             // just past the edge while part of its body is above the platform. To solve this, we
229 +             // need to cast a shape - which is physics-engine specific. We set the shape using a
230 +             // component.
231 +             .with_combo(
232 +                 "Sensor Shape",
233 +                 1,
234 +                 &[
235 +                     ("Point", |mut cmd| {
236 +                         #[cfg(feature = "rapier2d")]
237 +                         cmd.remove::<TnuaRapier2dSensorShape>();
238 +                         #[cfg(feature = "xpbd2d")]
239 +                         cmd.remove::<TnuaXpbd2dSensorShape>();
240 +                     }),
241 +                     ("Flat (underfit)", |mut cmd| {
242 +                         #[cfg(feature = "rapier2d")]
243 +                         cmd.insert(TnuaRapier2dSensorShape(rapier::Collider::cuboid(0.49, 0.0)));
244 +                         #[cfg(feature = "xpbd2d")]
245 +                         cmd.insert(TnuaXpbd2dSensorShape(xpbd::Collider::rectangle(0.99, 0.0)));
246 +                     }),
247 +                     ("Flat (exact)", |mut cmd| {
248 +                         #[cfg(feature = "rapier2d")]
249 +                         cmd.insert(TnuaRapier2dSensorShape(rapier::Collider::cuboid(0.5, 0.0)));
250 +                         #[cfg(feature = "xpbd2d")]
251 +                         cmd.insert(TnuaXpbd2dSensorShape(xpbd::Collider::rectangle(1.0, 0.0)));
252 +                     }),
253 +                     ("flat (overfit)", |mut cmd| {
254 +                         #[cfg(feature = "rapier2d")]
255 +                         cmd.insert(TnuaRapier2dSensorShape(rapier::Collider::cuboid(0.51, 0.0)));
256 +                         #[cfg(feature = "xpbd2d")]
257 +                         cmd.insert(TnuaXpbd2dSensorShape(xpbd::Collider::rectangle(1.01, 0.0)));
258 +                     }),
259 +                     ("Ball (underfit)", |mut cmd| {
260 +                         #[cfg(feature = "rapier2d")]
261 +                         cmd.insert(TnuaRapier2dSensorShape(rapier::Collider::ball(0.49)));
262 +                         #[cfg(feature = "xpbd2d")]
263 +                         cmd.insert(TnuaXpbd2dSensorShape(xpbd::Collider::circle(0.49)));
264 +                     }),
265 +                     ("Ball (exact)", |mut cmd| {
266 +                         #[cfg(feature = "rapier2d")]
267 +                         cmd.insert(TnuaRapier2dSensorShape(rapier::Collider::ball(0.5)));
268 +                         #[cfg(feature = "xpbd2d")]
269 +                         cmd.insert(TnuaXpbd2dSensorShape(xpbd::Collider::circle(0.5)));
270 +                     }),
271 +                 ],
272 +             )
273 +             .with_checkbox("Lock Tilt", false, |mut cmd, lock_tilt| {
274 +                 // Tnua will automatically apply angular impulses/forces to fix the tilt and make
275 +                 // the character stand upward, but it is also possible to just let the physics
276 +                 // engine prevent rotation (other than around the Y axis, for turning)
277 +                 if lock_tilt {
278 +                     #[cfg(feature = "rapier2d")]
279 +                     cmd.insert(rapier::LockedAxes::ROTATION_LOCKED);
280 +                     #[cfg(feature = "xpbd2d")]
281 +                     cmd.insert(xpbd::LockedAxes::new().lock_rotation());
282 +                 } else {
283 +                     #[cfg(feature = "rapier2d")]
284 +                     cmd.insert(rapier::LockedAxes::empty());
285 +                     #[cfg(feature = "xpbd2d")]
286 +                     cmd.insert(xpbd::LockedAxes::new());
287 +                 }
288 +             })
289 +             .with_checkbox(
290 +                 "Phase Through Collision Groups",
291 +                 true,
292 +                 |mut cmd, use_collision_groups| {
293 +                     #[cfg(feature = "rapier2d")]
294 +                     if use_collision_groups {
295 +                         cmd.insert(CollisionGroups {
296 +                             memberships: Group::GROUP_2,
297 +                             filters: Group::GROUP_2,
298 +                         });
299 +                     } else {
300 +                         cmd.insert(CollisionGroups {
301 +                             memberships: Group::ALL,
302 +                             filters: Group::ALL,
303 +                         });
304 +                     }
305 +                     #[cfg(feature = "xpbd2d")]
306 +                     {
307 +                         let player_layers: LayerMask = if use_collision_groups {
308 +                             [LayerNames::Player].into()
309 +                         } else {
310 +                             [LayerNames::Player, LayerNames::PhaseThrough].into()
311 +                         };
312 +                         cmd.insert(CollisionLayers::new(player_layers, player_layers));
313 +                     }
314 +                 },
315 +             )
    |

Check warning on line 271 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:271:18
    |
271 |                 |mut cmd, use_collision_groups| {
    |                  ----^^^
    |                  |
    |                  help: remove this `mut`

Check warning on line 252 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:252:49
    |
252 |             .with_checkbox("Lock Tilt", false, |mut cmd, lock_tilt| {
    |                                                 ----^^^
    |                                                 |
    |                                                 help: remove this `mut`

Check warning on line 244 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:244:39
    |
244 |                     ("Ball (exact)", |mut cmd| {
    |                                       ----^^^
    |                                       |
    |                                       help: remove this `mut`

Check warning on line 238 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:238:42
    |
238 |                     ("Ball (underfit)", |mut cmd| {
    |                                          ----^^^
    |                                          |
    |                                          help: remove this `mut`

Check warning on line 232 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:232:41
    |
232 |                     ("flat (overfit)", |mut cmd| {
    |                                         ----^^^
    |                                         |
    |                                         help: remove this `mut`

Check warning on line 226 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:226:39
    |
226 |                     ("Flat (exact)", |mut cmd| {
    |                                       ----^^^
    |                                       |
    |                                       help: remove this `mut`

Check warning on line 220 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:220:42
    |
220 |                     ("Flat (underfit)", |mut cmd| {
    |                                          ----^^^
    |                                          |
    |                                          help: remove this `mut`

Check warning on line 214 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

variable does not need to be mutable

warning: variable does not need to be mutable
   --> demos/src/bin/platformer_2d.rs:214:32
    |
214 |                     ("Point", |mut cmd| {
    |                                ----^^^
    |                                |
    |                                help: remove this `mut`
    |
    = note: `#[warn(unused_mut)]` on by default

Check warning on line 319 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:319:59
    |
319 |     cmd.insert(TnuaCrouchEnforcer::new(0.5 * Vector3::Y, |cmd| {
    |                                                           ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 271 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `use_collision_groups`

warning: unused variable: `use_collision_groups`
   --> demos/src/bin/platformer_2d.rs:271:27
    |
271 |                 |mut cmd, use_collision_groups| {
    |                           ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_use_collision_groups`

Check warning on line 271 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:271:22
    |
271 |                 |mut cmd, use_collision_groups| {
    |                      ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 252 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:252:53
    |
252 |             .with_checkbox("Lock Tilt", false, |mut cmd, lock_tilt| {
    |                                                     ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 244 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:244:43
    |
244 |                     ("Ball (exact)", |mut cmd| {
    |                                           ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 238 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:238:46
    |
238 |                     ("Ball (underfit)", |mut cmd| {
    |                                              ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 232 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:232:45
    |
232 |                     ("flat (overfit)", |mut cmd| {
    |                                             ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 226 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:226:43
    |
226 |                     ("Flat (exact)", |mut cmd| {
    |                                           ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 220 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:220:46
    |
220 |                     ("Flat (underfit)", |mut cmd| {
    |                                              ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`

Check warning on line 214 in demos/src/bin/platformer_2d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused variable: `cmd`

warning: unused variable: `cmd`
   --> demos/src/bin/platformer_2d.rs:214:36
    |
214 |                     ("Point", |mut cmd| {
    |                                    ^^^ help: if this is intentional, prefix it with an underscore: `_cmd`
    |
    = note: `#[warn(unused_variables)]` on by default

Check warning on line 22 in demos/src/ui/mod.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

unused import: `make_update_plot_data_system`

warning: unused import: `make_update_plot_data_system`
  --> demos/src/ui/mod.rs:22:22
   |
22 | use self::plotting::{make_update_plot_data_system, plot_source_rolling_update};
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

Check warning on line 339 in demos/src/bin/platformer_3d.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
   --> demos/src/bin/platformer_3d.rs:339:9
    |
222 | /         let command_altering_selectors = CommandAlteringSelectors::default()
223 | |             // By default Tnua uses a raycast, but this could be a problem if the character stands
224 | |             // just past the edge while part of its body is above the platform. To solve this, we
225 | |             // need to cast a shape - which is physics-engine specific. We set the shape using a
...   |
319 | |                 },
320 | |             );
    | |______________- unnecessary `let` binding
...
339 |           command_altering_selectors
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
222 ~         
223 |         #[cfg(feature = "rapier3d")]
  ...
240 |         );
241 ~         CommandAlteringSelectors::default()
242 +             // By default Tnua uses a raycast, but this could be a problem if the character stands
243 +             // just past the edge while part of its body is above the platform. To solve this, we
244 +             // need to cast a shape - which is physics-engine specific. We set the shape using a
245 +             // component.
246 +             .with_combo(
247 +                 "Sensor Shape",
248 +                 1,
249 +                 &[
250 +                     ("no", |mut cmd| {
251 +                         #[cfg(feature = "rapier3d")]
252 +                         cmd.remove::<TnuaRapier3dSensorShape>();
253 +                         #[cfg(feature = "xpbd3d")]
254 +                         cmd.remove::<TnuaXpbd3dSensorShape>();
255 +                     }),
256 +                     ("flat (underfit)", |mut cmd| {
257 +                         #[cfg(feature = "rapier3d")]
258 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::cylinder(
259 +                             0.0, 0.49,
260 +                         )));
261 +                         #[cfg(feature = "xpbd3d")]
262 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::cylinder(0.0, 0.49)));
263 +                     }),
264 +                     ("flat (exact)", |mut cmd| {
265 +                         #[cfg(feature = "rapier3d")]
266 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::cylinder(
267 +                             0.0, 0.5,
268 +                         )));
269 +                         #[cfg(feature = "xpbd3d")]
270 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::cylinder(0.0, 0.5)));
271 +                     }),
272 +                     ("flat (overfit)", |mut cmd| {
273 +                         #[cfg(feature = "rapier3d")]
274 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::cylinder(
275 +                             0.0, 0.51,
276 +                         )));
277 +                         #[cfg(feature = "xpbd3d")]
278 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::cylinder(0.0, 0.51)));
279 +                     }),
280 +                     ("ball (underfit)", |mut cmd| {
281 +                         #[cfg(feature = "rapier3d")]
282 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::ball(0.49)));
283 +                         #[cfg(feature = "xpbd3d")]
284 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::sphere(0.49)));
285 +                     }),
286 +                     ("ball (exact)", |mut cmd| {
287 +                         #[cfg(feature = "rapier3d")]
288 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::ball(0.5)));
289 +                         #[cfg(feature = "xpbd3d")]
290 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::sphere(0.5)));
291 +                     }),
292 +                 ],
293 +             )
294 +             .with_checkbox("Lock Tilt", true, |mut cmd, lock_tilt| {
295 +                 // Tnua will automatically apply angular impulses/forces to fix the tilt and make
296 +                 // the character stand upward, but it is also possible to just let the physics
297 +                 // engine prevent rotation (other than around the Y axis, for turning)
298 +                 if lock_tilt {
299 +                     #[cfg(feature = "rapier3d")]
300 +                     cmd.insert(
301 +                         rapier::LockedAxes::ROTATION_LOCKED_X
302 +                             | rapier::LockedAxes::ROTATION_LOCKED_Z,
303 +                     );
304 +                     #[cfg(feature = "xpbd3d")]
305 +                     cmd.insert(xpbd::LockedAxes::new().lock_rotation_x().lock_rotation_z());
306 +                 } else {
307 +                     #[cfg(feature = "rapier3d")]
308 +                     cmd.insert(rapier::LockedAxes::empty());
309 +                     #[cfg(feature = "xpbd3d")]
310 +                     cmd.insert(xpbd::LockedAxes::new());
311 +                 }
312 +             })
313 +             .with_checkbox(
314 +                 "Phase Through Collision Groups",
315 +                 true,
316 +                 |mut cmd, use_collision_groups| {
317 +                     #[cfg(feature = "rapier3d")]
318 +                     if use_collision_groups {
319 +                         cmd.insert(CollisionGroups {
320 +                             memberships: Group::GROUP_2,
321 +                             filters: Group::GROUP_2,
322 +                         });
323 +                     } else {
324 +                         cmd.insert(CollisionGroups {
325 +                             memberships: Group::ALL,
326 +                             filters: Group::ALL,
327 +                         });
328 +                     }
329 +                     #[cfg(feature = "xpbd3d")]
330 +                     {
331 +                         let player_layers: LayerMask = if use_collision_groups {
332 +                             [LayerNames::Player].into()
333 +                         } else {
334 +                             [LayerNames::Player, LayerNames::PhaseThrough].into()
335 +                         };
336 +                         cmd.insert(CollisionLayers::new(player_layers, player_layers));
337 +                     }
338 +                 },
339 +             )
    |

Check warning on line 345 in demos/src/bin/shooter_like.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

returning the result of a `let` binding from a block

warning: returning the result of a `let` binding from a block
   --> demos/src/bin/shooter_like.rs:345:9
    |
228 | /         let command_altering_selectors = CommandAlteringSelectors::default()
229 | |             // By default Tnua uses a raycast, but this could be a problem if the character stands
230 | |             // just past the edge while part of its body is above the platform. To solve this, we
231 | |             // need to cast a shape - which is physics-engine specific. We set the shape using a
...   |
325 | |                 },
326 | |             );
    | |______________- unnecessary `let` binding
...
345 |           command_altering_selectors
    |           ^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_and_return
    = note: `#[warn(clippy::let_and_return)]` on by default
help: return the expression directly
    |
228 ~         
229 |         #[cfg(feature = "rapier3d")]
  ...
246 |         );
247 ~         CommandAlteringSelectors::default()
248 +             // By default Tnua uses a raycast, but this could be a problem if the character stands
249 +             // just past the edge while part of its body is above the platform. To solve this, we
250 +             // need to cast a shape - which is physics-engine specific. We set the shape using a
251 +             // component.
252 +             .with_combo(
253 +                 "Sensor Shape",
254 +                 1,
255 +                 &[
256 +                     ("no", |mut cmd| {
257 +                         #[cfg(feature = "rapier3d")]
258 +                         cmd.remove::<TnuaRapier3dSensorShape>();
259 +                         #[cfg(feature = "xpbd3d")]
260 +                         cmd.remove::<TnuaXpbd3dSensorShape>();
261 +                     }),
262 +                     ("flat (underfit)", |mut cmd| {
263 +                         #[cfg(feature = "rapier3d")]
264 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::cylinder(
265 +                             0.0, 0.49,
266 +                         )));
267 +                         #[cfg(feature = "xpbd3d")]
268 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::cylinder(0.0, 0.49)));
269 +                     }),
270 +                     ("flat (exact)", |mut cmd| {
271 +                         #[cfg(feature = "rapier3d")]
272 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::cylinder(
273 +                             0.0, 0.5,
274 +                         )));
275 +                         #[cfg(feature = "xpbd3d")]
276 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::cylinder(0.0, 0.5)));
277 +                     }),
278 +                     ("flat (overfit)", |mut cmd| {
279 +                         #[cfg(feature = "rapier3d")]
280 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::cylinder(
281 +                             0.0, 0.51,
282 +                         )));
283 +                         #[cfg(feature = "xpbd3d")]
284 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::cylinder(0.0, 0.51)));
285 +                     }),
286 +                     ("ball (underfit)", |mut cmd| {
287 +                         #[cfg(feature = "rapier3d")]
288 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::ball(0.49)));
289 +                         #[cfg(feature = "xpbd3d")]
290 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::sphere(0.49)));
291 +                     }),
292 +                     ("ball (exact)", |mut cmd| {
293 +                         #[cfg(feature = "rapier3d")]
294 +                         cmd.insert(TnuaRapier3dSensorShape(rapier::Collider::ball(0.5)));
295 +                         #[cfg(feature = "xpbd3d")]
296 +                         cmd.insert(TnuaXpbd3dSensorShape(xpbd::Collider::sphere(0.5)));
297 +                     }),
298 +                 ],
299 +             )
300 +             .with_checkbox("Lock Tilt", true, |mut cmd, lock_tilt| {
301 +                 // Tnua will automatically apply angular impulses/forces to fix the tilt and make
302 +                 // the character stand upward, but it is also possible to just let the physics
303 +                 // engine prevent rotation (other than around the Y axis, for turning)
304 +                 if lock_tilt {
305 +                     #[cfg(feature = "rapier3d")]
306 +                     cmd.insert(
307 +                         rapier::LockedAxes::ROTATION_LOCKED_X
308 +                             | rapier::LockedAxes::ROTATION_LOCKED_Z,
309 +                     );
310 +                     #[cfg(feature = "xpbd3d")]
311 +                     cmd.insert(xpbd::LockedAxes::new().lock_rotation_x().lock_rotation_z());
312 +                 } else {
313 +                     #[cfg(feature = "rapier3d")]
314 +                     cmd.insert(rapier::LockedAxes::empty());
315 +                     #[cfg(feature = "xpbd3d")]
316 +                     cmd.insert(xpbd::LockedAxes::new());
317 +                 }
318 +             })
319 +             .with_checkbox(
320 +                 "Phase Through Collision Groups",
321 +                 true,
322 +                 |mut cmd, use_collision_groups| {
323 +                     #[cfg(feature = "rapier3d")]
324 +                     if use_collision_groups {
325 +                         cmd.insert(CollisionGroups {
326 +                             memberships: Group::GROUP_2,
327 +                             filters: Group::GROUP_2,
328 +                         });
329 +                     } else {
330 +                         cmd.insert(CollisionGroups {
331 +                             memberships: Group::ALL,
332 +                             filters: Group::ALL,
333 +                         });
334 +                     }
335 +                     #[cfg(feature = "xpbd3d")]
336 +                     {
337 +                         let player_layers: LayerMask = if use_collision_groups {
338 +                             [LayerNames::Player].into()
339 +                         } else {
340 +                             [LayerNames::Player, LayerNames::PhaseThrough].into()
341 +                         };
342 +                         cmd.insert(CollisionLayers::new(player_layers, player_layers));
343 +                     }
344 +                 },
345 +             )
    |