Skip to content

Commit

Permalink
Merge pull request cedricpinson#985 from cedricpinson/bug/camera-x-al…
Browse files Browse the repository at this point in the history
…ign_D3D-4481

Fixes 0 division when camera is aligne on the x axis
  • Loading branch information
cedricpinson authored Jul 18, 2018
2 parents 856e44d + 2a394a3 commit 02a0ae2
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 02a0ae2

Please sign in to comment.