app를 사용하고 있으신 U3dApp 로 바꿔주시면 되겠습니다
function createDisasterAtPosition(pos){
let app = this.core;
//////////////////////////////////////////////////////////연기생성
let opt = {
position: {x: pos.x, y: pos.y, z: pos.z + 100},
name: 'disaster',
positionSpread: {x: 10, y: 10, z: 0},
velocityBase: {x: 50, y: 50, z: 250},
velocitySpread: {x: 80, y: 120, z: 150},
accelerationBase: {x: 0, y: 0, z: -10},
particleImage: GeOnDT.UDefaultSource.SMOKE_PARTICLE_IMAGE,
angleBase: 0,
angleSpread: 720,
angleVelocityBase: 0,
angleVelocitySpread: 720,
sizeTween: [[0, 1], [100, 250]],
opacityTween: [[0.6, 2], [0.4, 0]],
colorTween: [[0.4, 1], [{x: 0, y: 0, z: 0.2}, '#808080']],
particlesPerSecond: 50,
particleDeathAge: 2.0,
emitterDeathAge: 60,
speed: 0.1
}
let analy = app.getAnalysis('Particle');
let particle = analy.initialize(opt);
if(defined(particle)){
if(defined(particle.particleMesh))
particle.particleMesh.visible = true;
}
analy.active();
//////////////////////////////////////////////////////////연기종료
//////////////////////////////////////////////////////////불 생성
let params = {
fireWidth: 100,
fireHeight: 200,
fireDepth: 100,
sliceSpacing: 5 + Math.random() * 50
}
let url1 = GeOnDT.UDefaultSource.FIRE_NOISE_IMAGE;
let url2 = GeOnDT.UDefaultSource.FIRE_TEXTURE_IMAGE;
let fire = app.createFire(pos, params, url1, url2);
if (defined(fire)) {
fire.mesh.visible = true;
}
//////////////////////////////////////////////////////////불 종료
//연기 삭제시
//analy.deactive();
//불 삭제시
// const index = app._fires.indexOf(fire);
// if(index > -1){
// app._fires.splice(index,1);
// app.getScene().remove(fire.mesh);
// GeOnDT.UDEF.disposeObject3D(fire.mesh);
// }
}

|