some ends of spaghetti get pushed into AvatarManger class split Camera class into Camera base and FancyCamera derivation Application::getCamera() returns Camera by refence instead of pointer
Showing the changes to interface/src/scripting/HMDScriptingInterface.cpp (1 of 13 files). Show all
Unified · Split
| @@ -105,9 +105,9 @@ QScriptValue HMDScriptingInterface::getHUDLookAtPosition3D(QScriptContext* conte · 104 unmodified lines | ||
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | bool HMDScriptingInterface::getHUDLookAtPosition3D(glm::vec3& result) const { |
| 108 | − Camera* camera = qApp->getCamera(); | |
| 109 | − glm::vec3 position = camera->getPosition(); | |
| 110 | − glm::quat orientation = camera->getOrientation(); | |
| 108 | + const Camera& camera = qApp->getCamera(); | |
| 109 | + glm::vec3 position = camera.getPosition(); | |
| 110 | + glm::quat orientation = camera.getOrientation(); | |
| 111 | 111 | |
| 112 | 112 | glm::vec3 direction = orientation * glm::vec3(0.0f, 0.0f, -1.0f); |
| 113 | 113 | |