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 interface/src/Application.cpp (1 of 46 files). Show all
Unified · Split
| @@ -1513,9 +1513,10 @@ void Application::paintGL() { · 1512 unmodified lines | ||
| 1513 | 1513 | |
| 1514 | 1514 | |
| 1515 | 1515 | _viewFrustum.calculate(); |
| 1516 | − RenderArgs renderArgs(_gpuContext, getEntities(), getViewFrustum(), lodManager->getOctreeSizeScale(), | |
| 1516 | + RenderArgs renderArgs(_gpuContext, getEntities(), lodManager->getOctreeSizeScale(), | |
| 1517 | 1517 | lodManager->getBoundaryLevelAdjust(), RenderArgs::DEFAULT_RENDER_MODE, |
| 1518 | 1518 | RenderArgs::MONO, RenderArgs::RENDER_DEBUG_NONE); |
| 1519 | + renderArgs.setViewFrustum(getViewFrustum()); | |
| 1519 | 1520 | |
| 1520 | 1521 | PerformanceWarning::setSuppressShortTimings(Menu::getInstance()->isOptionChecked(MenuOption::SuppressShortTimings)); |
| 1521 | 1522 | bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings); |
| @@ -1682,7 +1683,7 @@ void Application::paintGL() { · 160 unmodified lines | ||
| 1682 | 1683 | renderArgs._context->enableStereo(true); |
| 1683 | 1684 | mat4 eyeOffsets[2]; |
| 1684 | 1685 | mat4 eyeProjections[2]; |
| 1685 | − auto baseProjection = renderArgs._viewFrustum->getProjection(); | |
| 1686 | + auto baseProjection = renderArgs.getViewFrustum().getProjection(); | |
| 1686 | 1687 | auto hmdInterface = DependencyManager::get<HMDScriptingInterface>(); |
| 1687 | 1688 | float IPDScale = hmdInterface->getIPDScale(); |
| 1688 | 1689 | mat4 headPose = displayPlugin->getHeadPose(); |
| @@ -3862,7 +3863,7 @@ PickRay Application::computePickRay(float x, float y) const { · 2173 unmodified lines | ||
| 3862 | 3863 | getApplicationCompositor().computeHmdPickRay(pickPoint, result.origin, result.direction); |
| 3863 | 3864 | } else { |
| 3864 | 3865 | pickPoint /= getCanvasSize(); |
| 3865 | − getViewFrustum()->computePickRay(pickPoint.x, pickPoint.y, result.origin, result.direction); | |
| 3866 | + getViewFrustum().computePickRay(pickPoint.x, pickPoint.y, result.origin, result.direction); | |
| 3866 | 3867 | } |
| 3867 | 3868 | return result; |
| 3868 | 3869 | } |
| @@ -3875,34 +3876,24 @@ glm::vec3 Application::getAvatarPosition() const { · 6 unmodified lines | ||
| 3875 | 3876 | return getMyAvatar()->getPosition(); |
| 3876 | 3877 | } |
| 3877 | 3878 | |
| 3878 | −const ViewFrustum* Application::getViewFrustum() const { | |
| 3879 | +const ViewFrustum& Application::getViewFrustum() const { | |
| 3879 | 3880 | #ifdef DEBUG |
| 3880 | 3881 | if (QThread::currentThread() == activeRenderingThread) { |
| 3881 | 3882 | // FIXME, figure out a better way to do this |
| 3882 | 3883 | //qWarning() << "Calling Application::getViewFrustum() from the active rendering thread, did you mean Application::getDisplayViewFrustum()?"; |
| 3883 | 3884 | } |
| 3884 | 3885 | #endif |
| 3885 | − return &_viewFrustum; | |
| 3886 | + return _viewFrustum; | |
| 3886 | 3887 | } |
| 3887 | 3888 | |
| 3888 | −ViewFrustum* Application::getDisplayViewFrustum() { | |
| 3889 | +const ViewFrustum& Application::getDisplayViewFrustum() const { | |
| 3889 | 3890 | #ifdef DEBUG |
| 3890 | 3891 | if (QThread::currentThread() != activeRenderingThread) { |
| 3891 | 3892 | // FIXME, figure out a better way to do this |
| 3892 | 3893 | // qWarning() << "Calling Application::getDisplayViewFrustum() from outside the active rendering thread or outside rendering, did you mean Application::getViewFrustum()?"; |
| 3893 | 3894 | } |
| 3894 | 3895 | #endif |
| 3895 | − return &_displayViewFrustum; | |
| 3896 | −} | |
| 3897 | − | |
| 3898 | −const ViewFrustum* Application::getDisplayViewFrustum() const { | |
| 3899 | −#ifdef DEBUG | |
| 3900 | − if (QThread::currentThread() != activeRenderingThread) { | |
| 3901 | − // FIXME, figure out a better way to do this | |
| 3902 | − // qWarning() << "Calling Application::getDisplayViewFrustum() from outside the active rendering thread or outside rendering, did you mean Application::getViewFrustum()?"; | |
| 3903 | − } | |
| 3904 | −#endif | |
| 3905 | − return &_displayViewFrustum; | |
| 3896 | + return _displayViewFrustum; | |
| 3906 | 3897 | } |
| 3907 | 3898 | |
| 3908 | 3899 | // WorldBox Render Data & rendering functions |
| @@ -3967,7 +3958,7 @@ namespace render { · 58 unmodified lines | ||
| 3967 | 3958 | auto skybox = skyStage->getSkybox(); |
| 3968 | 3959 | if (skybox) { |
| 3969 | 3960 | PerformanceTimer perfTimer("skybox"); |
| 3970 | − skybox->render(batch, *(args->_viewFrustum)); | |
| 3961 | + skybox->render(batch, args->getViewFrustum()); | |
| 3971 | 3962 | break; |
| 3972 | 3963 | } |
| 3973 | 3964 | } |
| @@ -4079,7 +4070,7 @@ void Application::displaySide(RenderArgs* renderArgs, Camera& theCamera, bool se · 105 unmodified lines | ||
| 4079 | 4070 | { |
| 4080 | 4071 | PerformanceTimer perfTimer("EngineRun"); |
| 4081 | 4072 | |
| 4082 | − renderArgs->_viewFrustum = getDisplayViewFrustum(); | |
| 4073 | + renderArgs->setViewFrustum(getDisplayViewFrustum()); | |
| 4083 | 4074 | _renderEngine->getRenderContext()->args = renderArgs; |
| 4084 | 4075 | |
| 4085 | 4076 | // Before the deferred pass, let's try to use the render engine |