Support compound shapes.

This commit is contained in:
Crozet Sébastien
2020-12-28 18:12:33 +01:00
parent 8d925a02ef
commit 94c67a0c31
5 changed files with 146 additions and 100 deletions

View File

@@ -43,7 +43,7 @@ impl Harness {
let event_handler = ChannelEventCollector::new(proximity_channel.0, contact_channel.0);
let events = PhysicsEvents {
contact_events: contact_channel.1,
proximity_events: proximity_channel.1,
intersection_events: proximity_channel.1,
};
let physics = PhysicsState::new();
let state = HarnessState {

View File

@@ -1,6 +1,6 @@
use crossbeam::channel::Receiver;
use rapier::dynamics::{IntegrationParameters, JointSet, RigidBodySet};
use rapier::geometry::{BroadPhase, ColliderSet, ContactEvent, NarrowPhase, ProximityEvent};
use rapier::geometry::{BroadPhase, ColliderSet, ContactEvent, IntersectionEvent, NarrowPhase};
use rapier::math::Vector;
use rapier::pipeline::{PhysicsPipeline, QueryPipeline};
@@ -97,12 +97,12 @@ impl PhysicsState {
pub struct PhysicsEvents {
pub contact_events: Receiver<ContactEvent>,
pub proximity_events: Receiver<ProximityEvent>,
pub intersection_events: Receiver<IntersectionEvent>,
}
impl PhysicsEvents {
pub fn poll_all(&self) {
while let Ok(_) = self.contact_events.try_recv() {}
while let Ok(_) = self.proximity_events.try_recv() {}
while let Ok(_) = self.intersection_events.try_recv() {}
}
}