Skip to content

KBE3D / KBCore / Cesium / ParticleSystem

类: ParticleSystem

A ParticleSystem manages the updating and display of a collection of particles.

参数

Object with the following properties:

参数

Whether to display the particle system.

参数

The callback function to be called each frame to update a particle.

参数

The particle emitter for this system.

参数

The 4x4 transformation matrix that transforms the particle system from model to world coordinates.

参数

The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.

参数

The number of particles to emit per second.

参数

An array of ParticleBurst, emitting bursts of particles at periodic times.

参数

Whether the particle system should loop its bursts when it is complete.

参数

Sets the scale to apply to the image of the particle for the duration of its particleLife.

参数

The initial scale to apply to the image of the particle at the beginning of its life.

参数

The final scale to apply to the image of the particle at the end of its life.

参数

Sets the color of a particle for the duration of its particleLife.

参数

The color of the particle at the beginning of its life.

参数

The color of the particle at the end of its life.

参数

The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.

参数

If set, overrides the minimumImageSize and maximumImageSize inputs that scale the particle image's dimensions in pixels.

参数

Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.

参数

Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.

参数

Sets if the size of particles is in meters or pixels. <code>true</code> to size the particles in meters; otherwise, the size is in pixels.

参数

If set, overrides the minimumSpeed and maximumSpeed inputs with this value.

参数

Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.

参数

Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.

参数

How long the particle system will emit particles, in seconds.

参数

If set, overrides the minimumParticleLife and maximumParticleLife inputs with this value.

参数

Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.

参数

Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.

参数

Sets the minimum and maximum mass of particles in kilograms.

参数

Sets the minimum bound for the mass of a particle in kilograms. A particle's actual mass will be chosen as a random amount above this value.

参数

Sets the maximum mass of particles in kilograms. A particle's actual mass will be chosen as a random amount below this value.

属性

show

show: boolean

Whether to display the particle system.


updateCallback

updateCallback: updateCallback

An array of force callbacks. The callback is passed a Particle and the difference from the last time


loop

loop: boolean

Whether the particle system should loop it's bursts when it is complete.


image

image: any

The URI, HTMLImageElement, or HTMLCanvasElement to use for the billboard.


emitter

emitter: ParticleEmitter

The particle emitter for this


bursts

bursts: ParticleBurst[]

An array of ParticleBurst, emitting bursts of particles at periodic times.


modelMatrix

modelMatrix: Matrix4

The 4x4 transformation matrix that transforms the particle system from model to world coordinates.


emitterModelMatrix

emitterModelMatrix: Matrix4

The 4x4 transformation matrix that transforms the particle system emitter within the particle systems local coordinate system.


startColor

startColor: Color

The color of the particle at the beginning of its life.


endColor

endColor: Color

The color of the particle at the end of its life.


startScale

startScale: number

The initial scale to apply to the image of the particle at the beginning of its life.


endScale

endScale: number

The final scale to apply to the image of the particle at the end of its life.


emissionRate

emissionRate: number

The number of particles to emit per second.


minimumSpeed

minimumSpeed: number

Sets the minimum bound in meters per second above which a particle's actual speed will be randomly chosen.


maximumSpeed

maximumSpeed: number

Sets the maximum bound in meters per second below which a particle's actual speed will be randomly chosen.


minimumParticleLife

minimumParticleLife: number

Sets the minimum bound in seconds for the possible duration of a particle's life above which a particle's actual life will be randomly chosen.


maximumParticleLife

maximumParticleLife: number

Sets the maximum bound in seconds for the possible duration of a particle's life below which a particle's actual life will be randomly chosen.


minimumMass

minimumMass: number

Sets the minimum mass of particles in kilograms.


maximumMass

maximumMass: number

Sets the maximum mass of particles in kilograms.


minimumImageSize

minimumImageSize: Cartesian2

Sets the minimum bound, width by height, above which to randomly scale the particle image's dimensions in pixels.


maximumImageSize

maximumImageSize: Cartesian2

Sets the maximum bound, width by height, below which to randomly scale the particle image's dimensions in pixels.


sizeInMeters

sizeInMeters: boolean

Gets or sets if the particle size is in meters or pixels. <code>true</code> to size particles in meters; otherwise, the size is in pixels.


lifetime

lifetime: number

How long the particle system will emit particles, in seconds.


complete

complete: Event

Fires an event when the particle system has reached the end of its lifetime.


isComplete

isComplete: boolean

When <code>true</code>, the particle system has reached the end of its lifetime; <code>false</code> otherwise.

方法

isDestroyed()

isDestroyed(): boolean

Returns true if this object was destroyed; otherwise, false. <br /><br /> If this object was destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a DeveloperError exception.

返回

boolean

true if this object was destroyed; otherwise, false.


destroy()

destroy(): void

Destroys the WebGL resources held by this object. Destroying an object allows for deterministic release of WebGL resources, instead of relying on the garbage collector to destroy this object. <br /><br /> Once an object is destroyed, it should not be used; calling any function other than <code>isDestroyed</code> will result in a DeveloperError exception. Therefore, assign the return value (<code>undefined</code>) to the object as done in the example.

返回

void

构造函数

构造函数

new ParticleSystem(options?: { show?: boolean; updateCallback?: updateCallback; emitter?: ParticleEmitter; modelMatrix?: Matrix4; emitterModelMatrix?: Matrix4; emissionRate?: number; bursts?: ParticleBurst[]; loop?: boolean; scale?: number; startScale?: number; endScale?: number; color?: Color; startColor?: Color; endColor?: Color; image?: any; imageSize?: Cartesian2; minimumImageSize?: Cartesian2; maximumImageSize?: Cartesian2; sizeInMeters?: boolean; speed?: number; minimumSpeed?: number; maximumSpeed?: number; lifetime?: number; particleLife?: number; minimumParticleLife?: number; maximumParticleLife?: number; mass?: number; minimumMass?: number; maximumMass?: number; }): ParticleSystem

参数

options?
show?

boolean

updateCallback?

updateCallback

emitter?

ParticleEmitter

modelMatrix?

Matrix4

emitterModelMatrix?

Matrix4

emissionRate?

number

bursts?

ParticleBurst[]

loop?

boolean

scale?

number

startScale?

number

endScale?

number

color?

Color

startColor?

Color

endColor?

Color

image?

any

imageSize?

Cartesian2

minimumImageSize?

Cartesian2

maximumImageSize?

Cartesian2

sizeInMeters?

boolean

speed?

number

minimumSpeed?

number

maximumSpeed?

number

lifetime?

number

particleLife?

number

minimumParticleLife?

number

maximumParticleLife?

number

mass?

number

minimumMass?

number

maximumMass?

number

返回

ParticleSystem

KBE3D @3.0.0 Copyright © 2024-present KBE3D