mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fixed slow sideways movement whilst fly-sprinting
This commit is contained in:
parent
5b5b9f6072
commit
26fd431af4
|
|
@ -462,9 +462,14 @@ void LocalPlayer::aiStep()
|
|||
if( isSprinting() )
|
||||
{
|
||||
// Accelrate up to full speed if we are sprinting, moving in the direction of the view vector
|
||||
flyX = (float)viewVector->x * input->ya;
|
||||
float yawRad = yRot * (PI / 180.0f);
|
||||
|
||||
flyX = -sinf(yawRad) * input->ya + cosf(yawRad) * input->xa;
|
||||
flyY = (float)viewVector->y * input->ya;
|
||||
flyZ = (float)viewVector->z * input->ya;
|
||||
flyZ = cosf(yawRad) * input->ya + sinf(yawRad) * input->xa;
|
||||
|
||||
float h = sqrtf(flyX * flyX + flyZ * flyZ);
|
||||
if (h > 1.0f) { flyX /= h; flyZ /= h; }
|
||||
|
||||
float scale = ((float)(SPRINT_DURATION - sprintTime))/10.0f;
|
||||
scale = scale * scale;
|
||||
|
|
|
|||
Loading…
Reference in a new issue