History

misc. changes

Anthony J. Thibault committed 11 years ago

Commit 2ac6b6c1 parent 0f30da65 files · +22 −26Browse files

Showing the changes to interface/src/Application.cpp (1 of 5 files). Show all

Unified · Split

interface/src/Application.cpp+17−17
@@ -2628,22 +2628,21 @@ void Application::update(float deltaTime) { · 2627 unmodified lines
26282628 _myAvatar->setDriveKeys(ROT_DOWN, userInputMapper->getActionState(UserInputMapper::PITCH_DOWN));
26292629 _myAvatar->setDriveKeys(ROT_LEFT, userInputMapper->getActionState(UserInputMapper::YAW_LEFT));
26302630 _myAvatar->setDriveKeys(ROT_RIGHT, userInputMapper->getActionState(UserInputMapper::YAW_RIGHT));
2631− // TODO: set hand positions somehow
2632− UserInputMapper::PoseValue leftHand = userInputMapper->getPoseState(UserInputMapper::LEFT_HAND);
2633− UserInputMapper::PoseValue rightHand = userInputMapper->getPoseState(UserInputMapper::RIGHT_HAND);
2634− Hand* hand = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHand();
2635− setPalmData(hand, leftHand, LEFT_HAND_INDEX);
2636− setPalmData(hand, rightHand, RIGHT_HAND_INDEX);
2637− if (Menu::getInstance()->isOptionChecked(MenuOption::HandMouseInput)) {
2638− emulateMouse(hand, userInputMapper->getActionState(UserInputMapper::LEFT_HAND_CLICK),
2639− userInputMapper->getActionState(UserInputMapper::SHIFT), LEFT_HAND_INDEX);
2640− emulateMouse(hand, userInputMapper->getActionState(UserInputMapper::RIGHT_HAND_CLICK),
2641− userInputMapper->getActionState(UserInputMapper::SHIFT), RIGHT_HAND_INDEX);
2642− }
26432631 }
26442632 _myAvatar->setDriveKeys(BOOM_IN, userInputMapper->getActionState(UserInputMapper::BOOM_IN));
26452633 _myAvatar->setDriveKeys(BOOM_OUT, userInputMapper->getActionState(UserInputMapper::BOOM_OUT));
26462634 }
2635+ UserInputMapper::PoseValue leftHand = userInputMapper->getPoseState(UserInputMapper::LEFT_HAND);
2636+ UserInputMapper::PoseValue rightHand = userInputMapper->getPoseState(UserInputMapper::RIGHT_HAND);
2637+ Hand* hand = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHand();
2638+ setPalmData(hand, leftHand, LEFT_HAND_INDEX);
2639+ setPalmData(hand, rightHand, RIGHT_HAND_INDEX);
2640+ if (Menu::getInstance()->isOptionChecked(MenuOption::HandMouseInput)) {
2641+ emulateMouse(hand, userInputMapper->getActionState(UserInputMapper::LEFT_HAND_CLICK),
2642+ userInputMapper->getActionState(UserInputMapper::SHIFT), LEFT_HAND_INDEX);
2643+ emulateMouse(hand, userInputMapper->getActionState(UserInputMapper::RIGHT_HAND_CLICK),
2644+ userInputMapper->getActionState(UserInputMapper::SHIFT), RIGHT_HAND_INDEX);
2645+ }
26472646
26482647 updateThreads(deltaTime); // If running non-threaded, then give the threads some time to process...
26492648
@@ -2804,6 +2803,7 @@ void Application::setPalmData(Hand* hand, UserInputMapper::PoseValue pose, int i · 154 unmodified lines
28042803 if (hand->getPalms()[j].getSixenseID() == index) {
28052804 palm = &(hand->getPalms()[j]);
28062805 foundHand = true;
2806+ break;
28072807 }
28082808 }
28092809 if (!foundHand) {
@@ -2813,11 +2813,7 @@ void Application::setPalmData(Hand* hand, UserInputMapper::PoseValue pose, int i · 3 unmodified lines
28132813 palm->setSixenseID(index);
28142814 }
28152815
2816− if (foundHand) {
2817− palm->setActive(pose.isValid());
2818− } else {
2819− palm->setActive(false); // if this isn't a Sixsense ID palm, always make it inactive
2820− }
2816+ palm->setActive(pose.isValid());
28212817
28222818 // TODO: velocity filters, tip velocities, et.c
28232819 // see SixenseManager
@@ -2843,8 +2839,10 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index) · 19 unmodified lines
28432839 if (hand->getPalms()[j].getSixenseID() == index) {
28442840 palm = &(hand->getPalms()[j]);
28452841 foundHand = true;
2842+ break;
28462843 }
28472844 }
2845+ //qDebug() << "emulateMouse" << !foundHand << !palm->isActive();
28482846 if (!foundHand || !palm->isActive()) {
28492847 return;
28502848 }
@@ -2874,6 +2872,8 @@ void Application::emulateMouse(Hand* hand, float click, float shift, int index) · 23 unmodified lines
28742872
28752873 }
28762874
2875+ //qDebug() << index << " " << click << " " << shift << " " << pos;
2876+
28772877 //If we are off screen then we should stop processing, and if a trigger or bumper is pressed,
28782878 //we should unpress them.
28792879 if (pos.x() == INT_MAX) {