collision detect one against other objects

Started by bili, July 05, 2012, 09:31:43 PM

Previous topic - Next topic

bili

I just wonder on how to do collision for the following scenario. I got one main cube moving along the horizontal line and 5 other cubes moving along the vertical line at different position i.e. not in the same line. I want to test the collision between the main cube and other cubes so that if any other cube collides with the main cube, i will set it visibility to false.

How should I do this?

I already set collision mode for main cube to self and other cubes to others.

Thanks.

EgonOlsen

Just use one of the collision detection methods that fit. In case of a cube, the spherical approach might be sufficient. It won't be exact, because a sphere isn't a perfect approximation of a cube, but it should be good enough. Another way would be to detect the collisions yourself based on the cubes position. This is almost trivial if the cubes don't rotate and comes down to a few simple distance checks.

bili

Thx it works.

I use a loop to check for collision between other cube and the main cube and set collided cube visibility to false.