bwyyoung
06-07-2008 21:59:59
Hi all,
I am having trouble with callbacks. Currently, I have 3 groups of objects, named group1.group2,group3. and there are 2 groups of callback functions, named callback1. callback2.
When group1 collides with group2, only callback1 is supposed to be called.
When group3 collides with group1, only callback2 is supposed to be called.
However, when group3 collides with group1, callback 1 and 2 are called. I havent been able to figure out why. Here is my code that I have written:
I have tried alternating the boolean isForGroupB, for each setCollisionCallback, but to no avail.
I am having trouble with callbacks. Currently, I have 3 groups of objects, named group1.group2,group3. and there are 2 groups of callback functions, named callback1. callback2.
When group1 collides with group2, only callback1 is supposed to be called.
When group3 collides with group1, only callback2 is supposed to be called.
However, when group3 collides with group1, callback 1 and 2 are called. I havent been able to figure out why. Here is my code that I have written:
group1->setCollisionCallback(group2,theflag,isForGroupB);
group1->setCallback<CollisionEvent1>(instance,
&CollisionEvent1::AtStart,
&CollisionEvent1::AtEnd,
&CollisionEvent1::During);
group3->setCollisionCallback(group1,theflag,isForGroupB);
group3->setCallback<CollisionEvent2>(instance,
&CollisionEvent2::AtStart,
&CollisionEvent2::AtEnd,
&CollisionEvent2::During);
I have tried alternating the boolean isForGroupB, for each setCollisionCallback, but to no avail.