Showing the changes to interface/src/SecondaryCamera.cpp (1 of 1 file). Show all
Unified · Split
| @@ -47,11 +47,16 @@ class BeginSecondaryCameraFrame { // Changes renderContext for our framebuffer · 46 unmodified lines | ||
| 47 | 47 | float _vFoV{}; |
| 48 | 48 | float _nearClipPlaneDistance{}; |
| 49 | 49 | float _farClipPlaneDistance{}; |
| 50 | + EntityPropertyFlags _attachedEntityPropertyFlags; | |
| 51 | + QSharedPointer<EntityScriptingInterface> _entityScriptingInterface; | |
| 50 | 52 | public: |
| 51 | 53 | using Config = BeginSecondaryCameraFrameConfig; |
| 52 | 54 | using JobModel = render::Job::ModelO<BeginSecondaryCameraFrame, RenderArgsPointer, Config>; |
| 53 | 55 | BeginSecondaryCameraFrame() { |
| 54 | 56 | _cachedArgsPointer = std::make_shared<RenderArgs>(_cachedArgs); |
| 57 | + _entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>(); | |
| 58 | + _attachedEntityPropertyFlags += PROP_POSITION; | |
| 59 | + _attachedEntityPropertyFlags += PROP_ROTATION; | |
| 55 | 60 | } |
| 56 | 61 | |
| 57 | 62 | void configure(const Config& config) { |
| @@ -87,12 +92,7 @@ public: · 29 unmodified lines | ||
| 87 | 92 | |
| 88 | 93 | auto srcViewFrustum = args->getViewFrustum(); |
| 89 | 94 | if (_attachedEntityId != QUuid()) { |
| 90 | − auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>(); | |
| 91 | − EntityPropertyFlags entityPropertyFlags; | |
| 92 | − entityPropertyFlags += PROP_POSITION; | |
| 93 | − entityPropertyFlags += PROP_ROTATION; | |
| 94 | − EntityItemProperties entityProperties = entityScriptingInterface->getEntityProperties(_attachedEntityId, entityPropertyFlags); | |
| 95 | − | |
| 95 | + EntityItemProperties entityProperties = _entityScriptingInterface->getEntityProperties(_attachedEntityId, _attachedEntityPropertyFlags); | |
| 96 | 96 | srcViewFrustum.setPosition(entityProperties.getPosition()); |
| 97 | 97 | srcViewFrustum.setOrientation(entityProperties.getRotation()); |
| 98 | 98 | } else { |