Hi all!
I’m pretty comfortable with camera movement so far:
private void moveForward()
{
float dist = (maxMoveSpeedInUnitsPerSecond / 1000) * Engine.DELTA;
float addX = dist * Math.sin(Math.toRadians(camera.yaw));
float addZ = dist * Math.cos(Math.toRadians(camera.yaw));
camera.position.x += addX;
camera.position.z += addZ;
}
However, this is a pretty linear way of moving around (a key press makes you instant move at your ‘maximum speed’).
I’d like to modify this set up to use some degree of acceleration (and deceleration). I’m not sure how to approach this concept, as I’m somewhat confused as to how acceleration / deceleration on both movement axes are combined (forward / reverse combined with strafing).
Any insights here would be most appreciated, thanks!