I'm starting to implement rigid body collision detection and for the first time the order of operations AND the world orientations seams to matter for the correct result of the procedures, but I'm not sure how to proceed.
Lets start for the easy one, what is the practical order to move the game objects and detect collisions between them?
My first instinct was to move everything and than check for collisions, but this makes it difficult to understand what hit what and when, makes it even more difficult to decide what happens after the collision itself.
What I'm thinking now is to let the Level itself control the procedure and for each obj that moved on the previous loop, check for collisions. So it would be:
while (have objs)
{
update obj state;
if (moved)
check collision with all other objs.
}This seam to make a lot more sense and I get a lot more options on what to do with each kind of obj that collides.
Another option is to let the simulation tell me when collisions occur using callbacks, this seams very elegant, but I will need extra information to understand the context of the collision.
What would you suggest?
The second problem is a little more self inflicted, I tough I could make a 2D engine and still support 2.5D and isometrics for free, but now the Z axle orientation makes a huge difference and fucks with all the checks.
Even though all the sprites only have width and height, for pure 2D, this is at the screen plane and Z is a abstraction for the camera zoom; For 2.5D this may be true or not, the user may build the world as if Z is just perspective for the camera or the world is actually 3D and the sprite height is at Z (not Y).
For Isometric this is even more screwed up since some things will have width/height horizontal (things like the floor tiles) and others will be vertical (like the characters and most of other sprites).
I can tweak the simulation to support 2.5D, just add a variable telling the world orientation or check for the gravity vector orientation (it should, in theory, always be perpendicular to the ground).
Should I just limit the 2.5D world to the screen plane? (I like this, make it friendly but don´t add complexity)
Is it possible to keep support for isometric under those constraints?
Should I just ditch all this and just focus on pure 2D????