Class App

事件派发管理

Hierarchy (view full)

Implements

Constructors

Properties

Input _modules actionDrawEdit actionDrawLineSting actionDrawPoint actionDrawPolygon actionPickSelect activeScene addAllCommands addBloomEntity addCollideRectObject addCommand addControl addDefaultLights addEffectRenderPass addManyCommands addOutlineEntity addParticle addParticleSystem addPhysicsBody addPhysicsGround addPointerEventsObject addScene addSelectedEntity addTool bloomEffect centerOrigin clearCommands clearScenes commandHistory commonUniforms composer containerSize css2dRenderer css3dOccludeRenderer css3dRenderer data drawSelectBox enableCameraControl enableCameraControlRef enablePhysicsEngine enableWheelWhenCtrlDisabled envConfig executeAllCommands executeCommand executeManyCommands getBloomObjects getBloomObjectsRef getConfigPane getCurrentTool getCurrentToolId getDepth getDrawLayer getEntities getLoadedResources getMarker2Ds getOutlineObjects getOutlineObjectsRef getPopup2Ds getQueryRaycaster getRayByScreenPos getRayQueryEntities getSceneStatData getScreenshot getSelectObjects getSelectObjectsRef getStateDescendant getStatePath hasControl initScene isApp isComposerEnable isFreeStatus isFreeStatusRef isInActiveTool isInteracting isMapMode isPostProcessIdle loadParticle loadParticleFromRes loadResources logInfo mapViewEntity moduleManager ndcToScreen needRenderUpdate options outlineEffect particleRenderer physicsEnable physicsEngine physicsWorld pickEntity pickPoint popup2d project queryEntitiesByBox queryEntitiesByCamera queryEntitiesByRaycast queryEntitiesByScreenPos redo refreshEffectRenderPass removeBloomEntity removeCollideRectObject removeControl removeEffectRenderPass removeOutlineEntity removeParticle removePhysicsObject removePointerEventsObject removeScene removeSelectEntity removeTool renderer rootState scaleOrigin sceneEntity screenToNdc selectedEffect setBackgroundEnvironment setCameraLookAt setCollideRectDirty setComposerEnable setCss3dObjectCanOcclude setCurrentTool setCursor setEnvConfig setFocus setMenu setPhysicsDebugger setSelectBoomRefreshFlag showStat signal stateInAny stateIsIn svc transformObject tweenManager undo unproject unprojectAsync updateCollideRect viewHelperEnable defaultModules registerModules

Accessors

Methods

Constructors

Properties

Input: {
    closestObject: (() => InteractiveObject);
    enabled: (() => boolean);
    enabledRef: (() => Ref<boolean>);
    getKeyDown: ((keyCode) => boolean);
    getKeyPressed: ((keyCode) => boolean);
    getKeyUp: ((keyCode) => boolean);
    isDragging: (() => boolean);
    isLeftButtonDown: (() => boolean);
    isLeftButtonPressed: (() => boolean);
    isLeftButtonUp: (() => boolean);
    isMidButtonDown: (() => boolean);
    isMidButtonPressed: (() => boolean);
    isMidButtonUp: (() => boolean);
    isMoving: (() => boolean);
    isRightButtonDown: (() => boolean);
    isRightButtonPressed: (() => boolean);
    isRightButtonUp: (() => boolean);
    movementX: (() => number);
    movementY: (() => number);
    setEnable: ((b) => {});
    x: (() => number);
    y: (() => number);
}

