Hi guys, I'm really sorry you're struggling with the lack of examples. It's something I'm painfully aware of, but at the same time trying my best to remedy. The main difference to other libraries here is that their development is not very linear & I'm constantly refactoring and extending the collection as I learn & work on new projects (of which there were many this year) and so development happens on many different fronts in parallel, but also with a bias towards features I currently require for these projects. And because I've been super busy with work projects for quite a few months now, I simply did not have the time to create a decent number of examples showing all the different features the libraries offer. I generally believe & have made lots of effort that they're easy to use though, but the most challenging task is to first communicate the basic concepts, idioms & conventions to people.
Having said that, I've been adding more demos with recent releases and the next round is coming up in the next week (which will have a few more demos again). Also, please don't make the mistake to compare or assume, that for example, my physics library is a 1:1 replacement for traer physics. It has not the same features (e.g. attraction) and served somewhat different purposes (so far).
I also realize that javadocs are not any help at all if you're working in the Processing IDE. However, I do mainly work on larger Java projects and exclusively use Eclipse (with Processing just being a part of the puzzle) and there the javadocs for each method are shown by simply hovering over a method name and so are much more in context when you're coding. I hardly ever look at javadocs in a web browser...
The other thing to note is that just like with Processing in the early days, other users of the libraries are somewhat reluctant to become contributors, share their code examples and so help at least on the examples front. I know people are putting stuff up, but are not communicating this back to me - so that they could be bundled with future revisions or put on the Google code site. Though again, I guess part of the reason here is also the lack of a proper roadmap and I'm desperately working towards having a bit more idle time at the end of the year to setup a project blog/website and spend more time on documentation.
Lastly, here're another 2 tiny examples (partly) related to your original question, which someone asked me to mockup recently (not sure if they're any helpful).
Code:
/**
* Softbody square demo
*/
import processing.opengl.*;
import toxi.physics2d.constraints.*;
import toxi.physics2d.*;
import toxi.geom.*;
import toxi.math.*;
int DIM=10;
int REST_LENGTH=20;
float STRENGTH=0.125;
float INNER_STRENGTH = 0.2;
VerletPhysics2D physics;
VerletParticle2D head,tail;
void setup() {
size(1280,720,OPENGL);
smooth();
physics=new VerletPhysics2D();
physics.gravity=new Vec2D(0,0.1);
physics.setWorldBounds(new Rect(0,0,width,height));
for(int y=0,idx=0; y<DIM; y++) {
for(int x=0; x<DIM; x++) {
VerletParticle2D p=new VerletParticle2D(x*REST_LENGTH,y*REST_LENGTH);
physics.addParticle(p);
if (x>0) {
VerletSpring2D s=new VerletSpring2D(p,physics.particles.get(idx-1),REST_LENGTH,STRENGTH);
physics.addSpring(s);
}
if (y>0) {
VerletSpring2D s=new VerletSpring2D(p,physics.particles.get(idx-DIM),REST_LENGTH,STRENGTH);
physics.addSpring(s);
}
idx++;
}
}
VerletParticle2D p=physics.particles.get(0);
VerletParticle2D q=physics.particles.get(physics.particles.size()-1);
float len=sqrt(sq(REST_LENGTH*(DIM-1))*2);
VerletSpring2D s=new VerletSpring2D(p,q,len,INNER_STRENGTH);
physics.addSpring(s);
p=physics.particles.get(DIM-1);
q=physics.particles.get(physics.particles.size()-DIM);
s=new VerletSpring2D(p,q,len,INNER_STRENGTH);
physics.addSpring(s);
head=physics.particles.get((DIM-1)/2);
head.lock();
}
void draw() {
background(0);
stroke(255);
head.set(mouseX,mouseY);
physics.update();
for(Iterator i=physics.springs.iterator(); i.hasNext();) {
VerletSpring2D s=(VerletSpring2D)i.next();
line(s.a.x,s.a.y,s.b.x,s.b.y);
}
}