diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 09a9ec611e..f800c5c6b1 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1907,9 +1907,12 @@ void Application::renderLookatIndicator(glm::vec3 pointOfInterest, Camera& which glColor3f(1.0f, 0.0f, 0.0f); // renderCircle(haloOrigin, 0.1f, glm::vec3(0.0f, 1.0f, 0.0f), 30); - // glm::vec3 normal; - // _viewFrustum.computeNormalToNearClipPlane(normal); - renderCircle(indicatorOrigin, 0.1f, _viewFrustum.getDirection(), 30); + loadViewFrustum(_myCamera, _viewFrustum); + glm::vec3 normal; + _viewFrustum.computeNormalToOffset(normal); + + // Plane::Plane p(_viewFrustum.getOffsetPosition(), _viewFrustum.getOffsetUp(), _viewFrustum.getOffsetRight()); + renderCircle(indicatorOrigin, 0.1f, normal, 30); } void Application::update(float deltaTime) { diff --git a/interface/src/Application.h b/interface/src/Application.h index b577fa3af2..d09290c66e 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -42,6 +42,7 @@ #include "ViewFrustum.h" #include "VoxelSystem.h" #include "Webcam.h" +#include "Plane.h" class QAction; diff --git a/libraries/voxels/src/ViewFrustum.cpp b/libraries/voxels/src/ViewFrustum.cpp index 69fbeab54d..1122f6476e 100644 --- a/libraries/voxels/src/ViewFrustum.cpp +++ b/libraries/voxels/src/ViewFrustum.cpp @@ -364,9 +364,9 @@ bool ViewFrustum::matches(const ViewFrustum& compareTo, bool debug) const { return result; } -void ViewFrustum::computeNormalToNearClipPlane(glm::vec3& normal) const { - Plane nearClipPlane(_nearTopLeft, _nearTopRight, _nearBottomLeft); - normal = nearClipPlane.getNormal(); +void ViewFrustum::computeNormalToOffset(glm::vec3& normal) const { + Plane offsetPlane(_offsetPosition, _offsetRight, _offsetUp); + normal = offsetPlane.getNormal(); } void ViewFrustum::computePickRay(float x, float y, glm::vec3& origin, glm::vec3& direction) const { diff --git a/libraries/voxels/src/ViewFrustum.h b/libraries/voxels/src/ViewFrustum.h index 4f34143b27..9ecca573af 100644 --- a/libraries/voxels/src/ViewFrustum.h +++ b/libraries/voxels/src/ViewFrustum.h @@ -83,7 +83,7 @@ public: bool matches(const ViewFrustum& compareTo, bool debug = false) const; bool matches(const ViewFrustum* compareTo, bool debug = false) const { return matches(*compareTo, debug); }; - void computeNormalToNearClipPlane(glm::vec3& normal) const; + void computeNormalToOffset(glm::vec3& normal) const; void computePickRay(float x, float y, glm::vec3& origin, glm::vec3& direction) const;