Fix for mouse ray with off axis projection.

This commit is contained in:
Andrzej Kapolka 2013-10-09 13:38:06 -07:00
parent e437ae888b
commit aa353a57ad

View file

@ -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,