diff -ur ../SRWorkshop/TalkShadowFun/cmdmode.xml ./cmdmode.xml --- ../SRWorkshop/TalkShadowFun/cmdmode.xml 2003-10-25 23:19:52.000000000 +0200 +++ ./cmdmode.xml 2009-10-28 14:50:14.000000000 +0100 @@ -5,6 +5,9 @@ + + + @@ -19,6 +22,9 @@

higher

down

lower

+

forward

+

backward

+ diff -ur ../SRWorkshop/TalkShadowFun/shadowfun.cpp ./shadowfun.cpp --- ../SRWorkshop/TalkShadowFun/shadowfun.cpp 2003-10-25 23:14:56.000000000 +0200 +++ ./shadowfun.cpp 2009-10-28 14:50:26.000000000 +0100 @@ -102,7 +102,7 @@ //SR Workshop // Commands enum { - C_NONE, C_LEFT, C_RIGHT, C_UP, C_DOWN, C_HOME, C_STOP + C_NONE, C_LEFT, C_RIGHT, C_UP, C_DOWN, C_HOME, C_STOP, C_FORWARD, C_BACKWARD }; int listening = 0; // boolean use: 0 = false, 1= true @@ -326,6 +326,8 @@ if (recogstr.Find("down") != -1) { command = C_DOWN; } if (recogstr.Find("home") != -1) { command = C_HOME; } if (recogstr.Find("stop") != -1) { command = C_STOP; } + if (recogstr.Find("forward") != -1) { command = C_FORWARD; } + if (recogstr.Find("backward") != -1) { command = C_BACKWARD; } if (fUseTTS) { @@ -1080,32 +1082,48 @@ glutSwapBuffers(); } +#define MOVE_FACTOR 0.5 + //SR Workshop void MoveLeft(int value) { // value should be in range M_TORUS, M_CUBE, M_SPHERE - animPos[value][X] -= 1.0; + animPos[value][X] -= MOVE_FACTOR; } //SR Workshop void MoveRight(int value) { // value should be in range M_TORUS, M_CUBE, M_SPHERE - animPos[value][X] += 1.0; + animPos[value][X] += MOVE_FACTOR; } //SR Workshop void MoveUp(int value) { // value should be in range M_TORUS, M_CUBE, M_SPHERE - animPos[value][Y] += 1.0; + animPos[value][Y] += MOVE_FACTOR; } //SR Workshop void MoveDown(int value) { // value should be in range M_TORUS, M_CUBE, M_SPHERE - animPos[value][Y] -= 1.0; + animPos[value][Y] -= MOVE_FACTOR; +} + +//SR Workshop +void MoveForward(int value) +{ + // value should be in range M_TORUS, M_CUBE, M_SPHERE + animPos[value][Z] += MOVE_FACTOR; +} + +//SR Workshop +void MoveBackward(int value) +{ + // value should be in range M_TORUS, M_CUBE, M_SPHERE + animPos[value][Z] -= MOVE_FACTOR; } //SR Workshop @@ -1144,6 +1162,12 @@ case C_DOWN: MoveDown(M_SPHERE); break; + case C_FORWARD: + MoveForward(M_SPHERE); + break; + case C_BACKWARD: + MoveBackward(M_SPHERE); + break; case C_HOME: MoveHome(M_SPHERE); break;