diff --git a/Camera.cpp b/Camera.cpp index 7a09b48a..0d1c5c5b 100644 --- a/Camera.cpp +++ b/Camera.cpp @@ -47,6 +47,9 @@ TCamera::OnCommand( command_data const &Command ) { auto const walkspeed { 1.0 }; auto const runspeed { 10.0 }; + // threshold position on stick between walk lerp and walk/run lerp + auto const stickthreshold = 2.0 / 3.0; + bool iscameracommand { true }; switch( Command.command ) { @@ -73,9 +76,6 @@ TCamera::OnCommand( command_data const &Command ) { 30.0 : 1.0 ); - // threshold position on stick between walk lerp and walk/run lerp - auto const stickthreshold = 2.0 / 3.0; - // left-right auto const movexparam { Command.param1 }; // 2/3rd of the stick range lerps walk speed, past that we lerp between max walk and run speed @@ -117,8 +117,9 @@ TCamera::OnCommand( command_data const &Command ) { 1.0 ); // up-down auto const moveyparam { Command.param1 }; - // 2/3rd of the stick range enables walk speed, past that we lerp between walk and run speed - auto const movey { walkspeed + ( std::max( 0.0, std::abs( moveyparam ) - 0.65 ) / 0.35 ) * ( movespeed - walkspeed ) }; + // 2/3rd of the stick range lerps walk speed, past that we lerp between max walk and run speed + auto const movey { walkspeed * std::min(std::abs(moveyparam) * (1.0 / stickthreshold), 1.0) + + ( std::max( 0.0, std::abs( moveyparam ) - stickthreshold ) / (1.0 - stickthreshold) ) * std::max( 0.0, movespeed - walkspeed ) }; m_moverate.y = ( moveyparam > 0.0 ? movey * speedmultiplier : diff --git a/version.h b/version.h index 96024832..284be707 100644 --- a/version.h +++ b/version.h @@ -1 +1 @@ -#define VERSION_INFO "M7 (GL3) 27.01.2018, based on milek-4f030959, tmj-753cf7ee5" +#define VERSION_INFO "M7 (GL3) 27.01.2018, based on milek-0bf7238b, tmj-753cf7ee5"