@mml-io/3d-web-client-core 0.0.0-experimental-720f420-20240201 → 0.0.0-experimental-0d0c89d-20240206

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11,7 +11,7 @@ export declare class CameraManager {
11
11
  private minFOV;
12
12
  private maxFOV;
13
13
  private targetFOV;
14
- private minPolarAngle;
14
+ minPolarAngle: number;
15
15
  private maxPolarAngle;
16
16
  private dampingFactor;
17
17
  targetDistance: number;
package/build/index.js CHANGED
@@ -100,8 +100,8 @@ var CameraManager = class {
100
100
  this.maxDistance = 8;
101
101
  this.initialFOV = 60;
102
102
  this.fov = this.initialFOV;
103
- this.minFOV = 50;
104
- this.maxFOV = 70;
103
+ this.minFOV = 85;
104
+ this.maxFOV = 60;
105
105
  this.targetFOV = this.initialFOV;
106
106
  this.minPolarAngle = Math.PI * 0.25;
107
107
  this.maxPolarAngle = Math.PI * 0.95;
@@ -199,10 +199,12 @@ var CameraManager = class {
199
199
  this.fov = this.targetFOV;
200
200
  }
201
201
  adjustCameraPosition() {
202
- this.rayCaster.set(
203
- this.camera.position,
204
- this.target.clone().sub(this.camera.position).normalize()
205
- );
202
+ const offsetDistance = 0.5;
203
+ const offset = new Vector32(0, 0, offsetDistance);
204
+ offset.applyEuler(this.camera.rotation);
205
+ const rayOrigin = this.camera.position.clone().add(offset);
206
+ const rayDirection = this.target.clone().sub(rayOrigin).normalize();
207
+ this.rayCaster.set(rayOrigin, rayDirection);
206
208
  const firstRaycastHit = this.collisionsManager.raycastFirst(this.rayCaster.ray);
207
209
  const cameraToPlayerDistance = this.camera.position.distanceTo(this.target);
208
210
  if (firstRaycastHit !== null && firstRaycastHit[0] <= cameraToPlayerDistance) {