Finally was able to build the testbed and implement the test I wanted to show. It is very simple, ask the testbed to draw the contact points and you will see there are none. Also, I noticed that if I turn off Continuous Collision, contact points will appear.
So, here is the test:
Code:
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";
}
}