Hi
I am trying to move UP and Down In JPCTDemo.java type example. I am using Page UP and Page down key. But as soon as I press the page UP key it moves out of environment in infinity. I have writen code as
private final static float COLLISION_SPHERE_RADIUS = 6f;
private final static float PLAYER_HEIGHT = 25f;
private SimpleVector playerTop = new SimpleVector();
private final static SimpleVector UP_MOVEMENT =new SimpleVector(COLLISION_SPHERE_RADIUS,PLAYER_HEIGHT/1f,COLLISION_SPHERE_RADIUS);
playerTop = theWorld.getCamera().getZAxis();
For Page UP
if (up) {
changed = true;
camera.moveCamera(new SimpleVector(1, 0, 0), UP_MOVEMENT.z);
SimpleVector temp = new SimpleVector(playerTop);
temp.scalarMul( -1f);
theWorld.checkCameraCollisionEllipsoid(temp, UP_MOVEMENT, 1, 8 );
camera.rotateX(ts);
}
Am i doing the right thing ? can some one suggest me
The Movement should stop as soon as it tuches the sealing of the room. and should move right up and down.
With Regards
San