Skip to content

Commit

Permalink
fix: Set Rapier IntegrationParameters to allow snappy collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
PraxTube committed Aug 2, 2024
1 parent 7a6c54b commit efcbe76
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/world/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use camera::MainCamera;
// pub use camera_shake::CameraShake;

use bevy::prelude::*;
use bevy_rapier2d::prelude::*;
use bevy_rapier2d::{prelude::*, rapier::dynamics::IntegrationParameters};

use crate::GameState;

Expand All @@ -25,6 +25,14 @@ impl Plugin for WorldPlugin {
}
}

fn configure_physics(mut rapier_config: ResMut<RapierConfiguration>) {
fn configure_physics(
mut rapier_config: ResMut<RapierConfiguration>,
mut rapier_context: ResMut<RapierContext>,
) {
rapier_config.gravity = Vec2::ZERO;
rapier_context.integration_parameters = IntegrationParameters {
normalized_max_corrective_velocity: f32::MAX,
contact_damping_ratio: 1.0,
..default()
};
}

0 comments on commit efcbe76

Please sign in to comment.