Skip to content

Instantly share code, notes, and snippets.

@medecau
Created April 26, 2011 10:59
Show Gist options
  • Save medecau/942111 to your computer and use it in GitHub Desktop.
Save medecau/942111 to your computer and use it in GitHub Desktop.
import fisica.*;
//import processing.video.MovieMaker;
//MovieMaker mm;
FWorld world;
void setup(){
size(800,600);
smooth();
//mm = new MovieMaker(this, width, height, "demo.mov",
// 30, MovieMaker.ANIMATION, MovieMaker.HIGH);
Fisica.init(this);
world=new FWorld();
world.setGravity(0,0);
FCircle s = new FCircle(40);
s.setPosition(width/2,height/2);
s.setStatic(true);
s.setFill(255,0,0);
world.add(s);
FCircle p = new FCircle(40);
p.setVelocity(400,0);
p.setDamping(0);
p.setFill(0,63,195);
world.add(p);
FDistanceJoint g = new FDistanceJoint(s,p);
g.setLength(0);
g.setFrequency(0.5);
g.setDamping(0);
world.add(g);
}
void draw(){
background(255);
world.step();
world.draw();
//mm.addFrame();
}
/*
void keyPressed() {
if (key == ' ') {
mm.finish();
}
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment