Interface ISceneModule

interface ISceneModule {
    activeScene: ((_scene) => Promise<void>);
    addDefaultLights: ((scene?) => {});
    addScene: ((scene?, camera?) => Scene);
    envConfig: EnvConfigOption & {
        [key: string]: any;
    };
    getLoadedResources: (() => RosourceItemsReturnType);
    getSceneStatData: (() => {
        objects: number;
        triangles: number;
        vertices: number;
    });
    loadResources: ((_resources, options?) => Promise<RosourceItemsReturnType>);
    removeScene: ((_scene) => void);
    sceneEntity: Entity;
    setBackgroundEnvironment: ((options?) => Promise<void>);
    setEnvConfig: ((key, value) => void);
    setFocus: (() => void);
    clearScenes(): any;
    initScene(scene): any;
}

Implemented by

Properties

activeScene: ((_scene) => Promise<void>)

切换场景

Type declaration

    • (_scene): Promise<void>
    • 切换场景

      Parameters

      • _scene: Scene

      Returns Promise<void>

addDefaultLights: ((scene?) => {})

增加缺省灯光

Type declaration

    • (scene?): {}
    • 增加缺省灯光

      Parameters

      • Optional scene: Scene

      Returns {}

    addScene: ((scene?, camera?) => Scene)

    增加场景

    Type declaration

      • (scene?, camera?): Scene
      • 增加场景

        Parameters

        Returns Scene

    envConfig: EnvConfigOption & {
        [key: string]: any;
    }

    环境变量

    Type declaration

    • [key: string]: any
    getLoadedResources: (() => RosourceItemsReturnType)

    获取通过loadResources已加载的资源

    Type declaration

    getSceneStatData: (() => {
        objects: number;
        triangles: number;
        vertices: number;
    })

    获取场景的统计数据

    Type declaration

      • (): {
            objects: number;
            triangles: number;
            vertices: number;
        }
      • 获取场景的统计数据

        Returns {
            objects: number;
            triangles: number;
            vertices: number;
        }

        • objects: number

          物体对象数

        • triangles: number

          三角形数

        • vertices: number

          顶点数

    loadResources: ((_resources, options?) => Promise<RosourceItemsReturnType>)

    加载资源数组

    Type declaration

    removeScene: ((_scene) => void)

    移除场景

    Type declaration

      • (_scene): void
      • 移除场景

        Parameters

        • _scene: Scene

        Returns void

    sceneEntity: Entity

    场景实体

    setBackgroundEnvironment: ((options?) => Promise<void>)

    设置场景背景及环境参数

    Type declaration

    setEnvConfig: ((key, value) => void)

    设置环境变量

    Type declaration

      • (key, value): void
      • 设置环境变量

        Parameters

        Returns void

    setFocus: (() => void)

    获取焦点

    Type declaration

      • (): void
      • 获取焦点

        Returns void

    Methods

    • 清空所有场景

      Returns any

    • 初始化场景

      Parameters

      • scene: Scene

      Returns any