Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 3 files). Show all
Unified · Split
| @@ -29,7 +29,7 @@ QScriptValue HMDScriptingInterface::getHUDLookAtPosition2D(QScriptContext* conte · 28 unmodified lines | |||
| 29 | glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * (hudIntersection - sphereCenter); | 29 | glm::vec3 direction = glm::inverse(myAvatar->getOrientation()) * (hudIntersection - sphereCenter); |
| 30 | glm::quat rotation = ::rotationBetween(glm::vec3(0.0f, 0.0f, -1.0f), direction); | 30 | glm::quat rotation = ::rotationBetween(glm::vec3(0.0f, 0.0f, -1.0f), direction); |
| 31 | glm::vec3 eulers = ::safeEulerAngles(rotation); | 31 | glm::vec3 eulers = ::safeEulerAngles(rotation); |
| 32 | return qScriptValueFromValue<glm::vec2>(engine, Application::getInstance()->getApplicationCompositor() | 32 | return qScriptValueFromValue<glm::vec2>(engine, qApp->getApplicationCompositor() |
| 33 | .sphericalToOverlay(glm::vec2(eulers.y, -eulers.x))); | 33 | .sphericalToOverlay(glm::vec2(eulers.y, -eulers.x))); |
| 34 | } | 34 | } |
| 35 | return QScriptValue::NullValue; | 35 | return QScriptValue::NullValue; |
| @@ -49,17 +49,17 @@ void HMDScriptingInterface::toggleMagnifier() { · 13 unmodified lines | |||
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | bool HMDScriptingInterface::getMagnifier() const { | 51 | bool HMDScriptingInterface::getMagnifier() const { |
| 52 | return Application::getInstance()->getApplicationCompositor().hasMagnifier(); | 52 | return qApp->getApplicationCompositor().hasMagnifier(); |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | bool HMDScriptingInterface::getHUDLookAtPosition3D(glm::vec3& result) const { | 55 | bool HMDScriptingInterface::getHUDLookAtPosition3D(glm::vec3& result) const { |
| 56 | Camera* camera = Application::getInstance()->getCamera(); | 56 | Camera* camera = qApp->getCamera(); |
| 57 | glm::vec3 position = camera->getPosition(); | 57 | glm::vec3 position = camera->getPosition(); |
| 58 | glm::quat orientation = camera->getOrientation(); | 58 | glm::quat orientation = camera->getOrientation(); |
| 59 | 59 | ||
| 60 | glm::vec3 direction = orientation * glm::vec3(0.0f, 0.0f, -1.0f); | 60 | glm::vec3 direction = orientation * glm::vec3(0.0f, 0.0f, -1.0f); |
| 61 | 61 | ||
| 62 | const auto& compositor = Application::getInstance()->getApplicationCompositor(); | 62 | const auto& compositor = qApp->getApplicationCompositor(); |
| 63 | 63 | ||
| 64 | return compositor.calculateRayUICollisionPoint(position, direction, result); | 64 | return compositor.calculateRayUICollisionPoint(position, direction, result); |
| 65 | } | 65 | } |