History

away.js now shows hand controllers in away mode.

* controllerDisplayManager is now part of default scripts. * Also tutorial and away.js communicate with controllerDisplayManager via HMD.requestShowHandControllers, HMD.requestHideHandControllers and sendLocalMessage. * removed previous version of controllerDisplayManger from tutorial.

Anthony J. Thibault committed 10 years ago

Commit 60f72851 parent 5d7f79a9 files · +45 −682Browse files

Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 9 files). Show all

Unified · Split

interface/src/scripting/HMDScriptingInterface.cpp+14−0
@@ -57,6 +57,20 @@ bool HMDScriptingInterface::isHandControllerAvailable() { · 56 unmodified lines
57 return PluginUtils::isHandControllerAvailable();57 return PluginUtils::isHandControllerAvailable();
58}58}
59 59
60void HMDScriptingInterface::requestShowHandControllers() {
61 _showHandControllersCount++;
62 emit shouldShowHandControllersChanged();
63}
64
65void HMDScriptingInterface::requestHideHandControllers() {
66 _showHandControllersCount--;
67 emit shouldShowHandControllersChanged();
68}
69
70bool HMDScriptingInterface::shouldShowHandControllers() const {
71 return _showHandControllersCount > 0;
72}
73
60QScriptValue HMDScriptingInterface::getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine) {74QScriptValue HMDScriptingInterface::getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine) {
61 glm::vec3 hudIntersection;75 glm::vec3 hudIntersection;
62 auto instance = DependencyManager::get<HMDScriptingInterface>();76 auto instance = DependencyManager::get<HMDScriptingInterface>();