PR #927 overhauled broad phase collision detection to use a Bounding Volume Hierarchy (BVH).
BroadPhasePlugin has been replaced by two plugins:
BroadPhaseCorePlugin: Sets up resources, system sets, and diagnostics required for broad phase collision detection.BvhBroadPhasePlugin: Implements a broad phase using a BVH to efficiently find overlapping AABBs.
The latter can be swapped out for a custom broad phase implementation if desired. See the documentation of the `broad_phase plugin for more information.
The BroadPhaseSystems::UpdateStructures system set has also been removed.
The BVH acceleration structures are updated by the ColliderTreePlugin,
in ColliderTreeSystems::UpdateAabbs.
Contact pair creation order can be different from before due to the new broad phase algorithm, resulting in slightly changed behavior (but you should not rely on a specific contact order anyway). The order should still be deterministic across runs, given the same inputs.
Previously, ContactPair::body1 and ContactPair::body2 also used the Entity of the collider
if the collider was not attached to a body. Now, the properties are instead None.
PR #941 changed spatial queries to reuse
the ColliderTrees used by the broad phase.
The SpatialQueryPipeline has been removed. Instead, use the SpatialQuery system parameter,
or for lower level control, use the ColliderTrees resource directly.
If you get query conflicts because SpatialQuery queries for &Position and &Rotation and your system
also queries for them mutably, consider deferring the mutation to a later point to avoid the conflict.
Previously, you could call SpatialQuery::update_pipeline() to update the internal acceleration structures
when you have made changes to colliders or their positions, and need to perform spatial queries before the next physics step.
This method no longer exists, but there is instead a public update_moved_collider_aabbs system that you can run.
Shape casts now return hits in arbitrary order when max_hits > 1, similar to ray casts.
This is for performance reasons.
Previously, point2 in ShapeHitData was also relative to the shape cast origin,
even though documentation described it as a global point. This has been fixed,
and it is now in world space like the other values.
RevoluteJoint and PrismaticJoimt now store motors for driving movement.
By default, they are disabled, so this should not be a breaking change for most applications.
PR #908 introduced two new traits: ReadRigidBodyForces and WriteRigidBodyForces, and RigidyBodyForces is now defined as:
pub trait RigidBodyForces: ReadRigidBodyForces + WriteRigidBodyForces {}In most cases this should just work, but if it doesn't, you can replace your implementation for RigidBodyForces with both ReadRigidBodyForces and WriteRigidBodyForces where it is used / needed. Both traits are required to implement RigidBodyForces, but you can implement them separately.
The CollisionLayers and ActiveCollisionHooks components are now immutable
to reduce change detection overhead and enforce internal invariants more strictly.
To modify their values, reinsert the components with new values using EntityCommands::insert.
The SleepBody and WakeBody commands now return an error when applied for an entity that doesn't exist
or doesn't belong to an island. Previously, they logged a warning instead.