Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 14 files). Show all
Unified · Split
| @@ -35,51 +35,6 @@ void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) { · 34 unmodified lines | |||
| 35 | } | 35 | } |
| 36 | } | 36 | } |
| 37 | 37 | ||
| 38 | const PalmData* ControllerScriptingInterface::getPrimaryPalm() const { | ||
| 39 | int leftPalmIndex, rightPalmIndex; | ||
| 40 | |||
| 41 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); | ||
| 42 | handData->getLeftRightPalmIndices(leftPalmIndex, rightPalmIndex); | ||
| 43 | |||
| 44 | if (rightPalmIndex != -1) { | ||
| 45 | return &handData->getPalms()[rightPalmIndex]; | ||
| 46 | } | ||
| 47 | |||
| 48 | return NULL; | ||
| 49 | } | ||
| 50 | |||
| 51 | int ControllerScriptingInterface::getNumberOfActivePalms() const { | ||
| 52 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); | ||
| 53 | int numberOfPalms = handData->getNumPalms(); | ||
| 54 | int numberOfActivePalms = 0; | ||
| 55 | for (int i = 0; i < numberOfPalms; i++) { | ||
| 56 | if (getPalm(i)->isActive()) { | ||
| 57 | numberOfActivePalms++; | ||
| 58 | } | ||
| 59 | } | ||
| 60 | return numberOfActivePalms; | ||
| 61 | } | ||
| 62 | |||
| 63 | const PalmData* ControllerScriptingInterface::getPalm(int palmIndex) const { | ||
| 64 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); | ||
| 65 | return &handData->getPalms()[palmIndex]; | ||
| 66 | } | ||
| 67 | |||
| 68 | const PalmData* ControllerScriptingInterface::getActivePalm(int palmIndex) const { | ||
| 69 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); | ||
| 70 | int numberOfPalms = handData->getNumPalms(); | ||
| 71 | int numberOfActivePalms = 0; | ||
| 72 | for (int i = 0; i < numberOfPalms; i++) { | ||
| 73 | if (getPalm(i)->isActive()) { | ||
| 74 | if (numberOfActivePalms == palmIndex) { | ||
| 75 | return &handData->getPalms()[i]; | ||
| 76 | } | ||
| 77 | numberOfActivePalms++; | ||
| 78 | } | ||
| 79 | } | ||
| 80 | return NULL; | ||
| 81 | } | ||
| 82 | |||
| 83 | bool ControllerScriptingInterface::isKeyCaptured(QKeyEvent* event) const { | 38 | bool ControllerScriptingInterface::isKeyCaptured(QKeyEvent* event) const { |
| 84 | return isKeyCaptured(KeyEvent(*event)); | 39 | return isKeyCaptured(KeyEvent(*event)); |
| 85 | } | 40 | } |