import { DirectionalLight } from '@babylonjs/core/Lights/directionalLight';
import { ShadowGenerator } from '@babylonjs/core/Lights/Shadows/shadowGenerator';
import '@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent';
import { Vector3, Quaternion } from '@babylonjs/core/Maths/math.vector';
import { Monobehiver } from '../base/Monobehiver';
import { MeshBuilder } from '@babylonjs/core/Meshes/meshBuilder';
import { StandardMaterial } from '@babylonjs/core/Materials/standardMaterial';
import { Color3 } from '@babylonjs/core/Maths/math.color';
import { GizmoManager } from '@babylonjs/core/Gizmos/gizmoManager';
import { Mesh } from '@babylonjs/core/Meshes/mesh';

type DebugMarkers = {
    marker: Mesh;
    arrow: Mesh;
    gizmoManager: GizmoManager;
    onKey: (e: KeyboardEvent) => void;
};

/**
 * 灯光管理类- 负责创建和管理场景灯光
 */
export class AppLight extends Monobehiver {
    lightList: DirectionalLight[];
    shadowGenerator: ShadowGenerator | null;
    debugMarkers?: DebugMarkers;
    coneMesh?: Mesh;
    updateCone?: () => void;

    constructor(mainApp: any) {
        super(mainApp);
        this.lightList = [];
        this.shadowGenerator = null;
    }

    /** 初始化灯光并开启阴影 */
    Awake(): void {
        const light = new DirectionalLight(
            "mainLight",
            new Vector3(0, -0.5, -1),
        );
    }
}
