public override void manipulate(Particle particle, Vector3f deltaVelocity, Color4f deltaColor, ref float deltaLife) { Vector3f tmp = this.position.diff(particle.position); float len2 = tmp.length2(); if (len2 > size2) return; else if (len2 < threshold2) { deltaVelocity.set(particle.velocity); deltaVelocity.stretch(strength); deltaVelocity.invert(); return; } len2 = size2 / len2; deltaVelocity.set(tmp); deltaVelocity.stretch(strength); deltaVelocity.stretch(len2); }
public override void manipulate(Particle particle, Vector3f deltaVelocity, Color4f deltaColor, ref float deltaLife) { deltaVelocity.set(particle.velocity); deltaVelocity.stretch(strength); deltaVelocity.invert(); }
private int CompareParticlesAgainstCamera(Particle x, Particle y) { Vector3f tmp1 = activeCamera.getPosition().copy(); Vector3f tmp2 = activeCamera.getPosition().copy(); tmp1.subtract(x.position); tmp2.subtract(y.position); return (int)((tmp2.length2() - tmp1.length2()) * 1000000.0f); }
public abstract void manipulate(Particle particle, Vector3f deltaVelocity, Color4f deltaColor, ref float deltaLife);
public override void manipulate(Particle particle, Vector3f deltaVelocity, Color4f deltaColor, ref float deltaLife) { deltaVelocity.add(direction); deltaVelocity.stretch(strength); }