dimforge / dimforge/bevy_rapier

Implement the methods of RapierContext on RapierContextItem instead

Open
#677 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.6k
Forks
282
PR merge metrics
No merged PRs in 30d

Description

[`RapierContext`](https://docs.rs/bevy_rapier3d/0.31.0/bevy_rapier3d/plugin/context/systemparams/struct.RapierContext.html) has various methods that can be used to query the simulated world. Problem is - you never actually get a value (or even reference) of the type `RapierContext`. Bevy queries don't return the item itself - instead they return its [`QueryData::Item`](https://docs.rs/bevy_rapier3d/0.31.0/bevy_rapier3d/plugin/context/systemparams/struct.RapierContext.html#associatedtype.Item). In our case - it's [`RapierContextItem`](https://docs.rs/bevy_rapier3d/0.31.0/bevy_rapier3d/plugin/context/systemparams/struct.RapierContextItem.html), which is generated automatically by the `#[derive(query::QueryData)]` and does not have any of these methods, making them unusable.

If these methods were implemented on `RapierContextItem` instead of `RapierContext` (which should be doable even if `RapierContextItem` itself is generated by a macro) then `Query<&RapierContext>` would be usable (currently it isn't)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.