// Update xna hand //updateHandModelExercise2(frameData); } #endregion // Demo exercise 3 - Three jaw chuck pinch #region ex3 if (currentExercise == 3 && repsPerformed < repsRequired) { // Give exercise brief if (!exerciseDescGiven) { updateExerciseDescription("Exercise 3 of 3: Jaw. " + "\n1) Form a closed fist. \n2) Relax hand. \n\nThe timer will start automatically"); exerciseDescGiven = true; game.ResetCameraArcAndRoll(); } // A sufficient delta in the vector between finger-tip and palm signals // the user has begun to moving their hand, start the timer if ((hand.Fingers.Frontmost.TipPosition - hand.PalmPosition).Magnitude < 0.9 * avgMag && !timer.IsRunning) { restartTimer(); } // Exercise part 0 - Form a fist if (hand.Fingers.Count == 3 && !clenchPromptGiven) { // Present time for this rep if (timer.IsRunning) { repTimes[repsPerformed] = timer.ElapsedMilliseconds; updateRepInfo("Rep " + (repsPerformed + 1) + " of 5 complete. \nTime: " + repTimes[repsPerformed] / 1000.0 + " seconds."); // New best rep time? if (repTimes[repsPerformed] < bestRepTime) { bestRepTime = repTimes[repsPerformed]; updateBestRepInfo("Best rep time: \nRep " + (repsPerformed + 1) + " of 5: \n" + bestRepTime / 1000.0 + "seconds."); } ++repsPerformed; restartTimer(); }
// Update xna hand //updateHandModelExercise2(frameData); } #endregion // Demo exercise 3 - Three jaw chuck pinch #region ex3 if (currentExercise == 3 && repsPerformed < repsRequired) { // Give exercise brief if (!exerciseDescGiven) { updateExerciseDescription("Exercise 3 of 3: Jaw. " + "\n1) Form a closed fist. \n2) Relax hand. \n\nThe timer will start automatically"); exerciseDescGiven = true; game.ResetCameraArcAndRoll(); } // A sufficient delta in the vector between finger-tip and palm signals // the user has begun to moving their hand, start the timer if ((hand.Fingers.Frontmost.TipPosition - hand.PalmPosition).Magnitude < 0.9 * avgMag && !timer.IsRunning) { restartTimer(); } // Exercise part 0 - Form a fist if (hand.Fingers.Count == 3 && !clenchPromptGiven) { // Present time for this rep if (timer.IsRunning) { repTimes[repsPerformed] = timer.ElapsedMilliseconds; updateRepInfo("Rep " + (repsPerformed + 1) + " of 5 complete. \nTime: " + repTimes[repsPerformed] / 1000.0 + " seconds."); // New best rep time? if (repTimes[repsPerformed] < bestRepTime) { bestRepTime = repTimes[repsPerformed]; updateBestRepInfo("Best rep time: \nRep " + (repsPerformed + 1) + " of 5: \n" + bestRepTime / 1000.0 + "seconds."); } ++repsPerformed; restartTimer(); }
thesis-jamietaylor.docx