Hi Friends ,
Please tell me what I am doing wrong here
?
My player's rotation is controlled by Mouse dx
and move forward is done when the UP key is pressed.
Now during the start the first time when I press the UP key the player moves in the desired direction..
But after that when I roatate the player using the mouse and press the Up key it first goes a little in the last Direction
it moved to and then it goes in the right direction.
What changes should I make.
SimpleVector t= box.getZAxis();
t.scalarMul(0.05f);
moveRes.add(t);
moveRes = box.checkForCollisionEllipsoid(moveRes, ellipsoid, 8);
box.translate(moveRes);
Also I am using a little code just after this in the gameloop for Gravity I hope its not this that is causing the problem....
// finally apply the gravity:
SimpleVector t = new SimpleVector(0, 1, 0);
t = box.checkForCollisionEllipsoid(t, ellipsoidG, 10);
box.translate(t);
The value of ellipsoid as follows :
private SimpleVector ellipsoid = new SimpleVector(2, 2, 2);
private SimpleVector ellipsoidG = new SimpleVector(2, 20, 2);