import type { spec, Renderer } from '@galacean/effects'; import type { BaseTransform } from '../index'; import type { Quaternion, Euler, Vector3, Matrix4 } from './math'; import { PObjectType, PTransform, PCoordinate } from './common'; import type { PSceneManager } from './scene'; /** * 抽象对象类,提供公共的成员变量和成员函数 */ export declare abstract class PObject { /** * 名称 */ name: string; /** * 类型 */ type: PObjectType; /** * 销毁 */ dispose(): void; /** * 是否空对象 * @returns */ isNone(): boolean; /** * 是否有效,也就是类型不是 PObjectType.none * @returns */ isValid(): boolean; protected genName(name: string): string; } /** * 抽象实体类,支持可见性、变换和所属 VFX 元素 */ export declare abstract class PEntity extends PObject { private _visible; private _transform; /** * 是否删除 */ deleted: boolean; /** * 逻辑更新 */ update(): void; /** * 渲染对象 * @param scene - 场景管理器 * @param renderer 渲染器 */ render(scene: PSceneManager, renderer: Renderer): void; /** * 外部改变可见性时的回调 * @param visible - 可见性 */ onVisibleChanged(visible: boolean): void; /** * 仅标记不可见和删除状态,但不进行 WebGL 相关资源的释放 * 最终释放 WebGL 相关资源是在 plugin destroy 的时候 */ dispose(): void; /** * 获取可见性,如果实体非法也是不可见 */ get visible(): boolean; /** * 设置可见性 */ set visible(val: boolean); /** * 获取变换 */ get transform(): PTransform; /** * 设置变换,可以传入插件变换对象或变换参数 */ set transform(val: PTransform | BaseTransform); /** * 获取位移 */ get translation(): Vector3; /** * 设置位移 */ set translation(val: Vector3 | spec.vec3); /** * 获取位置 */ get position(): Vector3; /** * 设置位置 */ set position(val: Vector3 | spec.vec3); /** * 获取旋转 */ get rotation(): Quaternion; /** * 设置旋转 */ set rotation(val: Quaternion | Euler | Vector3 | spec.vec4 | spec.vec3); /** * 获取缩放 */ get scale(): Vector3; /** * 设置缩放 */ set scale(val: Vector3 | spec.vec3); /** * 获取矩阵 */ get matrix(): Matrix4; /** * 设置矩阵 */ set matrix(val: Matrix4); /** * 获取坐标系 */ get coordinate(): PCoordinate; }