31
Support / Collision between 2 models.
« on: May 30, 2010, 04:32:12 pm »
Hi,
I'm using :
My problem is :
I've a projectile : That I want to move except if there's a collision and in this case I want to do something else.
So basicaly I use checkForCollision each time before moving.
else
do something else.
My projectiles are configured like this when I create a project :
Now the objects I want to collide with have this settings
The problem is that even I'm seeing that the 2 objects are colliding cID still equal to NO_OBJECT
so no collision detected.
Am I doing something wrong ?
I'm using :
Code: [Select]
cId = checkForCollision(dir, step);
where step =2f and dir is a direction SimpleVector from a projectile (he moves along this dir)My problem is :
I've a projectile : That I want to move except if there's a collision and in this case I want to do something else.
So basicaly I use checkForCollision each time before moving.
Code: [Select]
if(cId==NO_OJBECT)
then I moveelse
do something else.
My projectiles are configured like this when I create a project :
Code: [Select]
addCollisionListener(this);
setCollisionMode(COLLISION_CHECK_SELF);
setCollisionOptimization(COLLISION_DETECTION_OPTIMIZED);
Now the objects I want to collide with have this settings
Code: [Select]
addCollisionListener(this);
setCollisionMode(COLLISION_CHECK_OTHERS);
setCollisionOptimization(COLLISION_DETECTION_OPTIMIZED);
The problem is that even I'm seeing that the 2 objects are colliding cID still equal to NO_OBJECT
so no collision detected.
Am I doing something wrong ?