Skip to content

Commit

Permalink
changelog adaptations
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Oct 14, 2024
1 parent 78dc64e commit 8d78d77
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 19 deletions.
22 changes: 12 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,24 @@ which was its hardcoded behaviour.
### Modified

- Rapier now supports multiple independent physics worlds, see example `multi_world3` for usage details.
- `RapierContext` is no longer a resource: it has been split in multiple `Component`s:
- `RapierContextColliders`
- `RapierContextJoints`
- `RapierContextSimulation`
- `RapierRigidBodySet`
- Each entity managed by bevy_rapier has a `RapierContextEntityLink` pointing to the entity containing the components above.
- `RapierContext` was reworked to be a `SystemParam`, to help with migration. See `ray_casting` examples for a usage example.
- `RapierConfiguration` and `RenderToSimulationTime` are now `Component`s instead of resources.
- `RapierContext`, `RapierConfiguration` and `SimulationToRenderTime` are no longer a resource.
- They have been split in multiple `Component`s:
- `RapierContextColliders`
- `RapierContextJoints`
- `RapierContextSimulation`
- `RapierRigidBodySet`
- `SimulationToRenderTime`
- `RapierConfiguration`
- Migration guide:
- `ResMut<mut RapierContext>` -> `WriteRapierContext`
- `Res<RapierContext>` -> `ReadRapierContext`
- Access to `RapierConfiguration` and `RenderToSimulationTime` should query for it
- Access to `RapierConfiguration` and `SimulationToRenderTime` should query for it
on the responsible entity owning the `RenderContext`.
- See [`ray_casting`](bevy_rapier3d/examples/ray_casting3.rs) example for a usage example.
- Each entity managed by bevy_rapier has a `RapierContextEntityLink` pointing to the entity containing the components above.
- If you are building a library on top of `bevy_rapier` and would want to support multiple independent physics worlds too,
you can check out the details of [#545](https://github.com/dimforge/bevy_rapier/pull/545)
to get more context and information.
to find more information.

## v0.27.0 (07 July 2024)

Expand Down
11 changes: 2 additions & 9 deletions src/plugin/context/systemparams/rapier_context_systemparam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ use crate::{
use crate::prelude::RapierContextBundle;

/// Utility [`SystemParam`] to easily access every required components of a [`RapierContext`] immutably.
///
/// SAFETY: Dereferencing this struct will panic if its underlying query fails.<br />
/// Use [`ReadRapierContext::rapier_context`] query,
/// or a regular bevy query instead of this [`ReadRapierContext`] for a safer alternative.
#[derive(SystemParam)]
pub struct ReadRapierContext<'w, 's, T: query::QueryFilter + 'static = With<DefaultRapierContext>> {
/// The query used to feed components into [`RapierContext`] struct through [`ReadRapierContext::single`].
Expand All @@ -43,6 +39,7 @@ impl<'w, 's, T: query::QueryFilter + 'static> ReadRapierContext<'w, 's, T> {
/// Use this method if you only have one [`RapierContext`].
///
/// SAFETY: This method will panic if its underlying query fails.
///
/// Use the underlying query [`ReadRapierContext::rapier_context`] for safer alternatives.
pub fn single(&'_ self) -> RapierContext {
let (simulation, colliders, joints, query_pipeline, rigidbody_set) =
Expand Down Expand Up @@ -75,11 +72,7 @@ pub struct RapierContext<'a> {
pub rigidbody_set: &'a RapierRigidBodySet,
}

/// Utility [`SystemParam`] to easily access every required components of a [`RapierContext`] immutably.
///
/// SAFETY: Dereferencing this struct will panic if its underlying query fails.<br />
/// Use [`ReadRapierContext::rapier_context`] query,
/// or a regular bevy [`Query`] instead of this [`ReadRapierContext`] for a safer alternative.
/// Utility [`SystemParam`] to easily access every required components of a [`RapierContext`] mutably.
#[derive(SystemParam)]
pub struct WriteRapierContext<'w, 's, T: query::QueryFilter + 'static = With<DefaultRapierContext>>
{
Expand Down

0 comments on commit 8d78d77

Please sign in to comment.