That does look like a weird one. On recreating the problem, I see
that error message occurring with the Processing-1.1.0.js but not with
Processing-1.0.0.js.
What seems to be working for me for MODIFIED_EULER is:
(1) use Processing-1.0.0.js and
(2) replace ModifiedEulerIntegrator in traer3a with the following
version:
===========================================================
// This is a workaround version of the code based on traer3, for use
in traer3a
// to avoid a hang at the start of the animation
public class ModifiedEulerIntegrator implements Integrator
{
ParticleSystem s;
public ModifiedEulerIntegrator( ParticleSystem s ) { this.s = s; }
public void step( float t )
{
s.clearForces();
s.applyForces();
float halftt = 0.5f*t*t;
for ( int i = 0; i < s.numberOfParticles(); i++ )
{
Particle p = s.getParticle( i );
if ( p.isFree() )
{
float ax = p.force.x/p.mass();
float ay = p.force.y/p.mass();
float az = p.force.z/p.mass();
p.position.add( p.velocity.x*t, p.velocity.y*t, p.velocity.z*t );
p.position.add( ax*halftt, ay*halftt, az*halftt );
p.velocity.add( ax*t, ay*t, az*t );
}
}
}
} // ModifiedEulerIntegrator
===========================================================
As a workaround for now. It appears to work for me on the dynamics
sample program with:
physics = new ParticleSystem( 1, 0.3 ); // bumped the drag up
from 0.05
physics.setIntegrator( ParticleSystem.MODIFIED_EULER );
I'll try to sort out the problems.
Mike