Page 1 of 1

[Resolved] Object Colliding with other one

Posted: Sat Jan 07, 2006 1:10 pm
by Keil
Hi,
I've set 2 md2 models in a ms3d world
md2 model 1 is animated and is collidable
ms3d world is collidable

md2 model 2 is controlled by user and react to collidable objects.

i want to know, when i type Enter for example, if my two md2 models are colliding.

what is the test to write ?

Code: Select all

if( ??????????????? )
   printf("Colliding\n");
else
   printf("Not Collinding\n");

Posted: Sat Jan 07, 2006 11:42 pm
by bitplane
for a quick and dirty test to see if pressing enter should open a door or something...
if (node1->getBoundingBox().intersectsWithBox(node2->getBoundingBox()))

Posted: Sun Jan 08, 2006 1:09 am
by Keil
it was the first thing i tried, but anywhere my 2nd md2 model (which one i can move), anywhere he can be, the result is the same: colliding=true

Posted: Sun Jan 08, 2006 10:32 pm
by Keil
ok, just find the way:
if(node1->getTransformedBoundingBox().intersectsWithBox(node2->getTransformedBoundingBox())