Fisica: Inertia,
in
Contributed Library Questions
•
7 months ago
Hi there,
I am trying to create some kind of assembly line. When an object falls down on a FBox, it should stay at the position where it landed.
To illustrate my Question, I altered the ContactRemove sample from the library a bit. I want the circles to stay on the black box when I move it, and not to fall down:
So is there any easy way to add some kind of Inertia? For now I'm working on a solution with FDistanceJoints when a Circle hits the Box, but it really isn't a pleasure..
Thanks in advance!!
I am trying to create some kind of assembly line. When an object falls down on a FBox, it should stay at the position where it landed.
To illustrate my Question, I altered the ContactRemove sample from the library a bit. I want the circles to stay on the black box when I move it, and not to fall down:
- import fisica.*;
- FWorld world;
- FBox pala;
- void setup() {
- size(400, 400);
- smooth();
- Fisica.init(this);
- world = new FWorld();
- pala = new FBox(150, 20);
- pala.setPosition(width/2, height - 40);
- pala.setStatic(true);
- pala.setFill(0);
- pala.setRestitution(0);
- world.add(pala);
- }
- void draw() {
- background(255);
- if (frameCount % 25 == 0) {
- FCircle b = new FCircle(30);
- b.setPosition(random(0+10, width-10), 50);
- b.setVelocity(0, 200);
- b.setRestitution(0);
- b.setNoStroke();
- b.setFill(200, 30, 90);
- world.add(b);
- }
- pala.setPosition(mouseX, height - 40);
- world.draw();
- world.step();
- }
So is there any easy way to add some kind of Inertia? For now I'm working on a solution with FDistanceJoints when a Circle hits the Box, but it really isn't a pleasure..
Thanks in advance!!
1