@series-inc/rundot-3d-engine 0.5.15 → 0.5.19

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.
@@ -2562,7 +2562,9 @@ var DEFAULT_CONFIG = {
2562
2562
  shadowMapType: "vsm",
2563
2563
  toneMapping: "aces",
2564
2564
  toneMappingExposure: 1,
2565
- audioEnabled: true
2565
+ audioEnabled: true,
2566
+ cameraType: "perspective",
2567
+ orthoSize: 10
2566
2568
  };
2567
2569
  var VenusGame = class _VenusGame {
2568
2570
  // Static references for global access
@@ -2750,19 +2752,47 @@ var VenusGame = class _VenusGame {
2750
2752
  this.applyRenderingConfig();
2751
2753
  this.scene = new THREE7.Scene();
2752
2754
  this.scene.background = new THREE7.Color(this.config.backgroundColor);
2753
- this.camera = new THREE7.PerspectiveCamera(
2754
- 75,
2755
- // fov
2756
- window.innerWidth / window.innerHeight,
2757
- // aspect
2758
- 0.1,
2759
- // near
2760
- 1e3
2761
- // far
2762
- );
2755
+ if (this.config.cameraType === "orthographic") {
2756
+ const aspect = window.innerWidth / window.innerHeight;
2757
+ const size = this.config.orthoSize;
2758
+ this.camera = new THREE7.OrthographicCamera(
2759
+ -size * aspect,
2760
+ // left
2761
+ size * aspect,
2762
+ // right
2763
+ size,
2764
+ // top
2765
+ -size,
2766
+ // bottom
2767
+ 0.1,
2768
+ // near
2769
+ 1e3
2770
+ // far
2771
+ );
2772
+ } else {
2773
+ this.camera = new THREE7.PerspectiveCamera(
2774
+ 75,
2775
+ // fov
2776
+ window.innerWidth / window.innerHeight,
2777
+ // aspect
2778
+ 0.1,
2779
+ // near
2780
+ 1e3
2781
+ // far
2782
+ );
2783
+ }
2763
2784
  this.clock = new THREE7.Clock();
2764
2785
  this.resizeListener = () => {
2765
- this.camera.aspect = window.innerWidth / window.innerHeight;
2786
+ const aspect = window.innerWidth / window.innerHeight;
2787
+ if (this.camera instanceof THREE7.PerspectiveCamera) {
2788
+ this.camera.aspect = aspect;
2789
+ } else if (this.camera instanceof THREE7.OrthographicCamera) {
2790
+ const size = this.config.orthoSize;
2791
+ this.camera.left = -size * aspect;
2792
+ this.camera.right = size * aspect;
2793
+ this.camera.top = size;
2794
+ this.camera.bottom = -size;
2795
+ }
2766
2796
  this.camera.updateProjectionMatrix();
2767
2797
  this.renderer.setSize(window.innerWidth, window.innerHeight);
2768
2798
  let maxPixelRatio2;
@@ -6115,4 +6145,4 @@ export {
6115
6145
  PrefabLoader,
6116
6146
  StowKitSystem
6117
6147
  };
6118
- //# sourceMappingURL=chunk-JD4M2BHR.js.map
6148
+ //# sourceMappingURL=chunk-SQK4CPRB.js.map