SL-6109 Better running
parent
8ccf79735e
commit
eb54fccff7
|
|
@ -650,15 +650,22 @@ bool start_gesture( EKeystate s )
|
|||
|
||||
bool run_forward(EKeystate s)
|
||||
{
|
||||
if (KEYSTATE_DOWN == s)
|
||||
if (KEYSTATE_UP != s)
|
||||
{
|
||||
gAgent.setAlwaysRun();
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_FORWARD)
|
||||
{
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_FORWARD;
|
||||
}
|
||||
if (!gAgent.getRunning())
|
||||
{
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
}
|
||||
}
|
||||
else if(KEYSTATE_UP == s)
|
||||
{
|
||||
gAgent.clearAlwaysRun();
|
||||
if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_FORWARD)
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
|
||||
gAgent.clearRunning();
|
||||
gAgent.sendWalkRun(false);
|
||||
}
|
||||
|
|
@ -668,15 +675,22 @@ bool run_forward(EKeystate s)
|
|||
|
||||
bool run_backward(EKeystate s)
|
||||
{
|
||||
if (KEYSTATE_DOWN == s)
|
||||
if (KEYSTATE_UP != s)
|
||||
{
|
||||
gAgent.setAlwaysRun();
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_BACKWARD)
|
||||
{
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_BACKWARD;
|
||||
}
|
||||
if (!gAgent.getRunning())
|
||||
{
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
}
|
||||
}
|
||||
else if (KEYSTATE_UP == s)
|
||||
{
|
||||
gAgent.clearAlwaysRun();
|
||||
if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_BACKWARD)
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
|
||||
gAgent.clearRunning();
|
||||
gAgent.sendWalkRun(false);
|
||||
}
|
||||
|
|
@ -686,15 +700,22 @@ bool run_backward(EKeystate s)
|
|||
|
||||
bool run_left(EKeystate s)
|
||||
{
|
||||
if (KEYSTATE_DOWN == s)
|
||||
if (KEYSTATE_UP != s)
|
||||
{
|
||||
gAgent.setAlwaysRun();
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDELEFT)
|
||||
{
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_SLIDELEFT;
|
||||
}
|
||||
if (!gAgent.getRunning())
|
||||
{
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
}
|
||||
}
|
||||
else if (KEYSTATE_UP == s)
|
||||
{
|
||||
gAgent.clearAlwaysRun();
|
||||
if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_SLIDELEFT)
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
|
||||
gAgent.clearRunning();
|
||||
gAgent.sendWalkRun(false);
|
||||
}
|
||||
|
|
@ -704,15 +725,22 @@ bool run_left(EKeystate s)
|
|||
|
||||
bool run_right(EKeystate s)
|
||||
{
|
||||
if (KEYSTATE_DOWN == s)
|
||||
if (KEYSTATE_UP != s)
|
||||
{
|
||||
gAgent.setAlwaysRun();
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
if (gAgent.mDoubleTapRunMode != LLAgent::DOUBLETAP_SLIDERIGHT)
|
||||
{
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_SLIDERIGHT;
|
||||
if (!gAgent.getRunning())
|
||||
{
|
||||
gAgent.setRunning();
|
||||
gAgent.sendWalkRun(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (KEYSTATE_UP == s)
|
||||
{
|
||||
gAgent.clearAlwaysRun();
|
||||
if (gAgent.mDoubleTapRunMode == LLAgent::DOUBLETAP_SLIDERIGHT)
|
||||
gAgent.mDoubleTapRunMode = LLAgent::DOUBLETAP_NONE;
|
||||
gAgent.clearRunning();
|
||||
gAgent.sendWalkRun(false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue