I have a ball moving inside a cube, and I detect when it goes outside of the cube (with a bounding sphere and a bounding box). Now I would like to detect from which side the ball goes out. Then I could redirect the ball in the correct direction. How can I do this with the ball's “world” matrix?
Should I keep track of the ball's coordinates myself, or should I deduce them from the world matrix?