Hi, I have not used the engine in ages, so 2 days ago I began to do little project, but I just cant do the collision detection.
When I thought that it was good, I noticed that it didnt worked on the corners, I tried with other ways, but now the camera moves very quickly and no matter the speed I set.
here is my code for managing the events taken from the KeyState
public void movimientos () {
boolean piso=false;
try {
if (Mundo.checkCameraCollision (new SimpleVector (0, 1, 0), alturaPersonal, alturaPersonal, false))
piso=true;
if (adelante)
if (Mundo.checkCameraCollision (camaraPersonal.getDirection (), alturaPersonal, alturaPersonal, true))
camaraPersonal.moveCamera (Camera.CAMERA_MOVEIN, velocidadPersonal);
if (atras)
if (Mundo.checkCameraCollision (camaraPersonal.getDirection (), alturaPersonal, alturaPersonal, true))
camaraPersonal.moveCamera (Camera.CAMERA_MOVEOUT, velocidadPersonal);
if (izquierda) camaraPersonal.rotateAxis(camaraPersonal.getBack().getYAxis(), -0.02f);
if (derecha) camaraPersonal.rotateAxis(camaraPersonal.getBack().getYAxis(), 0.02f);
if (salto)
if (Mundo.checkCameraCollision (Camera.CAMERA_MOVEUP, alturaPersonal, alturaPersonal*4/3, true))
camaraPersonal.moveCamera (Camera.CAMERA_MOVEUP, velocidadPersonal);
if (agache) camaraPersonal.moveCamera (Camera.CAMERA_MOVEDOWN, velocidadPersonal/2);
if (salida) System.exit (0);
}
catch (Exception E) {
}
}
Well, the gravity done on the second line works good, the problem is when moving the camera to the front and back.
If I have to use another kind of collision detection please could someone explain me why and how?.