使用cesium实现粒子火焰效果
import * as Cesium from 'cesium'
let path = import.meta.env.VITE_GLOB_PUBLIC_PATH === '/' ? '/public/' : import.meta.env.VITE_GLOB_PUBLIC_PATH;
//火焰特效
export class FireEffect{
constructor(viewer,pos) {
this.viewer=viewer
this.viewModel = {
emissionRate: 2,
gravity: 0.0,//设置重力参数
minimumParticleLife: 1,
maximumParticleLife: 10,
minimumSpeed: 1.0,//粒子发射的最小速度
maximumSpeed: 4.0,//粒子发射的最大速度
startScale: 3.0,
endScale: 15.0,
particleSize: 3.0,
}
this.emitterModelMatrix = new Cesium.Matrix4()
this.translation = new Cesium.Cartesian3()
this.rotation = new Cesium.Quaternion()
this.hpr = new Cesium.HeadingPitchRoll()
this.trs = new Cesium.TranslationRotationScale()
this.scene = this.viewer.scene
this.particleSystem=''
this.entity = this.viewer.entities.add({
//选择粒子放置的坐标
position: Cesium.Cartesian3.fromDegrees(
pos.lon,

3343

被折叠的 条评论
为什么被折叠?



