Reaperxxxx commited on
Commit
7d4e86d
·
verified ·
1 Parent(s): 642a58c

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +3 -3
index.html CHANGED
@@ -352,9 +352,9 @@
352
  const cameraY = playerPos.y + cameraHeight + Math.sin(cameraRotation.x) * cameraDistance;
353
  const cameraZ = playerPos.z + Math.cos(cameraRotation.y) * cameraDistance * Math.cos(cameraRotation.x);
354
 
355
- // Clamp camera inside garage bounds - Try flipped bounds
356
- let clampedX = Math.max(-30, Math.min(30, cameraX));
357
- let clampedZ = Math.max(-30, Math.min(30, cameraZ));
358
  let clampedY = Math.max(0.3, Math.min(15, cameraY));
359
 
360
  camera.position.set(clampedX, clampedY, clampedZ);
 
352
  const cameraY = playerPos.y + cameraHeight + Math.sin(cameraRotation.x) * cameraDistance;
353
  const cameraZ = playerPos.z + Math.cos(cameraRotation.y) * cameraDistance * Math.cos(cameraRotation.x);
354
 
355
+ // Clamp camera inside garage bounds based on actual garage dimensions
356
+ let clampedX = Math.max(-2.2, Math.min(4, cameraX));
357
+ let clampedZ = Math.max(-4, Math.min(3.5, cameraZ));
358
  let clampedY = Math.max(0.3, Math.min(15, cameraY));
359
 
360
  camera.position.set(clampedX, clampedY, clampedZ);