source:
liacs/mss/assignment2/TalkShadowFun.diff@
6
Last change on this file since 6 was 2, checked in by , 15 years ago | |
---|---|
File size: 3.0 KB |
-
cmdmode.xml
diff -ur ../SRWorkshop/TalkShadowFun/cmdmode.xml ./cmdmode.xml
old new 5 5 <ID NAME="PID_CmdRight" VAL="2"/> 6 6 <ID NAME="PID_CmdUp" VAL="3"/> 7 7 <ID NAME="PID_CmdDown" VAL="4"/> 8 <ID NAME="PID_CmdForward" VAL="5"/> 9 <ID NAME="PID_CmdBackward" VAL="6"/> 10 8 11 <ID NAME="PID_CmdNavigation" VAL="1000"/> 9 12 <ID NAME="PID_Moving" VAL="1001"/> 10 13 </DEFINE> … … 19 22 <P VAL="PID_CmdUp">higher</P> 20 23 <P VAL="PID_CmdDown">down</P> 21 24 <P VAL="PID_CmdDown">lower</P> 25 <P VAL="PID_CmdForward">forward</P> 26 <P VAL="PID_CmdBackward">backward</P> 27 22 28 </L> 23 29 </RULE> 24 30 -
shadowfun.cpp
diff -ur ../SRWorkshop/TalkShadowFun/shadowfun.cpp ./shadowfun.cpp
old new 102 102 //SR Workshop 103 103 // Commands 104 104 enum { 105 C_NONE, C_LEFT, C_RIGHT, C_UP, C_DOWN, C_HOME, C_STOP 105 C_NONE, C_LEFT, C_RIGHT, C_UP, C_DOWN, C_HOME, C_STOP, C_FORWARD, C_BACKWARD 106 106 }; 107 107 108 108 int listening = 0; // boolean use: 0 = false, 1= true … … 326 326 if (recogstr.Find("down") != -1) { command = C_DOWN; } 327 327 if (recogstr.Find("home") != -1) { command = C_HOME; } 328 328 if (recogstr.Find("stop") != -1) { command = C_STOP; } 329 if (recogstr.Find("forward") != -1) { command = C_FORWARD; } 330 if (recogstr.Find("backward") != -1) { command = C_BACKWARD; } 329 331 330 332 if (fUseTTS) 331 333 { … … 1080 1082 glutSwapBuffers(); 1081 1083 } 1082 1084 1085 #define MOVE_FACTOR 0.5 1086 1083 1087 //SR Workshop 1084 1088 void MoveLeft(int value) 1085 1089 { 1086 1090 // value should be in range M_TORUS, M_CUBE, M_SPHERE 1087 animPos[value][X] -= 1.0;1091 animPos[value][X] -= MOVE_FACTOR; 1088 1092 } 1089 1093 1090 1094 //SR Workshop 1091 1095 void MoveRight(int value) 1092 1096 { 1093 1097 // value should be in range M_TORUS, M_CUBE, M_SPHERE 1094 animPos[value][X] += 1.0;1098 animPos[value][X] += MOVE_FACTOR; 1095 1099 } 1096 1100 1097 1101 //SR Workshop 1098 1102 void MoveUp(int value) 1099 1103 { 1100 1104 // value should be in range M_TORUS, M_CUBE, M_SPHERE 1101 animPos[value][Y] += 1.0;1105 animPos[value][Y] += MOVE_FACTOR; 1102 1106 } 1103 1107 1104 1108 //SR Workshop 1105 1109 void MoveDown(int value) 1106 1110 { 1107 1111 // value should be in range M_TORUS, M_CUBE, M_SPHERE 1108 animPos[value][Y] -= 1.0; 1112 animPos[value][Y] -= MOVE_FACTOR; 1113 } 1114 1115 //SR Workshop 1116 void MoveForward(int value) 1117 { 1118 // value should be in range M_TORUS, M_CUBE, M_SPHERE 1119 animPos[value][Z] += MOVE_FACTOR; 1120 } 1121 1122 //SR Workshop 1123 void MoveBackward(int value) 1124 { 1125 // value should be in range M_TORUS, M_CUBE, M_SPHERE 1126 animPos[value][Z] -= MOVE_FACTOR; 1109 1127 } 1110 1128 1111 1129 //SR Workshop … … 1144 1162 case C_DOWN: 1145 1163 MoveDown(M_SPHERE); 1146 1164 break; 1165 case C_FORWARD: 1166 MoveForward(M_SPHERE); 1167 break; 1168 case C_BACKWARD: 1169 MoveBackward(M_SPHERE); 1170 break; 1147 1171 case C_HOME: 1148 1172 MoveHome(M_SPHERE); 1149 1173 break;
Note:
See TracBrowser
for help on using the repository browser.