Page 1 of 1

Events on Entities

Posted: Sat Feb 04, 2012 1:35 am
by thiago
Hi,

I was playing with events (initial collision detected events actualy) and i needed to remove the event inside the event. (i mean, call the RemoveAllEvents inside the event handler)
After i did i, the bepu crashed.
Using the debug, i sow that you were calling a null event.
I suggest you to check if the event are null before calling them.

Where bepu crashes: (ContactEventManager.cs)

Code: Select all

while (eventStorageInitialCollisionDetected.TryUnsafeDequeueFirst(out initialCollisionDetected))
                InternalInitialCollisionDetected(owner, initialCollisionDetected.other, initialCollisionDetected.pair);
the InternalInitialCollisionDetected is null.

Re: Events on Entities

Posted: Sat Feb 04, 2012 2:06 am
by Norbo
Thanks for the report. Technically, this wasn't a supported action, so let me know if you find any additional oddities.

The development fork should contain the changes once codeplex lets me synchronize.