From c32da78f2a6014c491aa3e975fb83ddb7c80610e Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Mon, 26 Apr 2021 17:59:25 +0200 Subject: Split rigid-bodies and colliders into multiple components --- src_testbed/physics/mod.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src_testbed/physics') diff --git a/src_testbed/physics/mod.rs b/src_testbed/physics/mod.rs index b89f9c8..29e9a46 100644 --- a/src_testbed/physics/mod.rs +++ b/src_testbed/physics/mod.rs @@ -1,5 +1,5 @@ use crossbeam::channel::Receiver; -use rapier::dynamics::{CCDSolver, IntegrationParameters, JointSet, RigidBodySet}; +use rapier::dynamics::{CCDSolver, IntegrationParameters, IslandManager, JointSet, RigidBodySet}; use rapier::geometry::{BroadPhase, ColliderSet, ContactEvent, IntersectionEvent, NarrowPhase}; use rapier::math::Vector; use rapier::pipeline::{PhysicsHooks, PhysicsPipeline, QueryPipeline}; @@ -68,6 +68,7 @@ impl PhysicsSnapshot { } pub struct PhysicsState { + pub islands: IslandManager, pub broad_phase: BroadPhase, pub narrow_phase: NarrowPhase, pub bodies: RigidBodySet, @@ -78,12 +79,13 @@ pub struct PhysicsState { pub query_pipeline: QueryPipeline, pub integration_parameters: IntegrationParameters, pub gravity: Vector, - pub hooks: Box, + pub hooks: Box>, } impl PhysicsState { pub fn new() -> Self { Self { + islands: IslandManager::new(), broad_phase: BroadPhase::new(), narrow_phase: NarrowPhase::new(), bodies: RigidBodySet::new(), -- cgit