V2 ContactEventsDemo Question

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

V2 ContactEventsDemo Question

Post by b1fg2 »

I do know OnContactAdded in ContactEventsDemo, but any simple guide for OnTouching and OnContactRemoved?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: V2 ContactEventsDemo Question

Post by Norbo »

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