bilca commited on
Commit
a27d51f
·
verified ·
1 Parent(s): 050db51

Upload 85 files

Browse files
dist/index.js CHANGED
The diff for this file is too large to render. See raw diff
 
dist/index.js.map CHANGED
The diff for this file is too large to render. See raw diff
 
src/controls/OrbitControls.ts CHANGED
@@ -4,12 +4,12 @@ import { Quaternion } from "../math/Quaternion";
4
  import { Vector3 } from "../math/Vector3";
5
 
6
  class OrbitControls {
7
- // Vertical (polar) limits:
8
- minAngle: number = -90;
9
- maxAngle: number = 90;
10
- // New horizontal (azimuth) limits:
11
- minAzimuth: number = -180;
12
- maxAzimuth: number = 180;
13
  minZoom: number = 0.1;
14
  maxZoom: number = 30;
15
  orbitSpeed: number = 1;
@@ -128,7 +128,7 @@ class OrbitControls {
128
  } else {
129
  desiredAlpha -= dx * this.orbitSpeed * 0.003;
130
  desiredBeta += dy * this.orbitSpeed * 0.003;
131
- // Clamp the vertical angle (beta) for polar limits
132
  desiredBeta = Math.min(
133
  Math.max(desiredBeta, (this.minAngle * Math.PI) / 180),
134
  (this.maxAngle * Math.PI) / 180,
@@ -202,7 +202,7 @@ class OrbitControls {
202
 
203
  desiredAlpha -= dx * this.orbitSpeed * 0.003;
204
  desiredBeta += dy * this.orbitSpeed * 0.003;
205
- // Clamp the vertical (polar) angle (beta)
206
  desiredBeta = Math.min(
207
  Math.max(desiredBeta, (this.minAngle * Math.PI) / 180),
208
  (this.maxAngle * Math.PI) / 180,
@@ -250,7 +250,7 @@ class OrbitControls {
250
  // Horizontal (azimuth) rotation with 'e' and 'q'
251
  if (keys["KeyE"]) desiredAlpha += rotateSpeed;
252
  if (keys["KeyQ"]) desiredAlpha -= rotateSpeed;
253
- // Clamp desiredAlpha to new min/maxAzimuth limits
254
  desiredAlpha = Math.min(
255
  Math.max(desiredAlpha, (this.minAzimuth * Math.PI) / 180),
256
  (this.maxAzimuth * Math.PI) / 180
 
4
  import { Vector3 } from "../math/Vector3";
5
 
6
  class OrbitControls {
7
+ // Vertical (polar) limits: by default, free rotation.
8
+ minAngle: number = -Infinity;
9
+ maxAngle: number = Infinity;
10
+ // Horizontal (azimuth) limits: by default, free rotation.
11
+ minAzimuth: number = -Infinity;
12
+ maxAzimuth: number = Infinity;
13
  minZoom: number = 0.1;
14
  maxZoom: number = 30;
15
  orbitSpeed: number = 1;
 
128
  } else {
129
  desiredAlpha -= dx * this.orbitSpeed * 0.003;
130
  desiredBeta += dy * this.orbitSpeed * 0.003;
131
+ // Clamp vertical angle (beta) only if limits are finite
132
  desiredBeta = Math.min(
133
  Math.max(desiredBeta, (this.minAngle * Math.PI) / 180),
134
  (this.maxAngle * Math.PI) / 180,
 
202
 
203
  desiredAlpha -= dx * this.orbitSpeed * 0.003;
204
  desiredBeta += dy * this.orbitSpeed * 0.003;
205
+ // Clamp vertical (polar) angle (beta) if limits are finite
206
  desiredBeta = Math.min(
207
  Math.max(desiredBeta, (this.minAngle * Math.PI) / 180),
208
  (this.maxAngle * Math.PI) / 180,
 
250
  // Horizontal (azimuth) rotation with 'e' and 'q'
251
  if (keys["KeyE"]) desiredAlpha += rotateSpeed;
252
  if (keys["KeyQ"]) desiredAlpha -= rotateSpeed;
253
+ // Clamp horizontal angle (azimuth) only if limits are finite
254
  desiredAlpha = Math.min(
255
  Math.max(desiredAlpha, (this.minAzimuth * Math.PI) / 180),
256
  (this.maxAzimuth * Math.PI) / 180