diff options
Diffstat (limited to 'src_testbed')
| -rw-r--r-- | src_testbed/harness/mod.rs | 8 | ||||
| -rw-r--r-- | src_testbed/physics/mod.rs | 8 | ||||
| -rw-r--r-- | src_testbed/physx_backend.rs | 6 |
3 files changed, 9 insertions, 13 deletions
diff --git a/src_testbed/harness/mod.rs b/src_testbed/harness/mod.rs index 59cccc3..a09e0ac 100644 --- a/src_testbed/harness/mod.rs +++ b/src_testbed/harness/mod.rs @@ -86,12 +86,10 @@ type Callbacks = #[allow(dead_code)] impl Harness { pub fn new_empty() -> Self { - let contact_channel = crossbeam::channel::unbounded(); - let proximity_channel = crossbeam::channel::unbounded(); - let event_handler = ChannelEventCollector::new(proximity_channel.0, contact_channel.0); + let event_channel = crossbeam::channel::unbounded(); + let event_handler = ChannelEventCollector::new(event_channel.0); let events = PhysicsEvents { - contact_events: contact_channel.1, - intersection_events: proximity_channel.1, + events: event_channel.1, }; let physics = PhysicsState::new(); let state = RunState::new(); diff --git a/src_testbed/physics/mod.rs b/src_testbed/physics/mod.rs index c3f21ef..c8168d9 100644 --- a/src_testbed/physics/mod.rs +++ b/src_testbed/physics/mod.rs @@ -3,7 +3,7 @@ use rapier::dynamics::{ CCDSolver, ImpulseJointSet, IntegrationParameters, IslandManager, MultibodyJointSet, RigidBodySet, }; -use rapier::geometry::{BroadPhase, ColliderSet, ContactEvent, IntersectionEvent, NarrowPhase}; +use rapier::geometry::{BroadPhase, ColliderSet, CollisionEvent, NarrowPhase}; use rapier::math::{Real, Vector}; use rapier::pipeline::{PhysicsHooks, PhysicsPipeline, QueryPipeline}; @@ -107,13 +107,11 @@ impl PhysicsState { } pub struct PhysicsEvents { - pub contact_events: Receiver<ContactEvent>, - pub intersection_events: Receiver<IntersectionEvent>, + pub events: Receiver<CollisionEvent>, } impl PhysicsEvents { pub fn poll_all(&self) { - while let Ok(_) = self.contact_events.try_recv() {} - while let Ok(_) = self.intersection_events.try_recv() {} + while let Ok(_) = self.events.try_recv() {} } } diff --git a/src_testbed/physx_backend.rs b/src_testbed/physx_backend.rs index 2d42a68..31326bc 100644 --- a/src_testbed/physx_backend.rs +++ b/src_testbed/physx_backend.rs @@ -213,7 +213,7 @@ impl PhysxWorld { rapier2dynamic.insert(rapier_handle, actor); } else { - let actor = physics.create_fixed(pos, ()).unwrap(); + let actor = physics.create_static(pos, ()).unwrap(); rapier2static.insert(rapier_handle, actor); } } @@ -382,7 +382,7 @@ impl PhysxWorld { ); for (_, actor) in rapier2static { - scene.add_fixed_actor(actor); + scene.add_static_actor(actor); } for (_, actor) in rapier2dynamic { @@ -712,7 +712,7 @@ type PxPhysicsFoundation = PhysicsFoundation<DefaultAllocator, PxShape>; type PxMaterial = physx::material::PxMaterial<()>; type PxShape = physx::shape::PxShape<(), PxMaterial>; type PxArticulationLink = physx::articulation_link::PxArticulationLink<RigidBodyHandle, PxShape>; -type PxRigidStatic = physx::rigid_fixed::PxRigidStatic<(), PxShape>; +type PxRigidStatic = physx::rigid_static::PxRigidStatic<(), PxShape>; type PxRigidDynamic = physx::rigid_dynamic::PxRigidDynamic<RigidBodyHandle, PxShape>; type PxArticulation = physx::articulation::PxArticulation<(), PxArticulationLink>; type PxArticulationReducedCoordinate = |
