RapierContext
has been split in multipleComponent
s:RapierContextColliders
RapierContextJoints
RapierContextSimulation
RapierRigidBodySet
- Renamed
DefaultReadRapierContext
andDefaultWriteRapierContext
.- Use
ReadRapierContext
and its associatedsingle()
method.
- Use
- Update from rapier
0.21
to rapier0.22
, see rapier's changelog. - Update bevy to 0.15.
RapierContext
,RapierConfiguration
andSimulationToRenderTime
are now aComponent
instead of resources.- Rapier now supports multiple independent physics worlds, see example
multi_world3
for usage details. - Migration guide:
ResMut<mut RapierContext>
->WriteDefaultRapierContext
Res<RapierContext>
->ReadDefaultRapierContext
- Access to
RapierConfiguration
andSimulationToRenderTime
should query for it on the responsible entity owning theRenderContext
.
- 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 to get more context and information.
- Rapier now supports multiple independent physics worlds, see example
colliders_with_aabb_intersecting_aabb
now takesbevy::math::bounding::Aabb3d
(or[..]::Aabb2d
in 2D) as parameter.- it is now accessible with
headless
feature enabled.
- it is now accessible with
- Fix a crash when using
TimestepMode::Interpolated
and removing colliders during a frame which would not run a simulation step.
- Added a
TriMeshFlags
parameter forComputedColliderShape
, its default value isTriMeshFlags::MERGE_DUPLICATE_VERTICES
, which was its hardcoded behaviour. - Added a way to configure which colliders should be debug rendered:
global
parameter for bothRapierDebugColliderPlugin
andDebugRenderContext
, as well as individual collider setup via aColliderDebug
component.
This is an update from rapier 0.19 to Rapier 0.21 which includes several stability improvements and new features. Please have a look at the 0.20 and 0.21 changelogs of Rapier.
- Update from rapier
0.19
to rapier0.21
. - Update to nalgebra
0.33
. - Update to bevy
0.14
. - Renamed
has_any_active_contacts
tohas_any_active_contact
for better consistency with rapier. ColliderDebugColor
's property is now abevy::color::Hsla
.ImpulseJoint::data
andMultibodyJoint::data
are now a more detailed enumTypedJoint
instead of aGenericJoint
. You can still access its innerGenericJoint
with.as_ref()
oras_mut()
.data
fields from all joints (FixedJoint
, …) are now public, and their getters removed.
- Derive
Debug
forLockedAxes
. - Expose
is_sliding_down_slope
to bothMoveShapeOutput
andKinematicCharacterControllerOutput
. - Added a First Person Shooter
character_controller
example forbevy_rapier3d
. - Added serialization support for
CollisionGroups
,SolverGroups
,ContactForceEventThreshold
,ContactSkin
. - Added
RapierContext::context.impulse_revolute_joint_angle
to compute the angle along a revolute joint’s principal axis.
- Fix rigidbodies never going to sleep when a scale was applied to their
Transform
. - Fix losing information about hit details when converting from
ShapeCastHit
in parry toShapeCastHit
in bevy_rapier
This is an update to Rapier 0.19 which includes several stability improvements and character-controller fix. Please have a look at the 0.19 changelog of Rapier.
- Renamed
Toi/ToiDetails
toShapeCastHit/ShapeCastHitDetails
. - Switch to rapier’s built-in
length_unit
instead of explicitly scaling shapes withphysics_scale
. - Linear shape-casting functions now take a
ShapeCastOptions
parameter that describes how the shape-cast should behave on special-cases (like toi == 0). - Internal edge correction is now opt-in with the
TriMeshFlags::FIX_INTERNAL_EDGES
andHeightFieldFlags::FIX_INTERNAL_EDGES
flags. - Rename
RayIntersection::toi
toRayIntersection::time_of_impact
.
- Fix character controller occasionally getting stuck against vertical walls.
- Add the
SoftCcd
(for rigid-bodies) andContactSkin
(for colliders) components. See rapier#625 for details on the features they enable.
- Update to bevy
0.13
.
The main highlight of this release is the implementation of a new non-linear constraints solver for better stability and increased convergence rates. See #579 for additional information.
In order to adjust the number of iterations of the new solver, simply
adjust IntegrationParameters::num_solver_iterations
.
If recovering the old solver behavior is useful to you, call IntegrationParameters::switch_to_standard_pgs_solver()
.
It is now possible to specify some additional solver iteration for specific rigid-bodies (and everything interacting
with it directly or indirectly through contacts and joints) by adding the AdditionalSolverIterations
component to the
same entity as the rigid-body. This allows for higher-accuracy on subsets of the physics scene without affecting
performance of the other parts of the simulation.
- Fix bug causing angular joint limits and motor to sometimes only take into account half of the angles specified by the user.
- Fix bug where collisions would not be re-computed after a collider was re-enabled.
- Add a
SpringJoint
andSpringJointBuilder
for simulating springs with customizable stiffness and damping coefficients. - Fix incorrect update of angular degrees-of-freedoms on spherical multibody joints.
- Fix debug-renderer showing moved kinematic rigid-bodies only at their initial position.
- Rename
RapierContext::contacts_with
toRapierContext::contact_pairs_with
. - Rename
RapierContext::intersections_with
toRapierContext::intersection_pairs_with
. - Collisions between the character controller and sensors are now disabled by default.
- Update to Bevy 0.12
ColliderView::as_typed_shape
and::to_shared_shape
to convert aColliderView
to a parry’sTypedShape
orSharedShape
. TheFrom
trait has also been implemented accordingly.- Implement
Copy
forColliderView
and all the other non-mut shape views. - Add
RapierContext::rigid_body_colliders
to retrieve all collider entities attached to this rigid-body. - Add
RapierPhysicsPlugin::in_fixed_schedule
/::in_schedude
to add rapier’s systems to a fixed/custom schedule. - Re-export
JointAxesMask
,JointAxis
,MotorModel
. - Implement
Deref
forReadMassProperties
. - Expose the
stop_at_penetration
parameter of shape-casting, to enable or ignore overlaps at the initial position of the shape.
- Fix
RapierContext::integration_parameters::dt
not being updated on non-fixed timestep modes. - Fix debug-renderer lagging one frame behind.
- Fix Collider
Transform
rotation change not being taken into account by the physics engine. - Fix automatic update of
ReadMassProperties
.
- Update to Bevy 0.11.
- Disabled rigid-bodies are no longer synchronized with the rapier backend.
- Switch to bevy’s gizmo system for the debug-renderer. This removes the vendored debug lines plugin.
- Add a joint for simulating ropes: the
RopeJoint
. - Add
Velocity::linear_velocity_at_point
to calculate the linear velocity at the given world-space point. - Add the
ComputedColliderShape::ConvexHull
variant to automatically calculate the convex-hull of an imported mesh. - Implement
Reflect
for the debug-renderer.
- Fix broken interpolation for rigid-bodies with the
TransformInterpolation
component. - Fix compilation when
bevy_rapier
is being used with headless bevy. - Improved performance of the writeback system by not iterating on non-rigid-body entities.
- Fix typo by renaming
CuboidViewMut::sed_half_extents
toset_half_extents
. - Properly scale parented collider’s offset based on changes on its
ColliderScale
.
- Update to Bevy 0.10.
- The
PhysicsHooksWithQuery
trait has been renamed to by theBevyPhysicsHooks
. - Bevy resources and queries accessed by the physics hook are now specified by the implementer of
BevyPhysicsHooks
which must derive Bevy’sSystemParam
trait. This implies that the physics hook’sfilter_contact_pair
(and all its other methods) no longer take the BevyQuery
as argument. Queries and resources are accessed throughself
. - Rename
PhysicsStages
toPhysicsSet
.
- Add the
RigidBodyDisabled
andColliderDisabled
component that can be inserted to disable a rigid-body or collider without removing it from the scene.
- Fix spawn position of colliders without rigid bodies.
- Fix overriding enabled flag in debug render.
- Make debug-rendering enabled by default when inserting the
RapierDebugRenderPlugin
plugin with its default configuration. - The
debug-render
feature has been replaced by two features:debug-render-2d
anddebug-render-3d
. For example, usingdebug-render-2d
withbevy_rapier3d
, the debug-render will work with 2D cameras (useful, e.g., for top-down games with 3D graphics). - In order to facilitate the use of
bevy_rapier
in headless mode, theAsyncCollider
andAsyncSceneCollider
components were moved behind theasync-collider
feature (enabled by default). Disabling that feature will makebevy_rapier
work even with theMinimalPlugins
inserted instead of theDefaultPlugins
. - Corrected an API inconsistency where
bevy_rapier
components would sometimes require anInteracitonGroup
type defined inrapier
. It has been replaced by theCollisionGroup
type (defined inbevy_rapier
). Velocity::zero,linear,angular
are now const-fn.
- Update to Bevy 0.9
- Add the accessor
RapierContext::physics_scale()
to read the physics scale that was set when initializing the plugin. - Add
RapierConfiguration::force_update_from_transform_changes
to force the transform updates even if it is equal to the transform that was previously set. Useful for rollback in networked applications described in #261. - Add
Collider::trimesh_with_flags
to create a triangle mesh collider with custom pre-processing flags.
- Reset the
ExternalImpulse
component after each step automatically. - Fix
transform_to_iso
to preserve identical rotations instead of converting to an intermediate axis-angle representation. - Fix internal edges of 3D triangle meshes or 3D heightfields generating invalid contacts
preventing balls from moving straight. Be sure to set the triangle mesh flag
TriMeshFlags::MERGE_DUPLICATE_VERTICES
when creating the collider if your mesh have duplicated vertices.
- Rename
AABB
toAabb
to comply with Rust’s style guide.
- Add a kinematic character controller implementation. This feature is accessible in two different ways:
- The first approach is to insert the
KinematicCharacterController
component to an entity. If theKinematicCharacterController::custom_shape
field is set, then this shape is used for the character control. If this field isNone
then theCollider
attached to the same entity as the character controller is used. The character controller will be automatically updated when theKinematicCharacterController::movement
is set. The result position is written to theTransform
of the character controller’s entity. - The second, lower level, approach, is to call
RapierContext::move_shape
to compute the possible movement of a shape, taking obstacle and sliding into account.
- The first approach is to insert the
- Add implementations of
Add
,AddAssign
,Sub
,SubAssign
toExternalForce
andExternalImpulse
. - Add
ExternalForce::at_point
andExternalImpulse::at_point
to apply a force/impulse at a specific point of a rigid-body.
- Fix shapes quickly switching between scaled and non-scaled versions due to rounding errors in the scaling extraction from bevy’s global affine transform.
- Implement
Debug
forCollider
andColliderView
. - Add the missing
ActiveEvent::CONTACT_FORCE_EVENTS
to enable contact force events on a collider.
- Fix crash of the 2D debug-render on certain platforms (including Metal/MacOS).
- Fix bug where collision events and contact force events were not cleared automatically.
- Implement
Reflect
forAsyncCollider
.
- Switch to Bevy 0.8.
- Fix unpredictable broad-phase panic when using small colliders in the simulation.
- Fix collision events being incorrectly generated for any shape that produces multiple contact manifolds (like triangle meshes).
- Fix transform hierarchies not being properly taken into account for colliders with a parent rigid-body.
- Fix force and impulse application when the
ExternalImpulse
orExternalForce
components were added at the same time as the rigid-body creation. - Fix sleeping threshold application when these thresholds are set at the same time as the rigid-body creation.
- Add the
ColliderMassProperties::Mass
variant to let the user specify a collider’s mass directly (instead of its density). As a result the collider’s angular inertia tensor will be automatically be computed based on this mass and its shape. - Add the
ContactForceEvent
event. It can be read by a bevy system with theEventReader<ContactForceEvent>
. This event is useful to read contact forces. AContactForceEvent
is generated whenever the sum of the magnitudes of the forces applied by contacts between two colliders exceeds the value specified by theContactForceEventThreshold
component. - Add the
QueryFilter
struct that is now used by all the scene queries instead of theCollisionGroups
andFn(Entity) -> bool
closure. ThisQueryFilter
provides easy access to most common filtering strategies (e.g. dynamic bodies only, excluding one particular entity, etc.) for scene queries. - Added some missing serialization of joints.
- Implement
Default
forCollider
. It defaults to aBall
with radius 0.5. - Added a
contacts_enabled
flag to all the joints. If this flag is set tofalse
for a joint, no contact will be computed between two colliders attached to rigid-bodies liked by that joint.
- The
MassProperties
struct is no longer aComponent
. A common mistake was to assume thatMassProperties
could be used to initialize the mass/angular inertia tensor of a rigid-body. It is not the case. Instead, the user should use theAdditionalMassProperties
component. TheReadMassProperties
component has been added to read the mass properties of a rigid-body. - The
Sensor
component is now a marker component: if it exists the related collider is a sensor, otherwise it is a solid collider.
- Add the missing
init_async_scene_colliders
to the list of the plugin systems.
- Add the
AsyncSceneCollider
component to generate collision for scene meshes similar toAsyncCollider
. - Add calls to
App::register_type
for the types implementingReflect
.
Collider::bevy_mesh
,Collider::bevy_mesh_convex_decomposition
andCollider::bevy_mesh_convex_decomposition_with_params
was replaced with singleCollider::from_bevy_mesh
function which acceptsComputedColliderShape
.AsyncCollider
is now a struct which contains a mesh handle andComputedColliderShape
.- The physics systems are now running after
CoreStage::Update
but beforeCoreStage::PostUpdate
. - The collider and rigid-body positions are read from the
GlobalTransform
instead ofTransform
(the transforms modified by Rapier are written back to theTransform
component). It is therefore important to insert both aTransform
andGlobalTransform
component (or theTransformBundle
bundle). - It is now possible to prevent the plugin from registering its system thanks
to
RapierPhysicsPlugin::with_default_system_setup(false)
. If that’s the case, theRapierPhysicsPlugin::get_systems
method can be called to retrieve the relevantSystemSet
that can be added to your own stages in order to apply your own scheduling.
- Fixed issues where contact regularization (using compliance) would result in tunnelling despite tunnelling being enabled.
- Don’t overwrite the user’s
RapierConfiguration
if one already exists before initializing the plugin.
- The
TimestepMode
andSimulationToRenderTime
structures are now public.
- Fixed colors rendered by the debug-renderer.
- Fix issue where the debug-renderer would sometimes render lines behind the user’s meshes/sprites.
- Add the
CollidingEntities
components which tracks the set of entities colliding with a given entity. - Add constructors
Velocity::linear
,Velocity::angular
,Ccd::enabled()
,Ccd::disabled()
,Dominance::group
,Friction::coefficient
,Restitution::coefficient
,CollisionGroups::new
,SolverGroups::new
. - Add
RapierContext::collider_parent
that returns the entity containing the parentRigidBody
of a collider.
- Switched to linear ordering to order our systems.
- Make the
plugin::systems
module public.
This is a complete rewrite of the plugin (mostly likely the last large redesign this plugin
will be subject to). It switches to rapier
0.12 and bevy
0.7. The focus of this rewrite was
to significantly improve ergonomics while simplifying the codebase and adding new features.
Refer to #138 for extensive details
on this change. See the folders bevy_rapier2d/examples
and bevy_rapier3d/examples
for some examples.
- Switch to
rapier
0.12.0-alpha.0 andnalgebra
0.30. - Switch to
bevy
0.6. - All the Rapier components have been wrapped into wrapper types (for example
ColliderPosition
has been wrapped intoColliderPositionComponent
). These wrapper types are the ones that need to be used as bevy components. To convert a Rapier component to it’s corresponding Bevy component, simply use.into()
. See the examples inbevy_rapier2d/examples
andbevy_rapier3d/examples
for details.
- Switch to
Rapier
0.11 andnalgebra
0.29. - Add labels to each system from
bevy-rapier
.
- Fix panics when despawning joints or colliders.
- Fix a panic where adding a collider.
- Don’t let the plugin overwrite the user’s
PhysicsHooksWithQueryObject
if it was already present before inserting the plugin.
- Fix build when targeting WASM.
- Fix joint removal when despawning its entity.
A new, exhaustive, user-guide for bevy_rapier has been uploaded to rapier.rs.
This version is a complete rewrite of the plugin. Rigid-bodies and
colliders are now split into components that can be queried like any other
components. They are created by inserting a RigidBodyBundle
and/or a ColliderBundle
.
In addition, the Entity
type and ColliderHandle/RigidBodyHandle
type can now be
converted directly using entity.handle()
or handle.entity()
.
Finally, there is now a prelude: use bevy_rapier2d::prelude::*
.
- The
ColliderDebugRender
component must be added to an entity containing a collider shape in order to render it.
- Use the version 0.5.0 of Rapier.
- The debug rendering of 3D trimesh now work.
- The debug rendering won't crash any more if a not-yet-supported shape is used. It will silently ignore the shape instead.
- The crate has now a
render
feature that allows building it without any rendering support (avoiding some dependencies that may not compile when targeting WASM).
- Use the version 0.4.0 of Bevy.
- Fix the rendering of colliders attached to an entity children of another entity containing the rigid-body it is attached to.
- The adaptive change of number of timesteps executed during each render loop
(introduced in the version 0.4.0 with position interpolation) is
now disabled by default. It needs to be enabled explicitly by setting
RapierConfiguration.time_dependent_number_of_timesteps
totrue
.
- It is now possible to attach multiple colliders to a single
rigid-body by using Bevy hierarchy: an entity contains
the
RigidBodyBuilder
whereas its children contain theColliderBuilder
.
- We now use the latest version of Rapier: 0.4.0. See the Rapier changelog for details. In particular, this includes the ability to lock the rotations of a rigid-body.
- We now use the latest version of Bevy: 0.3.0
- Rigid-bodies, colliders, and joints, will automatically removed from the Rapier sets when their corresponding Bevy components are removed.
This release update the plugin to the latest version of Rapier, which itself includes lots of new features. Refer to the Rapier changelogs for details.
- A
InteractionPairFilters
resource where you can your own filters for contact pair and proximity pair filtering. Before considering the use of a custom filter, consider using collision groups instead (as it is faster, but less versatile).
- The stepping system now applies interpolation between two physics state at render time. Refer to that issue and the following blog post article for details: https://www.gafferongames.com/post/fix_your_timestep/
- Rapier configuration
- Replaced
Gravity
andRapierPhysicsScale
resources with a uniqueRapierConfiguration
resource. - Added an
physics_pipeline_active
attribute toRapierConfiguration
allowing to pause the physic simulation. - Added a
query_pipeline_active
attribute toRapierConfiguration
allowing to pause the query pipeline update.
- Replaced