V2 ContactEventsDemo Question

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Posts: 16
Joined: Mon Sep 24, 2018 3:36 pm

V2 ContactEventsDemo Question

Post by b1fg2 » Thu Dec 26, 2019 12:34 pm

I do know OnContactAdded in ContactEventsDemo, but any simple guide for OnTouching and OnContactRemoved?

Site Admin
Posts: 4888
Joined: Tue Jul 04, 2006 4:45 am

Re: V2 ContactEventsDemo Question

Post by Norbo » Thu Dec 26, 2019 6:59 pm

Not at the moment- the ContactEventsDemo was intended to be it, I just didn't want to make it extremely long. The idea for OnContactRemoved is similar to OnContactAdded; when a contact that was previously seen is no longer there, invoke a callback. OnTouching is simpler because it doesn't require tracking previous state.

My personal recommendation is to avoid 'transition' events OnContactAdded/Removed if possible because they add nontrivial complexity. You can almost always get away with current-state-only analysis with a little logical refactoring.

Post Reply