ParticleEmitter : RotationSpeed has now an effect when setting a faceNormal to a ParticleEmitter

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9661 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
rem..om 12 years ago
parent 65e469d8b8
commit aacc136aa8
  1. 9
      engine/src/core/com/jme3/effect/ParticleTriMesh.java

@ -40,6 +40,7 @@ import com.jme3.scene.VertexBuffer;
import com.jme3.scene.VertexBuffer.Format;
import com.jme3.scene.VertexBuffer.Usage;
import com.jme3.util.BufferUtils;
import com.jme3.util.TempVars;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.nio.ShortBuffer;
@ -207,6 +208,14 @@ public class ParticleTriMesh extends ParticleMesh {
faceNormal.cross(up, left);
up.multLocal(p.size);
left.multLocal(p.size);
if (p.angle != 0) {
TempVars vars = TempVars.get();
vars.vect1.set(faceNormal).normalizeLocal();
vars.quat1.fromAngleNormalAxis(p.angle, vars.vect1);
vars.quat1.multLocal(left);
vars.quat1.multLocal(up);
vars.release();
}
}else if (p.angle != 0){
float cos = FastMath.cos(p.angle) * p.size;
float sin = FastMath.sin(p.angle) * p.size;

Loading…
Cancel
Save