OK for the ...9th time i believe now, here's the problem
i'm making a custom fps camera so therefore i'm using a standard icamerascenenode and manipulating it myself
i'm using a CUSTOM input event handler and not the Irrlicht one, therefore using cursors and such is out of the question
1- now the following code SHOULD make me walk forward however the character reaches a certain point then stops, after tracing i've realized that the camTarget.X starts becomming smaller than the camPosition.X, and i cannot understand why.
changing the line to make camTarget.X+=5000*FwdDirection.X;
didn't work even and camTarget.X still stays smaller.
another glitch is if i'm looking upwards or so, it'll sometimes change my p.o.v to face forward again.
can someone PLEASE tell me what's wrong? here's the code that's placed under the event handler for moving forward.
2- second problem, strafing, again it SHOULD work however it ends up rotating the camera again , with no understanding of why it does that , the code is as follows that's placed under the event handler for moving to the rightcore::vector3df UpDirection;
core::vector3df FwdDirection;
core::vector3df RgtDirection;
core::vector3df camTarget =camera->getTarget();
core::vector3df camPosition = camera->getPosition() ;
FwdDirection= camTarget-camPosition;
FwdDirection.normalize();
camPosition.X+=1000*FwdDirection.X;
camPosition.Z+=1000*FwdDirection.Z;
camTarget.X+=1000*FwdDirection.X;
camTarget.Z+=1000*FwdDirection.Z;
camera->setPosition(camPosition);
camera->setTarget(camTarget);
again what am i doing wrong? someone PLEASE tell me , my deadline is DEADLY soon.
///Rady Note: obtain the initial details
UpDirection=camera->getUpVector();
UpDirection.normalize();
FwdDirection= camTarget-camPosition;
FwdDirection.normalize();
RgtDirection= FwdDirection.crossProduct(UpDirection);
////End initial details obtaining
//Rady note Changing position
camPosition.X+=1000*RgtDirection.X;
camPosition.Z+=1000*RgtDirection.Z;
camTarget.X+=1000*RgtDirection.X;
camTarget.Z+=1000*RgtDirection.Z;
camera->setPosition(camPosition);
camera->setTarget(camTarget);
//// end Changing Position
////////////////Rady Note: End Right Strafing Code///////////
