SHORT INTRO:
I'm having trouble with a 3D cube on a plane. The plane is a grid of squares. The ID number of the square that the cube currently occupies on is stored in a storage-variable. This is so that I can tell whether or not adjacent squares are free for the cube to move onto. When I move the cube, the storage-variable is updated to reflect the ID number of the new square.
PROBLEM:
The problem is that sometimes when I am moving the cube, the cube is moved too far or in the wrong direction and the square in the storage-variable does not match the actual square the cube is drawn on...This causes problems like the cube not detecting collisions and even going through objects it is not supposed to....
Cube is drawn in a drawView method in an iPhone OpenGL ES EAGLView at a rate of 24 times per second...Could the fast drawing be the cause of this???? How can I fix this? My job depends on it...
Somebody please help.