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 | float _vFoV{}; | 47 | float _vFoV{}; |
| 48 | float _nearClipPlaneDistance{}; | 48 | float _nearClipPlaneDistance{}; |
| 49 | float _farClipPlaneDistance{}; | 49 | float _farClipPlaneDistance{}; |
| 50 | EntityPropertyFlags _attachedEntityPropertyFlags; | ||
| 51 | QSharedPointer<EntityScriptingInterface> _entityScriptingInterface; | ||
| 50 | public: | 52 | public: |
| 51 | using Config = BeginSecondaryCameraFrameConfig; | 53 | using Config = BeginSecondaryCameraFrameConfig; |
| 52 | using JobModel = render::Job::ModelO<BeginSecondaryCameraFrame, RenderArgsPointer, Config>; | 54 | using JobModel = render::Job::ModelO<BeginSecondaryCameraFrame, RenderArgsPointer, Config>; |
| 53 | BeginSecondaryCameraFrame() { | 55 | BeginSecondaryCameraFrame() { |
| 54 | _cachedArgsPointer = std::make_shared<RenderArgs>(_cachedArgs); | 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 | void configure(const Config& config) { | 62 | void configure(const Config& config) { |
| @@ -87,12 +92,7 @@ public: · 29 unmodified lines | |||
| 87 | 92 | ||
| 88 | auto srcViewFrustum = args->getViewFrustum(); | 93 | auto srcViewFrustum = args->getViewFrustum(); |
| 89 | if (_attachedEntityId != QUuid()) { | 94 | if (_attachedEntityId != QUuid()) { |
| 90 | auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>(); | 95 | EntityItemProperties entityProperties = _entityScriptingInterface->getEntityProperties(_attachedEntityId, _attachedEntityPropertyFlags); |
| 91 | EntityPropertyFlags entityPropertyFlags; | ||
| 92 | entityPropertyFlags += PROP_POSITION; | ||
| 93 | entityPropertyFlags += PROP_ROTATION; | ||
| 94 | EntityItemProperties entityProperties = entityScriptingInterface->getEntityProperties(_attachedEntityId, entityPropertyFlags); | ||
| 95 | |||
| 96 | srcViewFrustum.setPosition(entityProperties.getPosition()); | 96 | srcViewFrustum.setPosition(entityProperties.getPosition()); |
| 97 | srcViewFrustum.setOrientation(entityProperties.getRotation()); | 97 | srcViewFrustum.setOrientation(entityProperties.getRotation()); |
| 98 | } else { | 98 | } else { |