possible bug

Mar 10, 2010 at 7:13 PM

I tried to call DetectCollisions() on my collision system manually but my callback was never being called. After some debugging I found out that Commit() was never being called on the collision context that I was using.  In this particular case it was in the SphereMeshCollisionDetector. After adding context.Commit(); at line 167 in the SphereMeshCollisionDetector.cs file it appears to be working just fine.

Is this a bug or am I not suppose to use the system like that?

Mar 12, 2010 at 12:49 AM

Hey skitzogames, I believe to be a bug-inducing oversight of mine when using the CollisionSystem like you are.  I should have made Commit public and the collision of collisions public as well.  I could also invoke the callback during OnCollided method.  The Commit method was there so you didn't have to update the collision collections on the CollisionGroups if you didn't want to.

For the time being, I would either make CollisionContext.Commit public so you can call it after all collisions have been found or move the code in the CollisionContext.Commit method dealing with invoking the ICollisionCallback into the CollisionContext.OnCollided and exposing the CollisionContext.collision collection through a public property.

I will probably do both for the next release.  Thanks for let me know about this issue.  Good luck!