Latertater / jbox2d

Automatically exported from code.google.com/p/jbox2d
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

Problem when a dynamic body falls over a kinematic body moving down #36

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Testbed code below:

package org.jbox2d.testbed.tests;

import org.jbox2d.collision.shapes.PolygonShape;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.BodyDef;
import org.jbox2d.dynamics.BodyType;
import org.jbox2d.testbed.framework.TestbedTest;

public class MovingPlatformTeste extends TestbedTest {

   @Override
   public void initTest(boolean argDeserialized) {
        setTitle("Moving Platform Test");

        getWorld().setGravity(new Vec2(0, -100));

        PolygonShape polygonShape = new PolygonShape();
        polygonShape.setAsBox(10, 1);

        BodyDef bodyDef = new BodyDef();
        bodyDef.type = BodyType.KINEMATIC;
        bodyDef.position.set(0, 20);
        bodyDef.allowSleep = false;
        Body body = getWorld().createBody(bodyDef);
        body.createFixture(polygonShape, 5.0f);
        body.setLinearVelocity(new Vec2 (0.0f, -10.0f));

        polygonShape = new PolygonShape ();
        polygonShape.setAsBox(1, 1);

        bodyDef = new BodyDef ();
        bodyDef.type = BodyType.DYNAMIC;
        bodyDef.position.set(0, 100);
        bodyDef.allowSleep = false;
        body = getWorld().createBody(bodyDef);
        body.createFixture(polygonShape, 5.0f);
   }

   @Override
   public String getTestName() {
      return "Moving Platform Test";
   }

}

What is the expected output? What do you see instead?
It is expected that the body falling actually collides with the other body, but 
it never happens.

What version of the product are you using? On what operating system?
Latest version on windows

Please provide any additional information below.
It is posted here also: 
http://www.box2d.org/forum/viewtopic.php?f=9&t=8440&p=36214#p36214

Original issue reported on code.google.com by fabio....@gmail.com on 12 May 2012 at 1:26

GoogleCodeExporter commented 9 years ago
I think this was changed in the toi fix, it works correctly on trunk for both 
the 2.1.2 branch and the updating branch.  Release pending.

Original comment by toucansa...@gmail.com on 27 Jan 2013 at 6:02

GoogleCodeExporter commented 9 years ago

Original comment by toucansa...@gmail.com on 27 Jan 2013 at 6:07

GoogleCodeExporter commented 9 years ago

Original comment by danielmu...@gmail.com on 6 May 2013 at 5:25