Beispiel #1
0
        public void integrate(double deltaT)
        {
            if (IsFixed)
            {
                ToOriginal();
                return;
            }

            acc.multiplyScalar(ParticleConstants.DAMPING);

            THREE.Vector3 newPos = this.position.clone().sub(previous);
            newPos.add(acc.multiplyScalar(deltaT * deltaT));
            newPos.add(position);


            previous = position.clone();
            position = newPos;


            acc.set(0, 0, 0);
        }
Beispiel #2
0
 public void addForce(THREE.Vector3 force)
 {
     THREE.Vector3 a = force.clone();
     a.multiplyScalar(invMass);
     acc.add(a);
 }