I'm working on a Platform Game engine, and I have a class called a "Trigger", which essentially dispatches events to the developer when a character enters or exits the trigger (The trigger is a sensor).
Everything works great, except I'm getting rogue ENTER and EXIT dispatches (while I'm inside the Trigger), which I've found only occur immediately following a call to Refilter() on a shape that is inside the Trigger. I call Refilter() periodically to change things such as friction, filtering, sensor, etc.
The Enter and Exit events get dispatched when all shapes in a body completely leave or enter the trigger's area. I'm assuming these incorrect dispatches are happening because shape contact points get removed and re-added (via the ContactListener) when a shape is refiltered. Is this correct? How can I get around this?
My best option so far has been to not dispatch ENTER and EXIT events during a refiltering phase, but then there is a chance of missing a proper ENTER or EXIT event.
Any guesses? I'm completely out of answers and my client REALLY needs this figured out.
Thanks,
Eric Smith
http://blueflamedev.com
Everything works great, except I'm getting rogue ENTER and EXIT dispatches (while I'm inside the Trigger), which I've found only occur immediately following a call to Refilter() on a shape that is inside the Trigger. I call Refilter() periodically to change things such as friction, filtering, sensor, etc.
The Enter and Exit events get dispatched when all shapes in a body completely leave or enter the trigger's area. I'm assuming these incorrect dispatches are happening because shape contact points get removed and re-added (via the ContactListener) when a shape is refiltered. Is this correct? How can I get around this?
My best option so far has been to not dispatch ENTER and EXIT events during a refiltering phase, but then there is a chance of missing a proper ENTER or EXIT event.
Any guesses? I'm completely out of answers and my client REALLY needs this figured out.
Thanks,
Eric Smith
http://blueflamedev.com