createSmoke method

dynamic createSmoke(
  1. dynamic path, {
  2. dynamic numparticles = 20,
})

Implementation

createSmoke(path,{numparticles:20}) async
{
  var particleorig=await OPENWORLD.Sprite.loadSprite(path,2000,2000,ambient:false);
  smokeGroup=THREE.Group();
  for (var p = 0; p < numparticles; p++) {
    var particle =  OPENWORLD.Sprite.cloneSprite(particleorig);
    // new THREE.Mesh(smokeGeo,smokeMaterial);
    particle.position.set(OPENWORLD.Math.random()*500-250, OPENWORLD.Math.random()*500-250,OPENWORLD.Math.random()*500-250);
    particle.rotation.z = OPENWORLD.Math.random() * 360;
    //   particle.rotation=THREE.Euler(2.0*(OPENWORLD.Math.random()-0.5),2.0*(OPENWORLD.Math.random()-0.5),2.0*(OPENWORLD.Math.random()-0.5));
    //  particle.up=THREE.Vector3(1.0*(OPENWORLD.Math.random()-0.5),1.0*(OPENWORLD.Math.random()-0.5),1.0*(OPENWORLD.Math.random()-0.5));
    var fct=3*2;
    particle.up=THREE.Vector3(fct*0.25*(OPENWORLD.Math.random()-0.5),fct*1.0*(OPENWORLD.Math.random()+0.1),fct*0.25*(OPENWORLD.Math.random()-0.5));
    //print("uuu"+particle.up.x.toString()+' '+particle.up.y.toString()+' '+particle.up.z.toString());
    smokeGroup.add(particle);

    //smokeParticles.push(particle);
  }
  return smokeGroup;
  //OPENWORLD.Space.worldToLocalSurfaceObjHide(smokeGroup,  -0.42, 1.35, 0.21,2);
//    OPENWORLD.Space.worldToLocalSurfaceObj(smokeGroup,  7.7, 1.0, 0.25);

 // smokeGroup.scale.set(0.00007,0.00007,0.00007);
}