diff --git a/src/plugin/context.rs b/src/plugin/context.rs index eb7fe305..b78f2e67 100644 --- a/src/plugin/context.rs +++ b/src/plugin/context.rs @@ -3,10 +3,10 @@ use std::collections::HashMap; use std::sync::RwLock; use rapier::prelude::{ - CCDSolver, ColliderHandle, ColliderSet, EventHandler, FeatureId, ImpulseJointHandle, - ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointHandle, MultibodyJointSet, - NarrowPhase, PhysicsHooks, PhysicsPipeline, QueryFilter as RapierQueryFilter, QueryPipeline, - Ray, Real, RigidBodyHandle, RigidBodySet, + BroadPhase, CCDSolver, ColliderHandle, ColliderSet, EventHandler, FeatureId, + ImpulseJointHandle, ImpulseJointSet, IntegrationParameters, IslandManager, + MultibodyJointHandle, MultibodyJointSet, NarrowPhase, PhysicsHooks, PhysicsPipeline, + QueryFilter as RapierQueryFilter, QueryPipeline, Ray, Real, RigidBodyHandle, RigidBodySet, }; use crate::geometry::{Collider, PointProjection, RayIntersection, ShapeCastHit}; @@ -33,7 +33,7 @@ pub struct RapierContext { /// (not moving much) to reduce computations. pub islands: IslandManager, /// The broad-phase, which detects potential contact pairs. - pub broad_phase: DefaultBroadPhase, + pub broad_phase: Box, /// The narrow-phase, which computes contact points, tests intersections, /// and maintain the contact and intersection graphs. pub narrow_phase: NarrowPhase, @@ -80,7 +80,7 @@ impl Default for RapierContext { fn default() -> Self { Self { islands: IslandManager::new(), - broad_phase: DefaultBroadPhase::new(), + broad_phase: Box::new(DefaultBroadPhase::new()), narrow_phase: NarrowPhase::new(), bodies: RigidBodySet::new(), colliders: ColliderSet::new(), @@ -260,7 +260,7 @@ impl RapierContext { &gravity.into(), &substep_integration_parameters, &mut self.islands, - &mut self.broad_phase, + &mut *self.broad_phase, &mut self.narrow_phase, &mut self.bodies, &mut self.colliders, @@ -291,7 +291,7 @@ impl RapierContext { &gravity.into(), &substep_integration_parameters, &mut self.islands, - &mut self.broad_phase, + &mut *self.broad_phase, &mut self.narrow_phase, &mut self.bodies, &mut self.colliders, @@ -315,7 +315,7 @@ impl RapierContext { &gravity.into(), &substep_integration_parameters, &mut self.islands, - &mut self.broad_phase, + &mut *self.broad_phase, &mut self.narrow_phase, &mut self.bodies, &mut self.colliders,