The arose while working on Issue 44
Modified the execute() method of ColliderComponent to report 3 arguments:
* Collision Object
* Time of Collision
* Collision Flags
The third argument is new and will be used to determine collision types without
using "instanceof" or isInstance() checks which can be slow. Instead, we'll
use the flags to determine if two objects can collide. For example, if there's
a player with flags "1111" (binary) and enemies 1 & 2 with "0010" and "0101"
respectively, then a player can collide with enemy one and two.
Modifying the flags of the enemies to be "10010" and "10101" would still impact
the player, but if we established something like a forcefield which has flags
"10000", then only the enemies would collide with the forcefield, but the
player wouldn't. It should be noted that currently objects with the same flags
cannot collide. Maybe another flag needs to be put into place to allow this?
When two objects collide, the first object will be passed the flags of the
second object. These flags are arbitrary and can mean anything to the
developer. However, the operation is "(A & B) == B" results in a collision.
The collision object is still passed as the first argument, so existing
"instanceof" or "isInstance()" checks should continue to work.
Original issue reported on code.google.com by bfatt...@gmail.com on 9 Nov 2010 at 2:56
Original issue reported on code.google.com by
bfatt...@gmail.com
on 9 Nov 2010 at 2:56