Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 18 files). Show all
Unified · Split
| @@ -9,10 +9,12 @@ · 8 unmodified lines | |||
| 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html | 9 | // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html |
| 10 | // | 10 | // |
| 11 | 11 | ||
| 12 | #include <avatar/AvatarManager.h> | ||
| 13 | #include <avatar/MyAvatar.h> | ||
| 14 | #include <GLCanvas.h> | ||
| 12 | #include <HandData.h> | 15 | #include <HandData.h> |
| 13 | #include <HFBackEvent.h> | 16 | #include <HFBackEvent.h> |
| 14 | 17 | ||
| 15 | #include "Application.h" | ||
| 16 | #include "devices/MotionTracker.h" | 18 | #include "devices/MotionTracker.h" |
| 17 | #include "devices/SixenseManager.h" | 19 | #include "devices/SixenseManager.h" |
| 18 | #include "ControllerScriptingInterface.h" | 20 | #include "ControllerScriptingInterface.h" |
| @@ -41,7 +43,7 @@ void ControllerScriptingInterface::handleMetaEvent(HFMetaEvent* event) { · 22 unmodified lines | |||
| 41 | const PalmData* ControllerScriptingInterface::getPrimaryPalm() const { | 43 | const PalmData* ControllerScriptingInterface::getPrimaryPalm() const { |
| 42 | int leftPalmIndex, rightPalmIndex; | 44 | int leftPalmIndex, rightPalmIndex; |
| 43 | 45 | ||
| 44 | const HandData* handData = Application::getInstance()->getAvatar()->getHandData(); | 46 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); |
| 45 | handData->getLeftRightPalmIndices(leftPalmIndex, rightPalmIndex); | 47 | handData->getLeftRightPalmIndices(leftPalmIndex, rightPalmIndex); |
| 46 | 48 | ||
| 47 | if (rightPalmIndex != -1) { | 49 | if (rightPalmIndex != -1) { |
| @@ -52,7 +54,7 @@ const PalmData* ControllerScriptingInterface::getPrimaryPalm() const { · 4 unmodified lines | |||
| 52 | } | 54 | } |
| 53 | 55 | ||
| 54 | int ControllerScriptingInterface::getNumberOfActivePalms() const { | 56 | int ControllerScriptingInterface::getNumberOfActivePalms() const { |
| 55 | const HandData* handData = Application::getInstance()->getAvatar()->getHandData(); | 57 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); |
| 56 | int numberOfPalms = handData->getNumPalms(); | 58 | int numberOfPalms = handData->getNumPalms(); |
| 57 | int numberOfActivePalms = 0; | 59 | int numberOfActivePalms = 0; |
| 58 | for (int i = 0; i < numberOfPalms; i++) { | 60 | for (int i = 0; i < numberOfPalms; i++) { |
| @@ -64,12 +66,12 @@ int ControllerScriptingInterface::getNumberOfActivePalms() const { · 5 unmodified lines | |||
| 64 | } | 66 | } |
| 65 | 67 | ||
| 66 | const PalmData* ControllerScriptingInterface::getPalm(int palmIndex) const { | 68 | const PalmData* ControllerScriptingInterface::getPalm(int palmIndex) const { |
| 67 | const HandData* handData = Application::getInstance()->getAvatar()->getHandData(); | 69 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); |
| 68 | return &handData->getPalms()[palmIndex]; | 70 | return &handData->getPalms()[palmIndex]; |
| 69 | } | 71 | } |
| 70 | 72 | ||
| 71 | const PalmData* ControllerScriptingInterface::getActivePalm(int palmIndex) const { | 73 | const PalmData* ControllerScriptingInterface::getActivePalm(int palmIndex) const { |
| 72 | const HandData* handData = Application::getInstance()->getAvatar()->getHandData(); | 74 | const HandData* handData = DependencyManager::get<AvatarManager>()->getMyAvatar()->getHandData(); |
| 73 | int numberOfPalms = handData->getNumPalms(); | 75 | int numberOfPalms = handData->getNumPalms(); |
| 74 | int numberOfActivePalms = 0; | 76 | int numberOfActivePalms = 0; |
| 75 | for (int i = 0; i < numberOfPalms; i++) { | 77 | for (int i = 0; i < numberOfPalms; i++) { |