Monday, 2 September 2013

Collision detection - stop two cubes intersecting

Collision detection - stop two cubes intersecting

I'm trying to work out how to do this and keep getting stuck. Working out
when the two cubes collide is fine, its just how I limit each of them not
to intersect, and instead slide along the edges of one another when they
come into contact that I am struggling with.
I've tried working out the bounding box of each cube (each cube is 100cm
width and height by the way) and then tried saying if B position.x is less
than the bounding box max.x of A then limit box B's position.x. But how I
get that to work on all of the sides I have no idea? Any helpers with a
better brain than mine willing to help?

No comments:

Post a Comment