bevy_xpbd_3d_parenting
Allows children of a bevy_xpbd_3d RigidBody to exert forces on their parents.
Installation
# Use the latest release of bevy_xpbd_3d_parenting
[]
= "0.2"
= false
Theoretical usage
This library exports a single Plugin, ParentingPlugin, which must be added
to the app with the same Schedule as bevy_xpbd_3d's PhysicsPlugin.
Then, any systems that mutate these InternalForces should be schedule before:
ManuallyClearForces;
Parents must have:
RigidBodyRigidBody::Dynamicor nothing will moveColliderso that bevy_xpbd works
ExternalForcewithpersistenceset tofalse(will warn usingtracingif not upheld)TransformBundlefor position in space:TransformGlobalTransform
Children must have:
RigidBody, see parentTransformBundle, see parentInternalForceto exert forces on the parent
Types of Internal Forces
Internal forces come in two flavours, InternalForce::Global and InternalForce::Local.
Local InternalForces are in the local space of the parent, while global InternalForces are in the global space.
This means local InternalForces will rotate with the parent, while global InternalForces will not.
Check out the global_versus_local example for a demonstration.
Quick usage example:
See the examples for complete examples.
// Shows a basic usage of [InternalForce].
use *;
use *;
use InternalForce;
Running examples
Run:
Compatibility table
| Bevy | Bevy XPBD | Bevy XPBD 3D Parenting |
|---|---|---|
| 0.12 | 0.3.3 | 0.1.0 |
| 0.13 | 0.4.2 | 0.2.0 |
Developing notes
cargo t for testing, which runs:
- Every combination of feature flags
- A variety of
proptests