From aacc136aa83f471576cfe46e52eaee72385175c1 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Thu, 16 Aug 2012 21:30:31 +0000 Subject: [PATCH] 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 --- engine/src/core/com/jme3/effect/ParticleTriMesh.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/engine/src/core/com/jme3/effect/ParticleTriMesh.java b/engine/src/core/com/jme3/effect/ParticleTriMesh.java index 735a77aed..57a9caa10 100644 --- a/engine/src/core/com/jme3/effect/ParticleTriMesh.java +++ b/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;