Page 1 of 1

InitialCollisionDetected

Posted: Mon Sep 23, 2013 6:07 pm
by phinwone
When i use
..Update(GameTime gameTime)
CollisionInformation.Events.InitialCollisionDetected += InitialCollisionDetected
....
InitialCollisionDetected(EntityCollidable sender, Collidable other, CollidablePairHandler collisionPair)
{
}

after a while i get big reduction of fps, even if InitialCollisionDetected dont have any conditions

Re: InitialCollisionDetected

Posted: Mon Sep 23, 2013 8:22 pm
by Norbo
A single empty event shouldn't harm performance at all. However, if the performance gradually degrades, it seems likely that redundant event handlers are being added every frame. Dispatching thousands of empty handlers on every new collision will add up.