Type declaration

  • closestObject: (() => InteractiveObject)

    当前离鼠标最近的物体实体

  • enabled: (() => boolean)
      • (): boolean
      • Returns boolean

  • enabledRef: (() => Ref<boolean>)

    是否可用的响应式对象

      • (): Ref<boolean>
      • 是否可用的响应式对象

        Returns Ref<boolean>

  • getKeyDown: ((keyCode) => boolean)

    获取键是否开始按下 exam: getKeyDown("KeyW")

      • (keyCode): boolean
      • 获取键是否开始按下 exam: getKeyDown("KeyW")

        Parameters

        • keyCode: string

        Returns boolean

  • getKeyPressed: ((keyCode) => boolean)

    获取键是否按住 如 Space Enter ShiftLeft ControlLeft

      • (keyCode): boolean
      • 获取键是否按住 如 Space Enter ShiftLeft ControlLeft

        Parameters

        • keyCode: string

        Returns boolean

  • getKeyUp: ((keyCode) => boolean)

    获取键是否松开

      • (keyCode): boolean
      • 获取键是否松开

        Parameters

        • keyCode: string

        Returns boolean

  • isDragging: (() => boolean)
      • (): boolean
      • Returns boolean

  • isLeftButtonDown: (() => boolean)
      • (): boolean
      • Returns boolean

  • isLeftButtonPressed: (() => boolean)
      • (): boolean
      • Returns boolean

  • isLeftButtonUp: (() => boolean)
      • (): boolean
      • Returns boolean

  • isMidButtonDown: (() => boolean)
      • (): boolean
      • Returns boolean

  • isMidButtonPressed: (() => boolean)
      • (): boolean
      • Returns boolean

  • isMidButtonUp: (() => boolean)
      • (): boolean
      • Returns boolean

  • isMoving: (() => boolean)
      • (): boolean
      • Returns boolean

  • isRightButtonDown: (() => boolean)
      • (): boolean
      • Returns boolean

  • isRightButtonPressed: (() => boolean)
      • (): boolean
      • Returns boolean

  • isRightButtonUp: (() => boolean)
      • (): boolean
      • Returns boolean

  • movementX: (() => number)
      • (): number
      • Returns number

  • movementY: (() => number)
      • (): number
      • Returns number

  • setEnable: ((b) => {})
      • (b): {}
      • Parameters

        • b: boolean

        Returns {}

    • x: (() => number)
        • (): number
        • Returns number

    • y: (() => number)
        • (): number
        • Returns number

    _modules: ModuleBase[] = []
    actionDrawEdit: ((opts?) => Promise<{}>)

    Type declaration

    actionDrawLineSting: ((opts?) => Promise<{
        data: PolylineItemData;
        isCancel?: boolean;
    }>)

    绘制一条线,获取线坐标

    Type declaration

    actionDrawPoint: ((opts?) => Promise<{
        data: SymbolItemData;
        isCancel?: boolean;
    }>)

    绘制一个点,获取点坐标

    Type declaration

    actionDrawPolygon: ((opts?) => Promise<{
        data: PolygonItemData;
        isCancel?: boolean;
    }>)

    绘制一个多边形,获取多边形坐标

    Type declaration

    actionPickSelect: ((opts?) => Promise<{
        info?: TLEventHandler;
        isCancel: boolean;
        select?: InteractiveObject;
    }>)

    选中一个实体对象

    Type declaration

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

    切换场景

    Type declaration

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

        Parameters

        • _scene: Scene

        Returns Promise<void>

    addAllCommands: ((cmds) => void)

    增加所有命令,不会自动执行

    Type declaration

      • (cmds): void
      • 增加所有命令,不会自动执行

        Parameters

        Returns void

    addBloomEntity: ((ent) => {})

    Type declaration

      • (ent): {}
      • Parameters

        Returns {}

      addCollideRectObject: ((item) => void)

      增加碰撞检测的对象

      Type declaration

        • (item): void
        • 增加碰撞检测的对象

          Parameters

          Returns void

      addCommand: ((cmd) => void)

      增加命令,不会自动执行

      Type declaration

        • (cmd): void
        • 增加命令,不会自动执行

          Parameters

          Returns void

      addControl: ((control, position?) => App)

      增加控件 (会调用 control.onAdd(this) ).

      Type declaration

        • (control, position?): App
        • 增加控件 (会调用 control.onAdd(this) ).

          Parameters

          • control: IControl

            需要增加的控件.

          • Optional position: ControlPosition

            位置. 'top-left', 'top-right', 'bottom-left', and 'bottom-right'. Defaults to 'top-right'`

          Returns App

      Param: control

      需要增加的控件.

      Param: position

      位置. 'top-left', 'top-right', 'bottom-left', and 'bottom-right'. Defaults to 'top-right'`

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

      增加缺省灯光

      Type declaration

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

          Parameters

          • Optional scene: Scene

          Returns {}

        addEffectRenderPass: ((pass, orderIndex?) => void)

        给效果合成器增加渲染通道

        Type declaration

          • (pass, orderIndex?): void
          • 给效果合成器增加渲染通道

            Parameters

            • pass: Pass
            • Optional orderIndex: number

            Returns void

        addManyCommands: ((...cmds) => void)

        增加多个命令,不会自动执行

        Type declaration

          • (...cmds): void
          • 增加多个命令,不会自动执行

            Parameters

            Returns void

        addOutlineEntity: ((ent) => {})

        Type declaration

          • (ent): {}
          • Parameters

            Returns {}

          addParticle: ((opts) => ParticleEmitter<Object3DEventMap>)

          增加粒子

          Type declaration

            • (opts): ParticleEmitter<Object3DEventMap>
            • 增加粒子

              Parameters

              • opts: {
                    disposeWhenEnd?: boolean;
                    name?: string;
                    parent?: Object3D<Object3DEventMap>;
                    position?: [number, number, number] | Vector3;
                    rotation?: [number, number, number] | Vector3;
                    scale?: number | [number, number, number] | Vector3;
                    simulations?: Simulation | Simulation[];
                    system: ParticleSystemParameters;
                }
                • Optional disposeWhenEnd?: boolean

                  当结束时自动删除,默认为true

                • Optional name?: string

                  名称

                • Optional parent?: Object3D<Object3DEventMap>

                  parent 为null时,将不加入场景,如不填或undefined,则加入场景,如指定parent,则加至此parent节点中

                • Optional position?: [number, number, number] | Vector3

                  位置

                • Optional rotation?: [number, number, number] | Vector3

                  旋转

                • Optional scale?: number | [number, number, number] | Vector3

                  缩放

                • Optional simulations?: Simulation | Simulation[]

                  粒子模拟行为

                • system: ParticleSystemParameters

                  粒子系统参数

              Returns ParticleEmitter<Object3DEventMap>

          addParticleSystem: ((system, parent?, disposeWhenEnd?) => void)

          增加粒子系统

          Type declaration

            • (system, parent?, disposeWhenEnd?): void
            • 增加粒子系统

              Parameters

              • system: IParticleSystem

                粒子系统参数

              • Optional parent: Object3D<Object3DEventMap>

                parent 为null时,将不加入场景,如不填或undefined,则加入场景,如指定parent,则加至此parent节点中

              • Optional disposeWhenEnd: boolean

                当结束时自动删除,默认为true

              Returns void

          Param: system

          粒子系统参数

          Param: parent

          parent 为null时,将不加入场景,如不填或undefined,则加入场景,如指定parent,则加至此parent节点中

          Param: disposeWhenEnd

          当结束时自动删除,默认为true

          Returns

          addPhysicsBody: ((phyObject) => MeshPhysicsObjectParams)

          增加物理刚体

          Type declaration

          addPhysicsGround: (() => Plane)

          增加一个物理地面

          Type declaration

          addPointerEventsObject: ((entity) => {})

          Type declaration

            • (entity): {}
            • Parameters

              Returns {}

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

            增加场景

            Type declaration

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

                Parameters

                Returns Scene

            addSelectedEntity: ((ent) => {})

            Type declaration

              • (ent): {}
              • Parameters

                Returns {}

              addTool: ((Tool) => void)

              Type declaration

              bloomEffect

              centerOrigin: Vector3

              设置的中心点坐标

              clearCommands: (() => void)

              清空命令

              Type declaration

                • (): void
                • 清空命令

                  Returns void

              clearScenes: (() => void)

              清空所有场景

              Type declaration

                • (): void
                • 清空所有场景

                  Returns void

              commandHistory: CommandHistory
              commonUniforms: {
                  iChannelTime: Uniform<[number, number, number, number]>;
                  iDate: Uniform<Vector4>;
                  iFrame: Uniform<number>;
                  iGlobalTime: Uniform<number>;
                  iMouse: Uniform<Vector4>;
                  iResolution: Uniform<Vector3>;
                  iSampleRate: Uniform<number>;
                  iTime: Uniform<number>;
                  iTimeDelta: Uniform<number>;
                  resolution: Uniform<Vector2>;
                  time: Uniform<Vector4>;
              }

              Type declaration

              • iChannelTime: Uniform<[number, number, number, number]>
              • iDate: Uniform<Vector4>
              • iFrame: Uniform<number>
              • iGlobalTime: Uniform<number>
              • iMouse: Uniform<Vector4>
              • iResolution: Uniform<Vector3>
              • iSampleRate: Uniform<number>
              • iTime: Uniform<number>
              • iTimeDelta: Uniform<number>
              • resolution: Uniform<Vector2>
              • time: Uniform<Vector4>
              composer: EffectComposer

              效果合成器

              containerSize: {
                  height: number;
                  width: number;
              } = ...

              Type declaration

              • height: number
              • width: number
              css2dRenderer: CSS2DRenderer

              2d渲染器

              css3dOccludeRenderer: CSS3DRenderer

              能遮挡的css3d渲染器

              css3dRenderer: CSS3DRenderer

              css3d渲染器

              data: ShallowReactive<{
                  camera?: Camera;
                  container?: HTMLElement;
                  domElement?: HTMLElement;
                  scene?: Scene;
                  [key: string]: any;
              }> = ...

              Type declaration

              • [key: string]: any
              • Optional camera?: Camera
              • Optional container?: HTMLElement
              • Optional domElement?: HTMLElement
              • Optional scene?: Scene
              drawSelectBox: ((style?) => Promise<[Vector2, Vector2] | {
                  cancel: boolean;
                  reason?: string;
              }>)

              绘制一个选择框

              Type declaration

                • (style?): Promise<[Vector2, Vector2] | {
                      cancel: boolean;
                      reason?: string;
                  }>
                • 绘制一个选择框

                  Parameters

                  • Optional style: Record<string, any>

                  Returns Promise<[Vector2, Vector2] | {
                      cancel: boolean;
                      reason?: string;
                  }>

              enableCameraControl: boolean

              是否启用相机控制器

              enableCameraControlRef: Ref<boolean>

              相机控制器响应式对象

              enablePhysicsEngine: (() => Promise<CANNON>)

              启动物体引擎

              Type declaration

                • (): Promise<CANNON>
                • 启动物体引擎

                  Returns Promise<CANNON>

              enableWheelWhenCtrlDisabled: boolean

              当相机禁止时还允许滚轮进行缩放操作

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

              环境变量

              Type declaration

              • [key: string]: any
              executeAllCommands: ((cmds) => void)

              执行所有命令,自动执行

              Type declaration

                • (cmds): void
                • 执行所有命令,自动执行

                  Parameters

                  Returns void

              executeCommand: ((cmd) => void)

              执行命令,自动执行

              Type declaration

                • (cmd): void
                • 执行命令,自动执行

                  Parameters

                  Returns void

              executeManyCommands: ((...cmds) => void)

              执行多个命令,自动执行

              Type declaration

                • (...cmds): void
                • 执行多个命令,自动执行

                  Parameters

                  Returns void

              getBloomObjects: (() => Object3D<Object3DEventMap>[])

              Type declaration

                • (): Object3D<Object3DEventMap>[]
                • Returns Object3D<Object3DEventMap>[]

              getBloomObjectsRef: (() => ShallowReactive<Object3D<Object3DEventMap>[]>)

              Type declaration

              getConfigPane: ((opts?) => Promise<{
                  appendChild: ((config?, params?) => any);
                  configPane: any;
                  element: HTMLElement;
                  isInit: boolean;
                  isVisible: (() => boolean);
                  renderUiConfig: ((uiConfig) => void);
                  renderUiObject: ((uiConfig, parent?) => any);
                  reset: (() => void);
                  rootPane: any;
                  setVisible: ((b) => void);
              }>)

              获取配置面板

              Type declaration

                • (opts?): Promise<{
                      appendChild: ((config?, params?) => any);
                      configPane: any;
                      element: HTMLElement;
                      isInit: boolean;
                      isVisible: (() => boolean);
                      renderUiConfig: ((uiConfig) => void);
                      renderUiObject: ((uiConfig, parent?) => any);
                      reset: (() => void);
                      rootPane: any;
                      setVisible: ((b) => void);
                  }>
                • 获取配置面板

                  Parameters

                  • Optional opts: {
                        isReset?: boolean;
                        style?: Partial<CSSStyleDeclaration>;
                        title?: string;
                    }
                    • Optional isReset?: boolean

                      是否清空,默认是

                    • Optional style?: Partial<CSSStyleDeclaration>

                      样式

                    • Optional title?: string

                      标题

                  Returns Promise<{
                      appendChild: ((config?, params?) => any);
                      configPane: any;
                      element: HTMLElement;
                      isInit: boolean;
                      isVisible: (() => boolean);
                      renderUiConfig: ((uiConfig) => void);
                      renderUiObject: ((uiConfig, parent?) => any);
                      reset: (() => void);
                      rootPane: any;
                      setVisible: ((b) => void);
                  }>

              getCurrentTool: (() => StateNode)

              Type declaration

              getCurrentToolId: (() => string)

              Type declaration

                • (): string
                • Returns string

              getDepth: ((x, y) => Promise<number>)

              根据屏幕坐标获取深度值

              Type declaration

                • (x, y): Promise<number>
                • 根据屏幕坐标获取深度值

                  Parameters

                  • x: number
                  • y: number

                  Returns Promise<number>

              getDrawLayer: ((layerName?, noCreateStyle?) => {
                  addPointData: ((data, addToCommand?) => SymbolEntity);
                  addPolygonData: ((data, addToCommand?) => PolygonsEntity);
                  addPolylineData: ((data, addToCommand?) => PolylinesEntity);
                  deletePointData: ((data, addToCommand?) => boolean);
                  deletePolygonData: ((data, addToCommand?) => boolean);
                  deletePolylineData: ((data, addToCommand?) => boolean);
                  polygons: (() => PolygonsEntity);
                  polylines: (() => PolylinesEntity);
                  symbol: (() => SymbolEntity);
                  updatePointData: ((data, addToCommand?) => boolean);
                  updatePolygonData: ((data, addToCommand?) => boolean);
                  updatePolylineData: ((data, addToCommand?) => boolean);
              })

              通过图层名称获取当前绘图层的实体

              Type declaration

                • (layerName?, noCreateStyle?): {
                      addPointData: ((data, addToCommand?) => SymbolEntity);
                      addPolygonData: ((data, addToCommand?) => PolygonsEntity);
                      addPolylineData: ((data, addToCommand?) => PolylinesEntity);
                      deletePointData: ((data, addToCommand?) => boolean);
                      deletePolygonData: ((data, addToCommand?) => boolean);
                      deletePolylineData: ((data, addToCommand?) => boolean);
                      polygons: (() => PolygonsEntity);
                      polylines: (() => PolylinesEntity);
                      symbol: (() => SymbolEntity);
                      updatePointData: ((data, addToCommand?) => boolean);
                      updatePolygonData: ((data, addToCommand?) => boolean);
                      updatePolylineData: ((data, addToCommand?) => boolean);
                  }
                • 通过图层名称获取当前绘图层的实体

                  Parameters

                  • Optional layerName: string
                  • Optional noCreateStyle: Record<string, any>

                  Returns {
                      addPointData: ((data, addToCommand?) => SymbolEntity);
                      addPolygonData: ((data, addToCommand?) => PolygonsEntity);
                      addPolylineData: ((data, addToCommand?) => PolylinesEntity);
                      deletePointData: ((data, addToCommand?) => boolean);
                      deletePolygonData: ((data, addToCommand?) => boolean);
                      deletePolylineData: ((data, addToCommand?) => boolean);
                      polygons: (() => PolygonsEntity);
                      polylines: (() => PolylinesEntity);
                      symbol: (() => SymbolEntity);
                      updatePointData: ((data, addToCommand?) => boolean);
                      updatePolygonData: ((data, addToCommand?) => boolean);
                      updatePolylineData: ((data, addToCommand?) => boolean);
                  }

              getEntities: (() => Entity[])

              Type declaration

              getLoadedResources: (() => RosourceItemsReturnType)

              获取通过loadResources已加载的资源

              Type declaration

              getMarker2Ds: (() => Marker2D[])

              获取所有的marker2d

              Type declaration

              getOutlineObjects: (() => Object3D<Object3DEventMap>[])

              Type declaration

                • (): Object3D<Object3DEventMap>[]
                • Returns Object3D<Object3DEventMap>[]

              getOutlineObjectsRef: (() => ShallowReactive<Object3D<Object3DEventMap>[]>)

              Type declaration

              getPopup2Ds: (() => Popup2D[])

              获取所有的popup2d

              Type declaration

              getQueryRaycaster: (() => Raycaster)

              获取查询的射线对象

              Type declaration

                • (): Raycaster
                • 获取查询的射线对象

                  Returns Raycaster

              getRayByScreenPos: ((x, y, camera?) => Ray)

              通过屏幕坐标获取射线

              Type declaration

                • (x, y, camera?): Ray
                • 通过屏幕坐标获取射线

                  Parameters

                  • x: number
                  • y: number
                  • Optional camera: Camera

                  Returns Ray

              getRayQueryEntities: (() => Entity[])

              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

                    顶点数

              getScreenshot: ((params?) => Promise<Blob>)

              获取渲染截图

              Type declaration

                • (params?): Promise<Blob>
                • 获取渲染截图

                  Parameters

                  Returns Promise<Blob>

              getSelectObjects: (() => Object3D<Object3DEventMap>[])

              Type declaration

                • (): Object3D<Object3DEventMap>[]
                • Returns Object3D<Object3DEventMap>[]

              getSelectObjectsRef: (() => ShallowReactive<Object3D<Object3DEventMap>[]>)

              Type declaration

              getStateDescendant: (<T>(path) => T)

              Type declaration

                • <T>(path): T
                • Type Parameters

                  Parameters

                  • path: string

                  Returns T

              getStatePath: (() => string)

              Type declaration

                • (): string
                • Returns string

              hasControl: ((control) => void)

              是否有控件.

              Type declaration

                • (control): void
                • 是否有控件.

                  Parameters

                  Returns void

              Param: control

              要查询的控件.

              initScene: ((scene) => void)

              初始化场景

              Type declaration

                • (scene): void
                • 初始化场景

                  Parameters

                  • scene: Scene

                  Returns void

              isApp: boolean = true
              isComposerEnable: (() => boolean)

              效果合成器是否可用

              Type declaration

                • (): boolean
                • 效果合成器是否可用

                  Returns boolean

              isFreeStatus: boolean

              当前应该是否处于自由状态

              isFreeStatusRef: Ref<boolean>

              自由状态响应式对象

              isInActiveTool: (() => boolean)

              判断当前是否有工具处于运行中

              Type declaration

                • (): boolean
                • 判断当前是否有工具处于运行中

                  Returns boolean

              isInteracting: (() => boolean)

              是否正在交互

              Type declaration

                • (): boolean
                • 是否正在交互

                  Returns boolean

              isMapMode: boolean

              地图模式

              isPostProcessIdle: boolean

              后期处理是否空闲

              loadParticle: ((url, opts?) => Promise<ParticleEmitter<Object3DEventMap>>)

              从文件加载粒子场景

              Type declaration

                • (url, opts?): Promise<ParticleEmitter<Object3DEventMap>>
                • 从文件加载粒子场景

                  Parameters

                  • url: string
                  • Optional opts: {
                        crossOrigin?: string;
                        disposeWhenEnd?: boolean;
                        name?: string;
                        onAddSystem?: ((object, system) => any);
                        onData?: ((data) => any);
                        parent?: Object3D<Object3DEventMap>;
                        position?: [number, number, number] | Vector3;
                        requestHeader?: {
                            [header: string]: string;
                        };
                        resourcePath?: string;
                        rotation?: [number, number, number] | Vector3;
                        scale?: number | [number, number, number] | Vector3;
                        simulations?: Simulation | Simulation[];
                        system?: ParticleSystemParameters;
                        urlPath?: string;
                        withCredentials?: boolean;
                    }
                    • Optional crossOrigin?: string
                    • Optional disposeWhenEnd?: boolean

                      当结束时自动删除,默认为true

                    • Optional name?: string

                      名称

                    • Optional onAddSystem?: ((object, system) => any)

                      加载粒子系统前回调

                        • (object, system): any
                        • 加载粒子系统前回调

                          Parameters

                          Returns any

                    • Optional onData?: ((data) => any)

                      加载完json的回调 可对json进行修改

                        • (data): any
                        • 加载完json的回调 可对json进行修改

                          Parameters

                          • data: any

                          Returns any

                    • Optional parent?: Object3D<Object3DEventMap>

                      parent 为null时,将不加入场景,如不填或undefined,则加入场景,如指定parent,则加至此parent节点中

                    • Optional position?: [number, number, number] | Vector3

                      位置

                    • Optional requestHeader?: {
                          [header: string]: string;
                      }
                      • [header: string]: string
                    • Optional resourcePath?: string
                    • Optional rotation?: [number, number, number] | Vector3

                      旋转

                    • Optional scale?: number | [number, number, number] | Vector3

                      缩放

                    • Optional simulations?: Simulation | Simulation[]

                      粒子模拟行为

                    • Optional system?: ParticleSystemParameters

                      粒子系统参数

                    • Optional urlPath?: string
                    • Optional withCredentials?: boolean

                  Returns Promise<ParticleEmitter<Object3DEventMap>>

              loadParticleFromRes: ((obj, opts?) => ParticleEmitter<Object3DEventMap>)

              从资源加载粒子场景

              Type declaration

                • (obj, opts?): ParticleEmitter<Object3DEventMap>
                • 从资源加载粒子场景

                  Parameters

                  • obj: Object3D<Object3DEventMap>
                  • Optional opts: {
                        disposeWhenEnd?: boolean;
                        name?: string;
                        onAddSystem?: ((object, system) => any);
                        parent?: Object3D<Object3DEventMap>;
                        position?: [number, number, number] | Vector3;
                        rotation?: [number, number, number] | Vector3;
                        scale?: number | [number, number, number] | Vector3;
                        simulations?: Simulation | Simulation[];
                        system?: ParticleSystemParameters;
                    }
                    • Optional disposeWhenEnd?: boolean

                      当结束时自动删除,默认为true

                    • Optional name?: string

                      名称

                    • Optional onAddSystem?: ((object, system) => any)

                      加载粒子系统前回调

                        • (object, system): any
                        • 加载粒子系统前回调

                          Parameters

                          Returns any

                    • Optional parent?: Object3D<Object3DEventMap>

                      parent 为null时,将不加入场景,如不填或undefined,则加入场景,如指定parent,则加至此parent节点中

                    • Optional position?: [number, number, number] | Vector3

                      位置

                    • Optional rotation?: [number, number, number] | Vector3

                      旋转

                    • Optional scale?: number | [number, number, number] | Vector3

                      缩放

                    • Optional simulations?: Simulation | Simulation[]

                      粒子模拟行为

                    • Optional system?: ParticleSystemParameters

                      粒子系统参数

                  Returns ParticleEmitter<Object3DEventMap>

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

              加载资源数组

              Type declaration

              logInfo: ((text, type?, time?) => void)

              信息弹窗提示 text(必填):需要输出的文本 type(可选):输出类型 默认是 "log" time(可选):停留时间 默认是 2500

              Type declaration

                • (text, type?, time?): void
                • 信息弹窗提示 text(必填):需要输出的文本 type(可选):输出类型 默认是 "log" time(可选):停留时间 默认是 2500

                  Parameters

                  • text: string
                  • Optional type: number | logInfoType
                  • Optional time: number

                  Returns void

              mapViewEntity: MapViewEntity

              三维场景中地图实体

              moduleManager: ModuleManager = ...
              ndcToScreen: ((x, y?) => Vector2)

              NDC坐标转屏幕坐标

              Type declaration

                • (x, y?): Vector2
                • NDC坐标转屏幕坐标

                  Parameters

                  • x: number | Vector2
                  • Optional y: number

                  Returns Vector2

              needRenderUpdate: boolean = true
              outlineEffect: OutlineEffect

              OutlineEffect

              particleRenderer: BatchedRenderer
              physicsEnable: boolean

              是否能用物理引擎

              physicsEngine: CANNON

              得到物理引擎对象

              physicsWorld: World

              得到物理引擎世界对象

              pickEntity: ((opts?) => Promise<{
                  cancel: boolean;
                  clearHighlight: Function;
                  entities: Entity[];
                  reason?: string;
              }>)

              拾取实体

              Type declaration

                • (opts?): Promise<{
                      cancel: boolean;
                      clearHighlight: Function;
                      entities: Entity[];
                      reason?: string;
                  }>
                • 拾取实体

                  Parameters

                  Returns Promise<{
                      cancel: boolean;
                      clearHighlight: Function;
                      entities: Entity[];
                      reason?: string;
                  }>

              pickPoint: ((opts?) => Promise<{
                  cancel: boolean;
                  event?: InteractiveEvent;
                  intersectObject?: any;
                  point?: Vector3;
                  reason?: string;
              }>)

              拾取一个点

              Type declaration

                • (opts?): Promise<{
                      cancel: boolean;
                      event?: InteractiveEvent;
                      intersectObject?: any;
                      point?: Vector3;
                      reason?: string;
                  }>
                • 拾取一个点

                  Parameters

                  Returns Promise<{
                      cancel: boolean;
                      event?: InteractiveEvent;
                      intersectObject?: any;
                      point?: Vector3;
                      reason?: string;
                  }>

              popup2d: Popup2D

              全局的popup对象

              project: ((x, y?, z?) => Vector2)

              世界坐标转屏幕坐标

              Type declaration

                • (x, y?, z?): Vector2
                • 世界坐标转屏幕坐标

                  Parameters

                  • x: number | Vector3
                  • Optional y: number
                  • Optional z: number

                  Returns Vector2

              queryEntitiesByBox: ((startPoint, endPoint, option?, deep?) => InteractiveObject[])

              通过框选查询实体

              Type declaration

              queryEntitiesByCamera: ((option?) => InteractiveObject)

              通过相机查询实体

              Type declaration

              queryEntitiesByRaycast: ((ray, option?) => InteractiveObject)

              通过射线查询实体

              Type declaration

              queryEntitiesByScreenPos: ((x, y, option?) => InteractiveObject)

              通过屏幕像素坐标查询实体

              Type declaration

              redo: (() => any)

              还原

              Type declaration

                • (): any
                • 还原

                  Returns any

              refreshEffectRenderPass: ((foreceUpdate?) => void)

              刷新渲染通道 foreceUpdate是否强制更新

              Type declaration

                • (foreceUpdate?): void
                • 刷新渲染通道 foreceUpdate是否强制更新

                  Parameters

                  • Optional foreceUpdate: boolean

                  Returns void

              removeBloomEntity: ((ent) => {})

              Type declaration

                • (ent): {}
                • Parameters

                  Returns {}

                removeCollideRectObject: ((item) => void)

                移除碰撞检测的对象

                Type declaration

                  • (item): void
                  • 移除碰撞检测的对象

                    Parameters

                    Returns void

                removeControl: ((control) => App)

                移除控件.

                Type declaration

                  • (control): App
                  • 移除控件.

                    Parameters

                    Returns App

                Param: control

                要移除的控件.

                removeEffectRenderPass: ((pass) => void)

                给效果合成器移除渲染通道

                Type declaration

                  • (pass): void
                  • 给效果合成器移除渲染通道

                    Parameters

                    Returns void

                removeOutlineEntity: ((ent) => {})

                Type declaration

                  • (ent): {}
                  • Parameters

                    Returns {}

                  removeParticle: ((obj) => void)

                  移除粒子系统

                  Type declaration

                    • (obj): void
                    • 移除粒子系统

                      Parameters

                      Returns void

                  removePhysicsObject: ((object) => void)

                  通过实体或对象移除物理刚体

                  Type declaration

                    • (object): void
                    • 通过实体或对象移除物理刚体

                      Parameters

                      • object: Object3D<Object3DEventMap> | Entity

                      Returns void

                  removePointerEventsObject: ((entity) => {})

                  Type declaration

                    • (entity): {}
                    • Parameters

                      Returns {}

                    removeScene: ((_scene) => void)

                    移除场景

                    Type declaration

                      • (_scene): void
                      • 移除场景

                        Parameters

                        • _scene: Scene

                        Returns void

                    removeSelectEntity: ((ent) => {})

                    Type declaration

                      • (ent): {}
                      • Parameters

                        Returns {}

                      removeTool: ((Tool) => void)

                      Type declaration

                      renderer: WebGLRenderer

                      渲染器

                      rootState: StateNode
                      scaleOrigin: number

                      开始缩放比例,x,y,z方向都同比例缩放,默认1

                      sceneEntity: Entity

                      场景实体

                      screenToNdc: ((x, y?) => Vector2)

                      屏幕坐标转NDC坐标

                      Type declaration

                        • (x, y?): Vector2
                        • 屏幕坐标转NDC坐标

                          Parameters

                          • x: number | Vector2
                          • Optional y: number

                          Returns Vector2

                      selectedEffect: OutlineEffect

                      selectedEffect

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

                      设置场景背景及环境参数

                      Type declaration

                      setCameraLookAt: ((position, lookAt, options?) => void)

                      设置相机朝向

                      Type declaration

                        • (position, lookAt, options?): void
                        • 设置相机朝向

                          Parameters

                          • position: Vector3

                            相机位置

                          • lookAt: Vector3

                            朝向

                          • Optional options: boolean | Record<string, any>

                            选项

                          Returns void

                      Param: position

                      相机位置

                      Param: lookAt

                      朝向

                      Param: options

                      选项

                      setCollideRectDirty: (() => void)

                      设置更新碰撞检测为脏数据,使其重新检测

                      Type declaration

                        • (): void
                        • 设置更新碰撞检测为脏数据,使其重新检测

                          Returns void

                      setComposerEnable: ((b) => void)

                      设置效果合成器是否可用

                      Type declaration

                        • (b): void
                        • 设置效果合成器是否可用

                          Parameters

                          • b: boolean

                          Returns void

                      setCss3dObjectCanOcclude: ((object, canOcclude?) => void)

                      设置3d物体能否被场景遮挡

                      Type declaration

                        • (object, canOcclude?): void
                        • 设置3d物体能否被场景遮挡

                          Parameters

                          • object: CSS3DObject
                          • Optional canOcclude: boolean

                          Returns void

                      setCurrentTool: ((id?, info?) => App)

                      Type declaration

                        • (id?, info?): App
                        • Parameters

                          • Optional id: string
                          • Optional info: Record<string, any>

                          Returns App

                      setCursor: ((cur) => void)

                      设置光标

                      Type declaration

                        • (cur): void
                        • 设置光标

                          Parameters

                          • cur: string

                            光标名称

                          Returns void

                      Param: cur

                      光标名称

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

                      设置环境变量

                      Type declaration

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

                          Parameters

                          Returns void

                      setFocus: (() => void)

                      获取焦点

                      Type declaration

                        • (): void
                        • 获取焦点

                          Returns void

                      setMenu: ((menu?, key?) => void)

                      设置地图右键上下文菜单,运行时将触发 上下文菜单将要打开contextMenuPreOpen, 上下文菜单已打开contextMenuOpened, 上下文菜单打开无内容contextMenuNoContent事件

                      Type declaration

                        • (menu?, key?): void
                        • 设置地图右键上下文菜单,运行时将触发 上下文菜单将要打开contextMenuPreOpen, 上下文菜单已打开contextMenuOpened, 上下文菜单打开无内容contextMenuNoContent事件

                          Parameters

                          • Optional menu: ((event, object?) => ContextMenu)

                            获取菜单的函数

                          • Optional key: string

                            多次调用setMenu时,同样的key会覆盖之前的事件函数;有多个key时,调用次序为key的字母次序倒序;多次调用时,直到函数返回一个非null的ContextMenu为止

                          Returns void

                      Param: menu

                      获取菜单的函数

                      Param: key

                      多次调用setMenu时,同样的key会覆盖之前的事件函数;有多个key时,调用次序为key的字母次序倒序;多次调用时,直到函数返回一个非null的ContextMenu为止

                      setPhysicsDebugger: ((enable) => void)

                      设置物理引擎调试

                      Type declaration

                        • (enable): void
                        • 设置物理引擎调试

                          Parameters

                          • enable: boolean

                          Returns void

                      setSelectBoomRefreshFlag: (() => void)

                      Type declaration

                        • (): void
                        • Returns void

                      showStat: boolean

                      是否显示统计

                      signal: {
                          contextMenuCancel: Signal;
                          contextMenuNoContent: Signal;
                          contextMenuOpened: Signal;
                          contextMenuPreOpen: Signal;
                          onActiveScene: Signal;
                          onAddScene: Signal;
                          onAppAddEntity: Signal;
                          onAppAfterRender: Signal;
                          onAppAfterUpdate: Signal;
                          onAppBeforeAddEntity: Signal;
                          onAppBeforeRemoveEntity: Signal;
                          onAppBeforeRemoveObject: Signal;
                          onAppBeforeRender: Signal;
                          onAppBeforeUpdate: Signal;
                          onAppRemoveEntity: Signal;
                          onAppRemoveObject: Signal;
                          onAppRender: Signal;
                          onAppUpdate: Signal;
                          onBloomedChange: Signal;
                          onCameraChange: Signal;
                          onCameraControl: Signal;
                          onCameraUpdate: Signal;
                          onContainerSizeChange: Signal;
                          onContextMenu: Signal;
                          onCustomEvent: Signal;
                          onEntityBloomed: Signal;
                          onEntityOutline: Signal;
                          onEntitySelected: Signal;
                          onEntityUnBloomed: Signal;
                          onEntityUnOutline: Signal;
                          onEntityUnSelected: Signal;
                          onKeyDown: Signal;
                          onKeyUp: Signal;
                          onMouseClick: Signal;
                          onMouseDblClick: Signal;
                          onMouseDown: Signal;
                          onMouseEnter: Signal;
                          onMouseLeave: Signal;
                          onMouseMove: Signal;
                          onMouseOut: Signal;
                          onMouseOver: Signal;
                          onMousePreClick: Signal;
                          onMouseUp: Signal;
                          onMouseWheel: Signal;
                          onOutlineChange: Signal;
                          onPointerCancel: Signal;
                          onPointerDown: Signal;
                          onPointerDownUp: Signal;
                          onPointerMove: Signal;
                          onPointerUp: Signal;
                          onRemoveScene: Signal;
                          onSelectedChange: Signal;
                      } = ...

                      Type declaration

                      stateInAny: ((...paths) => boolean)

                      Type declaration

                        • (...paths): boolean
                        • Parameters

                          • Rest ...paths: string[]

                          Returns boolean

                      stateIsIn: ((path) => boolean)

                      Type declaration

                        • (path): boolean
                        • Parameters

                          • path: string

                          Returns boolean

                      svc: Service
                      transformObject: ((options) => Promise<StateNode>)

                      对一个物体进行变换控制器操作

                      Type declaration

                      tweenManager: TweenManager = ...
                      undo: (() => any)

                      撤销

                      Type declaration

                        • (): any
                        • 撤销

                          Returns any

                      unproject: ((x, y?, opts?, retIntersectObject?) => Vector3)

                      屏幕坐标转世界坐标

                      Type declaration

                        • (x, y?, opts?, retIntersectObject?): Vector3
                        • 屏幕坐标转世界坐标

                          Parameters

                          • x: number | Vector2
                          • Optional y: number
                          • Optional opts: UnProjectOpts

                            (undefined根据地图配置决定, false 不用场景数据, true用场景数据) 深度 (-1近裁剪面 到 1 远裁剪面) 或者输入 平面(默认xz平面) 或者由一个点所在的屏幕平面 或者使用当前场景实体 或 指定实体数组 或同时指定包含或过滤的实体

                          • Optional retIntersectObject: {}

                            如果需要返回与哪个实体相交而转化的世界坐标,可传入一个object对象

                            Returns Vector3

                        Param: x

                        Param: y

                        Param: opts

                        (undefined根据地图配置决定, false 不用场景数据, true用场景数据) 深度 (-1近裁剪面 到 1 远裁剪面) 或者输入 平面(默认xz平面) 或者由一个点所在的屏幕平面 或者使用当前场景实体 或 指定实体数组 或同时指定包含或过滤的实体

                        Param: retIntersectObject

                        如果需要返回与哪个实体相交而转化的世界坐标,可传入一个object对象

                        unprojectAsync: ((x, y, opts?, retIntersectObject?) => Promise<Vector3>)

                        屏幕坐标转世界坐标(同 unproject 函数,不同的地方是他支持通过后期处理的深度进行转换,是异步执行的)

                        Type declaration

                          • (x, y, opts?, retIntersectObject?): Promise<Vector3>
                          • 屏幕坐标转世界坐标(同 unproject 函数,不同的地方是他支持通过后期处理的深度进行转换,是异步执行的)

                            Parameters

                            • x: number

                              屏幕坐标x

                            • y: number

                              屏幕坐标y

                            • Optional opts: "depth" | UnProjectOpts

                              (false 不用场景数据, true用场景数据) "depth" 后期处理的深度进行转换, 深度值 (-1近裁剪面 到 1 远裁剪面) 或者输入 平面(默认xz平面) 或者由一个点所在的屏幕平面 或者使用当前场景实体 或 指定实体数组 或同时指定包含或过滤的实体

                            • Optional retIntersectObject: {}

                              如果需要返回与哪个实体相交而转化的世界坐标,可传入一个object对象

                              Returns Promise<Vector3>

                          Param: x

                          屏幕坐标x

                          Param: y

                          屏幕坐标y

                          Param: opts

                          (false 不用场景数据, true用场景数据) "depth" 后期处理的深度进行转换, 深度值 (-1近裁剪面 到 1 远裁剪面) 或者输入 平面(默认xz平面) 或者由一个点所在的屏幕平面 或者使用当前场景实体 或 指定实体数组 或同时指定包含或过滤的实体

                          Param: retIntersectObject

                          如果需要返回与哪个实体相交而转化的世界坐标,可传入一个object对象

                          updateCollideRect: (() => void)

                          更新碰撞检测

                          Type declaration

                            • (): void
                            • 更新碰撞检测

                              Returns void

                          viewHelperEnable: boolean

                          是否显示视角显示器

                          defaultModules: (AppModuleConstructor | [AppModuleConstructor, string])[] = ...
                          registerModules: Set<EntityModuleConstructor> = ...

                          注册的模块

                          Accessors

                          • get camera(): Camera
                          • Returns Camera

                          • set camera(value): void
                          • Parameters

                            • value: Camera

                            Returns void

                          • get container(): HTMLElement
                          • Returns HTMLElement

                          • set container(value): void
                          • Parameters

                            • value: HTMLElement

                            Returns void

                          • get destroyed(): boolean
                          • Indicates whether the engine is destroyed.

                            Returns boolean

                          • get domElement(): HTMLElement
                          • Returns HTMLElement

                          • set domElement(value): void
                          • Parameters

                            • value: HTMLElement

                            Returns void

                          • get isPaused(): boolean
                          • Whether the engine is paused.

                            Returns boolean

                          • get scene(): Scene
                          • Returns Scene

                          • set scene(value): void
                          • Parameters

                            • value: Scene

                            Returns void

                          • get targetFrameRate(): number
                          • Set the target frame rate you want to achieve.

                            Returns number

                            Remarks

                            It only takes effect when vSyncCount = 0 (ie, vertical synchronization is turned off). The larger the value, the higher the target frame rate, Number.POSITIVE_INFINITY represents the infinite target frame rate.

                          • set targetFrameRate(value): void
                          • Parameters

                            • value: number

                            Returns void

                          • get time(): Time
                          • The time information of the engine.

                            Returns Time

                          • get vSyncCount(): number
                          • 在vSyncCount被设置为0时才能生效,而当其设置为大于0时,则不生效。 当vSyncCount为1时,游戏帧率会与设备的刷新帧率保持一致,例如一台设备刷新频率是60Hz则,此时其游戏帧率为60FPS 当vSyncCount为2时,游戏帧率会设置为刷新帧率的一半,例如一台设备刷新帧率是60Hz时,则游戏帧率为30FPS

                            Returns number

                            Remarks

                            0 means that the vertical synchronization is turned off.

                          • set vSyncCount(value): void
                          • Parameters

                            • value: number

                            Returns void

                          Methods

                          • 增加模块,等同于this.addModule(xxx)

                            Type Parameters

                            Parameters

                            • type: (new (app?, obj?) => T)
                                • new (app?, obj?): T
                                • Parameters

                                  • Optional app: any
                                  • Optional obj: U

                                  Returns T

                            • Optional params: U

                            Returns T

                          • 增加模块,等同于this.add(xxx)

                            Type Parameters

                            Parameters

                            • type: (new (app?, obj?) => T)
                                • new (app?, obj?): T
                                • Parameters

                                  • Optional app: any
                                  • Optional obj: U

                                  Returns T

                            • Optional params: U

                            Returns T

                          • Parameters

                            • methodName: string
                            • Rest ...args: any

                            Returns void

                          • Destroy engine.

                            Returns void

                            Remarks

                            If call during frame execution will delay until the end of the frame

                          • 触发指定事件名称.

                            Parameters

                            • event: string

                              Event name

                            • Rest ...data: any

                              Data

                            Returns boolean

                            • Whether the dispatching is successful
                          • Returns void

                          • 返回注册的所有事件名.

                            Returns string[]

                            所有事件名

                          • Parameters

                            • json: Record<string, any>

                            Returns Promise<void>

                          • Type Parameters

                            Parameters

                            • type: (new (app?, obj?) => T)
                                • new (app?, obj?): T
                                • Parameters

                                  • Optional app: any
                                  • Optional obj: U

                                  Returns T

                            Returns T

                          • 确定是否存在事件侦听

                            Parameters

                            • event: string

                              事件名

                            Returns boolean

                            返回是否存在相应的事件

                          • 返回具有指定事件名称的侦听总数.

                            Parameters

                            • event: string

                              Event name

                            Returns number

                            The count of listeners

                          • 移除监听.

                            Parameters

                            • event: string

                              Event name

                            • Optional fn: Function

                              Function, If is undefined, delete all corresponding event listeners.

                            Returns EventDispatcher

                          • 下帧回调

                            Parameters

                            • callback: ((app) => void)
                                • (app): void
                                • Parameters

                                  Returns void

                            Returns void

                          • Pause the engine.

                            Returns void

                          • 通过事件名移除所有监听.

                            Parameters

                            • Optional event: string

                              Event name, delete all events if not passed

                            Returns void

                          • Type Parameters

                            Parameters

                            • type: (new (app?, obj?) => T)
                                • new (app?, obj?): T
                                • Parameters

                                  • Optional app: any
                                  • Optional obj: U

                                  Returns T

                            Returns void

                          • Resume the engine.

                            Returns void

                          • Execution engine loop.

                            Returns void

                          • Returns {
                                app: any;
                                children: (() => (UiObjectConfig<any, string, any> | {
                                    children: any[];
                                    expanded: boolean;
                                    label: any;
                                    type: string;
                                })[])[];
                                expanded: boolean;
                                label: string;
                                type: string;
                            }

                            • app: any
                            • children: (() => (UiObjectConfig<any, string, any> | {
                                  children: any[];
                                  expanded: boolean;
                                  label: any;
                                  type: string;
                              })[])[]
                            • expanded: boolean
                            • label: string
                            • type: string
                          • Returns {
                                camera: any;
                                entities: any[];
                                metadata: {};
                                project: {};
                                scene: any;
                            }

                            • camera: any
                            • entities: any[]
                            • metadata: {}
                              • project: {}
                                • scene: any
                              • Update the engine loop manually. If you call engine.run(), you generally don't need to call this function.

                                Returns void