예제 #1
0
        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);
        }
예제 #2
0
파일: Friction.cs 프로젝트: hyyly/teslagame
 public override void manipulate(Particle particle, Vector3f deltaVelocity, Color4f deltaColor, ref float deltaLife)
 {
     deltaVelocity.set(particle.velocity);
     deltaVelocity.stretch(strength);
     deltaVelocity.invert();
 }
예제 #3
0
        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);
        }
예제 #4
0
 public abstract void manipulate(Particle particle, Vector3f deltaVelocity, Color4f deltaColor, ref float deltaLife);
예제 #5
0
 public override void manipulate(Particle particle, Vector3f deltaVelocity, Color4f deltaColor, ref float deltaLife)
 {
     deltaVelocity.add(direction);
     deltaVelocity.stretch(strength);
 }