import type { ModelLightComponentData } from '../index'; import { Vector2, Vector3 } from './math'; import { PLightType } from './common'; import { PEntity } from './object'; import type { ModelLightComponent } from '../plugin/model-item'; /** * 灯光类,支持 3D 场景中的灯光功能 */ export declare class PLight extends PEntity { /** * 所属的灯光组件 */ owner?: ModelLightComponent; /** * 方向,仅用于方向光和聚光灯 */ direction: Vector3; /** * 范围,仅用于点光源和聚光灯 */ range: number; /** * 颜色 */ color: Vector3; /** * 强度 */ intensity: number; /** * 聚光灯外径 */ outerConeAngle: number; /** * 聚光灯内径 */ innerConeAngle: number; /** * 类型 */ lightType: PLightType; padding: Vector2; /** * 是否跟随相机 */ followCamera: boolean; /** * 创建灯光对象 * @param name - 灯光名称 * @param data - 灯光相关数据 * @param owner - 所属灯光组件 */ constructor(name: string, data: ModelLightComponentData, owner?: ModelLightComponent); /** * 更新灯光变换 */ update(): void; /** * 是否方向光 * @returns */ isDirectional(): boolean; /** * 是否点光源 * @returns */ isPoint(): boolean; /** * 是否聚光灯 * @returns */ isSpot(): boolean; /** * 是否环境光 * @returns */ isAmbient(): boolean; /** * 获取位置 */ get position(): Vector3; /** * 获取世界坐标中的位置 * @returns */ getWorldPosition(): Vector3; /** * 获取世界坐标中的方向 * @returns */ getWorldDirection(): Vector3; } /** * 灯光管理类,负责 3D 场景灯光的管理 */ export declare class PLightManager { /** * 灯光数组 */ lightList: PLight[]; constructor(); /** * 通过灯光参数,创建灯光对象,并保存到灯光数组中 * @param inLight - 灯光参数 * @param owner - 所属灯光组件 * @returns 插入的灯光对象 */ insertItem(name: string, inLight: ModelLightComponentData, owner?: ModelLightComponent): PLight; /** * 插入灯光对象 * @param inLight - 灯光对象 * @returns 插入的灯光对象 */ insertLight(inLight: PLight): PLight; /** * 删除灯光对象,从灯光数组中查找对象并进行删除,如果没有找到就忽略 * @param inLight - 删除的灯光对象 */ remove(inLight: PLight): void; /** * 销毁 */ dispose(): void; /** * 灯光数目 */ get lightCount(): number; }