Hello. I have a problem.
I'm trying to check if there is a collision between 2 specific objects. Both of them are boxes, BoxObject with box skin.
Box A, Box B. There are many Boxes A, but only one Box B.
I add to a bodylist both of them to check it and then use DetectAllCollisions(bodyList, collisionFunctor, null, 0f);
But when i run to test, i notice there are collision events even when both items are not colliding. So it's not working.
Here is my code at beggining of the Update() method:
List<Body> bodyList = new List<Body>();
List<CollisionInfo> collisionInfos = new List<CollisionInfo>();
CollisionFunctor collisionFunctor = new BasicCollisionFunctor(collisionInfos);
for (i = 0; i <= num; i++)
physicSystem.CollisionSystem.DetectAllCollisions(bodyList, collisionFunctor, null, 0f);
if (collisionInfos.Count > 0)
Collision_active = true;
What i do is to check all the Boxes A, one by one to see if there is a collision with Box B. Then if there is one, i activate a flag just for debug mode. But when a first Box A appears and collides with other Box which is inmovable and is not B, the flag activates.
I'm starting to believe this DetectAllCollisions method doesn't do what it's meant to do according to it's comments. Actually it's catching every collision event between 2 objects type BoxObject, but i want to check if to specific objects collides.
am I right? Could anyone tell me how can i do what a i want? What's wrong with the code?
Thank u very much.