// 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);