From aa353a57ad9fba2e35a9a949fe4f5f380297f14b Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Wed, 9 Oct 2013 13:38:06 -0700 Subject: [PATCH] Fix for mouse ray with off axis projection. --- libraries/voxels/src/ViewFrustum.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/voxels/src/ViewFrustum.cpp b/libraries/voxels/src/ViewFrustum.cpp index 51d7639678..e0cfa7cd97 100644 --- a/libraries/voxels/src/ViewFrustum.cpp +++ b/libraries/voxels/src/ViewFrustum.cpp @@ -371,7 +371,7 @@ bool ViewFrustum::matches(const ViewFrustum& compareTo, bool debug) const { void ViewFrustum::computePickRay(float x, float y, glm::vec3& origin, glm::vec3& direction) const { origin = _nearTopLeft + x*(_nearTopRight - _nearTopLeft) + y*(_nearBottomLeft - _nearTopLeft); - direction = glm::normalize(origin - _position); + direction = glm::normalize(origin - (_position + _orientation * _eyeOffsetPosition)); } void ViewFrustum::computeOffAxisFrustum(float& left, float& right, float& bottom, float& top, float& near, float& far,