Interface IParticleRenderModule

interface IParticleRenderModule {
    addParticle: ((opts) => ParticleEmitter<Object3DEventMap>);
    addParticleSystem: ((system, parent?, disposeWhenEnd?) => void);
    loadParticle: ((url, opts?) => Promise<ParticleEmitter<Object3DEventMap>>);
    particleRenderer: BatchedRenderer;
    loadParticleFromRes(obj, opts?): ParticleEmitter<Object3DEventMap>;
    removeParticle(obj): any;
}

Implemented by

Properties

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

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>>

particleRenderer: BatchedRenderer

Methods

  • 从资源加载粒子场景

    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>

  • Parameters

    Returns any