Skip to content

Commit

Permalink
Fixes 0 division when camera is aligne on the x axis
Browse files Browse the repository at this point in the history
  • Loading branch information
Nehon committed Jul 18, 2018
1 parent 603193b commit 2a394a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sources/osgGA/OrbitManipulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,9 @@ utils.createPrototypeObject(

return function(dx, dy) {
var prevPitch = Math.atan(-this._rotation[6] / this._rotation[5]);
if (isNaN(prevPitch)) {
prevPitch = 0.0;
}
var pitch = this._computePitch(prevPitch, dy);

var deltaYaw = dx / 10.0;
Expand Down

0 comments on commit 2a394a3

Please sign in to comment.