Bouncing in Orthogonal Mode

Hi, long time developer, first time poster.



I was wondering if anyone has any advice on allowing objects to bounce when they collide in orthogonal mode.



I have a method of making objects bounce off each other which works with non-orthogonal objects that calculates the normal of the collision and then applies the appropriate change in the bouncing object's direction.  However with orthogonal objects the normal of the collision is always returned as the z-axis as the objects are flat.  I've tried setting the z-orders and z-translations to the same values with no luck.



Does anyone have a better way of letting orthogonal objects detect collision normals or any way of adding depth to the objects (or their bounding boxes)?



Many thanks to anyone who can help me with this.

Ok, just a quick update.



For the time being I've added Box objects to which keep the same transformations as their corresponding ortho shapes.  It works but its far from perfect, especial when it comes to implementing non-rectangular orthogonal shapes.



So there are 3 better alternatives but I don't know how to do them.  Does anyone know a way of:

  • Detecting the collision vector of orthogonal shapes in the x and y planes?
  • Adding depth (in to the z-axis) to orthogonal shapes?
  • Forcing orthogonal shapes onto the same z order level?



    Or does anyone know another way of getting orthogonal shapes to bounce off each other?



    An answer to any of these questions would be greatly appreciated.