Implement the ability to run multiple CCD substeps.

This commit is contained in:
Crozet Sébastien
2021-03-29 17:21:49 +02:00
parent 8173e7ada2
commit a733f97028
12 changed files with 244 additions and 97 deletions

View File

@@ -60,7 +60,6 @@ pub struct GraphicsManager {
b2wireframe: HashMap<RigidBodyHandle, bool>,
ground_color: Point3<f32>,
camera: Camera,
ground_handle: Option<RigidBodyHandle>,
}
impl GraphicsManager {
@@ -87,14 +86,9 @@ impl GraphicsManager {
c2color: HashMap::new(),
ground_color: Point3::new(0.5, 0.5, 0.5),
b2wireframe: HashMap::new(),
ground_handle: None,
}
}
pub fn set_ground_handle(&mut self, handle: Option<RigidBodyHandle>) {
self.ground_handle = handle
}
pub fn clear(&mut self, window: &mut Window) {
for sns in self.b2sn.values_mut() {
for sn in sns.iter_mut() {

View File

@@ -195,14 +195,14 @@ impl Harness {
&mut self.physics.bodies,
&mut self.physics.colliders,
&mut self.physics.joints,
Some(&mut self.physics.ccd_solver),
&mut self.physics.ccd_solver,
&*self.physics.hooks,
&self.event_handler,
);
self.physics
.query_pipeline
.update(&self.physics.bodies, &self.physics.colliders, false);
.update(&self.physics.bodies, &self.physics.colliders);
for plugin in &mut self.plugins {
plugin.step(&mut self.physics, &self.state)

View File

@@ -166,6 +166,7 @@ impl PhysxWorld {
broad_phase_type: BroadPhaseType::AutomaticBoxPruning,
solver_type: SolverType::PGS,
friction_type,
ccd_max_passes: integration_parameters.max_ccd_substeps as u32,
..SceneDescriptor::new(())
};