Skip to content

Commit

Permalink
Fix interpolation example
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf committed Dec 7, 2024
1 parent a92ed7b commit c712916
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions crates/avian2d/examples/interpolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,20 @@ use bevy::{
fn main() {
let mut app = App::new();

// Add the `PhysicsInterpolationPlugin` to enable interpolation and extrapolation functionality.
//
// By default, interpolation and extrapolation must be enabled for each entity manually.
// Use `PhysicsInterpolationPlugin::interpolate_all()` to enable interpolation for all rigid bodies.
// Interpolation and extrapolation functionality is enabled by the `PhysicsInterpolationPlugin`.
// It is included in the `PhysicsPlugins` by default.
app.add_plugins((
DefaultPlugins,
PhysicsPlugins::default().with_length_unit(50.0),
PhysicsInterpolationPlugin::default(),
));

// By default, interpolation must be enabled for each entity manually
// by adding the `TransformInterpolation` component.
//
// It can also be enabled for all rigid bodies with `PhysicsInterpolationPlugin::interpolate_all()`:
//
// app.add_plugins(PhysicsPlugins::default().set(PhysicsInterpolationPlugin::interpolate_all()));

// Set gravity.
app.insert_resource(Gravity(Vector::NEG_Y * 900.0));

Expand Down

0 comments on commit c712916

Please sign in to comment.