@Override public void influenceParticle(Particle particle, EmitterShape emitterShape) { emitterShape.getRandomPointAndNormal(particle.position, particle.velocity); // influencing the particle's velocity if (surfaceTangentFactor == 0.0f) { particle.velocity.multLocal(normalVelocity); } else { // calculating surface tangent (velocity contains the 'normal' value) temp.set(particle.velocity.z * surfaceTangentFactor, particle.velocity.y * surfaceTangentFactor, -particle.velocity.x * surfaceTangentFactor); if (surfaceTangentRotation != 0.0f) {// rotating the tangent Matrix3f m = new Matrix3f(); m.fromAngleNormalAxis(FastMath.PI * surfaceTangentRotation, particle.velocity); temp = m.multLocal(temp); } // applying normal factor (this must be done first) particle.velocity.multLocal(normalVelocity); // adding tangent vector particle.velocity.addLocal(temp); } if (velocityVariation != 0.0f) { this.applyVelocityVariation(particle); } }
@Override public void influenceParticle(Particle particle, EmitterShape emitterShape) { emitterShape.getRandomPointAndNormal(particle.position, particle.velocity); // influencing the particle's velocity if (surfaceTangentFactor == 0.0f) { particle.velocity.multLocal(normalVelocity); } else { // calculating surface tangent (velocity contains the 'normal' value) temp.set(particle.velocity.z * surfaceTangentFactor, particle.velocity.y * surfaceTangentFactor, -particle.velocity.x * surfaceTangentFactor); if (surfaceTangentRotation != 0.0f) {// rotating the tangent Matrix3f m = new Matrix3f(); m.fromAngleNormalAxis(FastMath.PI * surfaceTangentRotation, particle.velocity); temp = m.multLocal(temp); } // applying normal factor (this must be done first) particle.velocity.multLocal(normalVelocity); // adding tangent vector particle.velocity.addLocal(temp); } if (velocityVariation != 0.0f) { this.applyVelocityVariation(particle); } }
@Override public void influenceParticle(Particle particle, EmitterShape emitterShape) { emitterShape.getRandomPointAndNormal(particle.position, particle.velocity); // influencing the particle's velocity if (surfaceTangentFactor == 0.0f) { particle.velocity.multLocal(normalVelocity); } else { // calculating surface tangent (velocity contains the 'normal' value) temp.set(particle.velocity.z * surfaceTangentFactor, particle.velocity.y * surfaceTangentFactor, -particle.velocity.x * surfaceTangentFactor); if (surfaceTangentRotation != 0.0f) {// rotating the tangent Matrix3f m = new Matrix3f(); m.fromAngleNormalAxis(FastMath.PI * surfaceTangentRotation, particle.velocity); temp = m.multLocal(temp); } // applying normal factor (this must be done first) particle.velocity.multLocal(normalVelocity); // adding tangent vector particle.velocity.addLocal(temp); } if (velocityVariation != 0.0f) { this.applyVelocityVariation(particle); } }