Ashley,
EDIT: I just re-read your post in which you kind of address this potential solution. :p Sounds like as you've said, it might actually hurt performance.
Thanks for your reply.
What if you invalidated all cached Collision results for a given entity after any command which results in a change of position/angle/scale using some kind of HasChanged boolean?
So maybe you have a central collision Cache which is an internal dictionary, it is only added to when two elements collide. The key represents the unique instance of the object, and the value is a enumerable list of elements that it has collided with on this loop cycle.
CollisionMap[Obj1] = { Obj2 }; // set of objects Obj1 has collided with
CollisionMap[Obj2] = { Obj1 }; // set of objects Obj2 has collided with
So in the game loop:
<font size="2">
<font face="Verdana, Arial, Helvetica, sans-serif">
Clear Collision Dictionary at beginning
Set all objects HasChanged = false
On Obj1 Collision Obj2 routine: (doesn't actually do any bound checking yet)
Foreach(Obj1 in Layout)
-- Foreach(Obj2 in Layout)
-- -- If Obj1.HasModified = false && CollisionMap[Obj1].Value.Contains(Obj2) { TriggerCollision(); }
-- -- Else { Run Normal collision bounding checks -- save results into CollisionMap }
</font>
</font>
Would this help to optimize collision performance at all?