Prevent the user from flipping the camera upside down in the 3D view
This commit is contained in:
parent
82f876c4ff
commit
445d00fed3
|
@ -277,7 +277,9 @@ export class PerspectiveCamera extends Camera {
|
|||
return;
|
||||
|
||||
this.rotation[0] += event.movementX * PERSPECTIVE_ROTATION_SPEED;
|
||||
this.rotation[1] += event.movementY * PERSPECTIVE_ROTATION_SPEED;
|
||||
|
||||
const trialYRotation = this.rotation[1] + event.movementY * PERSPECTIVE_ROTATION_SPEED;
|
||||
this.rotation[1] = _.clamp(trialYRotation, -Math.PI * 0.5, Math.PI * 0.5);
|
||||
|
||||
if (this.onChange != null)
|
||||
this.onChange();
|
||||
|
|
Loading…
Reference in New Issue