Skip to content

Instantly share code, notes, and snippets.

@yoggy
Created June 7, 2014 13:43
Show Gist options
  • Save yoggy/ee46cd6c0aca94f79607 to your computer and use it in GitHub Desktop.
Save yoggy/ee46cd6c0aca94f79607 to your computer and use it in GitHub Desktop.
import fisica.*;
FWorld world;
void setup() {
size(400, 400);
smooth();
Fisica.init(this);
world = new FWorld();
// create ropeway?
FCircle ball = new FCircle(50);
ball.setPosition(50, -100);
world.add(ball);
FBox box = new FBox(100, 50);
box.setPosition(50, 0);
box.setCategoryBits(0); // <- disable collision
world.add(box);
FDistanceJoint joint_ropeway = new FDistanceJoint(ball, box);
world.add(joint_ropeway);
// create rope?
FBox rope = new FBox(width*2, 10);
rope.setStatic(true);
rope.setPosition(0, 100);
rope.setRotation(0.1);
world.add(rope);
}
void draw() {
background(255);
world.step();
world.draw();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment