Clamp x-axis rotation
This commit is contained in:
parent
b4281607c6
commit
3fa9cf2c94
@ -159,6 +159,11 @@
|
||||
case "mousemove":
|
||||
θy += event.movementX * 0.005;
|
||||
θx += event.movementY * 0.005;
|
||||
if (θx < -Math.PI / 2) {
|
||||
θx = -Math.PI / 2;
|
||||
} else if (θx > Math.PI / 2) {
|
||||
θx = Math.PI / 2;
|
||||
}
|
||||
break
|
||||
}
|
||||
return PanState.panning;
|
||||
|
Loading…
Reference in New Issue
Block a user