also unravelling some spaghetti: (1) split Octree stuff out of ViewFrustum (2) moved ViewFrustum from octree to shared lib (3) removed some cruft
Showing the changes to libraries/render/src/render/DrawSceneOctree.cpp (1 of 46 files). Show all
Unified · Split
| @@ -14,6 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <algorithm> |
| 15 | 15 | #include <assert.h> |
| 16 | 16 | |
| 17 | +#include <OctreeUtils.h> | |
| 17 | 18 | #include <PerfStat.h> |
| 18 | 19 | #include <RenderArgs.h> |
| 19 | 20 | |
| @@ -86,7 +87,7 @@ void DrawSceneOctree::configure(const Config& config) { · 66 unmodified lines | ||
| 86 | 87 | void DrawSceneOctree::run(const SceneContextPointer& sceneContext, |
| 87 | 88 | const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) { |
| 88 | 89 | assert(renderContext->args); |
| 89 | − assert(renderContext->args->_viewFrustum); | |
| 90 | + assert(renderContext->args->hasViewFrustum()); | |
| 90 | 91 | RenderArgs* args = renderContext->args; |
| 91 | 92 | auto& scene = sceneContext->_scene; |
| 92 | 93 | |
| @@ -97,8 +98,8 @@ void DrawSceneOctree::run(const SceneContextPointer& sceneContext, · 4 unmodified lines | ||
| 97 | 98 | gpu::doInBatch(args->_context, [&](gpu::Batch& batch) { |
| 98 | 99 | glm::mat4 projMat; |
| 99 | 100 | Transform viewMat; |
| 100 | − args->_viewFrustum->evalProjectionMatrix(projMat); | |
| 101 | − args->_viewFrustum->evalViewTransform(viewMat); | |
| 101 | + args->getViewFrustum().evalProjectionMatrix(projMat); | |
| 102 | + args->getViewFrustum().evalViewTransform(viewMat); | |
| 102 | 103 | batch.setViewportTransform(args->_viewport); |
| 103 | 104 | |
| 104 | 105 | batch.setProjectionTransform(projMat); |
| @@ -148,7 +149,7 @@ void DrawSceneOctree::run(const SceneContextPointer& sceneContext, · 43 unmodified lines | ||
| 148 | 149 | } |
| 149 | 150 | // Draw the LOD Reticle |
| 150 | 151 | { |
| 151 | − float angle = glm::degrees(args->_viewFrustum->getAccuracyAngle(args->_sizeScale, args->_boundaryLevelAdjust)); | |
| 152 | + float angle = glm::degrees(getAccuracyAngle(args->_sizeScale, args->_boundaryLevelAdjust)); | |
| 152 | 153 | Transform crosshairModel; |
| 153 | 154 | crosshairModel.setTranslation(glm::vec3(0.0, 0.0, -1000.0)); |
| 154 | 155 | crosshairModel.setScale(1000.0 * tan(glm::radians(angle))); // Scaling at the actual tan of the lod angle => Multiplied by TWO |
| @@ -198,15 +199,15 @@ void DrawItemSelection::configure(const Config& config) { · 43 unmodified lines | ||
| 198 | 199 | void DrawItemSelection::run(const SceneContextPointer& sceneContext, |
| 199 | 200 | const RenderContextPointer& renderContext, const ItemSpatialTree::ItemSelection& inSelection) { |
| 200 | 201 | assert(renderContext->args); |
| 201 | − assert(renderContext->args->_viewFrustum); | |
| 202 | + assert(renderContext->args->hasViewFrustum()); | |
| 202 | 203 | RenderArgs* args = renderContext->args; |
| 203 | 204 | auto& scene = sceneContext->_scene; |
| 204 | 205 | |
| 205 | 206 | gpu::doInBatch(args->_context, [&](gpu::Batch& batch) { |
| 206 | 207 | glm::mat4 projMat; |
| 207 | 208 | Transform viewMat; |
| 208 | − args->_viewFrustum->evalProjectionMatrix(projMat); | |
| 209 | − args->_viewFrustum->evalViewTransform(viewMat); | |
| 209 | + args->getViewFrustum().evalProjectionMatrix(projMat); | |
| 210 | + args->getViewFrustum().evalViewTransform(viewMat); | |
| 210 | 211 | batch.setViewportTransform(args->_viewport); |
| 211 | 212 | |
| 212 | 213 | batch.setProjectionTransform(projMat); |