Clamp x-axis rotation

This commit is contained in:
Brandon Dyck 2022-10-23 22:40:08 -06:00
parent b4281607c6
commit 3fa9cf2c94

View File

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