import * as THREE from "three";

/**
 * Local rendering layer.
 * Scene coordinate unit: reserved for future close-up detail.
 * Camera far plane covers immediate surroundings.
 * Currently empty — populated when local-space objects are introduced.
 */
export class LocalLayer {
  readonly scene = new THREE.Scene();
  readonly camera = new THREE.PerspectiveCamera(50, 1, 0.1, 2000);

  private static readonly ORIGIN = new THREE.Vector3(0, 0, 0);

  updateCamera(orbitOffset: THREE.Vector3) {
    this.camera.position.copy(orbitOffset);
    this.camera.lookAt(LocalLayer.ORIGIN);
  }

  onResize(aspect: number) {
    this.camera.aspect = aspect;
    this.camera.updateProjectionMatrix();
  }

  render(renderer: THREE.WebGLRenderer) {
    renderer.render(this.scene, this.camera);
  }
}
