History

Add option to disable triggering an away state when interface focus is lost.

Saracen committed 7 years ago

Commit 90e979b1 parent 6ccf16d6 files · +53 −2Browse files

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

Unified · Split

interface/src/scripting/HMDScriptingInterface.cpp+11−0
@@ -30,6 +30,9 @@ HMDScriptingInterface::HMDScriptingInterface() { · 29 unmodified lines
30 connect(qApp, &Application::miniTabletEnabledChanged, [this](bool enabled) {30 connect(qApp, &Application::miniTabletEnabledChanged, [this](bool enabled) {
31 emit miniTabletEnabledChanged(enabled);31 emit miniTabletEnabledChanged(enabled);
32 });32 });
33 connect(qApp, &Application::awayStateWhenFocusLostInVRChanged, [this](bool enabled) {
34 emit awayStateWhenFocusLostInVRChanged(enabled);
35 });
33}36}
34 37
35glm::vec3 HMDScriptingInterface::calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction) const {38glm::vec3 HMDScriptingInterface::calculateRayUICollisionPoint(const glm::vec3& position, const glm::vec3& direction) const {
@@ -137,6 +140,14 @@ bool HMDScriptingInterface::getMiniTabletEnabled() { · 101 unmodified lines
137 return qApp->getMiniTabletEnabled();140 return qApp->getMiniTabletEnabled();
138}141}
139 142
143void HMDScriptingInterface::setAwayStateWhenFocusLostInVREnabled(bool enabled) {
144 qApp->setAwayStateWhenFocusLostInVREnabled(enabled);
145}
146
147bool HMDScriptingInterface::getAwayStateWhenFocusLostInVREnabled() {
148 return qApp->getAwayStateWhenFocusLostInVREnabled();
149}
150
140 151
141QScriptValue HMDScriptingInterface::getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine) {152QScriptValue HMDScriptingInterface::getHUDLookAtPosition2D(QScriptContext* context, QScriptEngine* engine) {
142 glm::vec3 hudIntersection;153 glm::vec3 hudIntersection;