var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  return value;
};
import { Scene, PerspectiveCamera, WebGLRenderer } from "../../../../../../../../node_modules/.pnpm/three@0.145.0/node_modules/three/build/three.module.mjs";
import { OrbitControls } from "../../../../../../../../node_modules/.pnpm/three@0.145.0/node_modules/three/examples/jsm/controls/OrbitControls.mjs";
class Basic {
  constructor(dom) {
    __publicField(this, "scene");
    __publicField(this, "camera");
    __publicField(this, "renderer");
    __publicField(this, "controls");
    __publicField(this, "dom");
    this.dom = dom;
    this.initScenes();
    this.setControls();
  }
  /**
   * 初始化场景
   */
  initScenes() {
    this.scene = new Scene();
    this.camera = new PerspectiveCamera(45, window.innerWidth / window.innerHeight, 1, 1e5);
    this.camera.position.set(0, 30, -250);
    this.renderer = new WebGLRenderer({
      // canvas: this.dom,
      alpha: true,
      // 透明
      antialias: true,
      // 抗锯齿
      preserveDrawingBuffer: true
    });
    this.renderer.setPixelRatio(window.devicePixelRatio);
    this.renderer.setSize(window.innerWidth, window.innerHeight);
    this.dom.appendChild(this.renderer.domElement);
  }
  /**
   * 设置控制器
   */
  setControls() {
    this.controls = new OrbitControls(this.camera, this.renderer.domElement);
    this.controls.autoRotateSpeed = 3;
    this.controls.enableDamping = true;
    this.controls.dampingFactor = 0.05;
    this.controls.enableZoom = true;
    this.controls.minDistance = 100;
    this.controls.maxDistance = 300;
    this.controls.enablePan = false;
  }
}
export {
  Basic
};
