I have window 640x480. I use 4 static bodies as edge of window, so nothing can't move over the edge of window. This is one of the 4 bodies, 30 pixels represent one meter, all of the bodies are programmed with following method, but at right edge is space.
Here you can see space between dynamic body move to right top corner

What can cause this space?
Code: Select all
BodyDef rightDef = new BodyDef();
rightDef.type = BodyType.STATIC;
rightDef.position.set(640/30, 480/30);
PolygonShape rightShape = new PolygonShape();
rightShape.setAsBox(0, 1000);
Body right = world.createBody(rightDef);
FixtureDef rightFixture = new FixtureDef();
rightFixture.density = 1;
rightFixture.restitution = 0f;
rightFixture.shape = rightShape;
right.createFixture(rightFixture);
bodies.add(right);
glOrtho(0, 640, 0, 480, 1, -1); // glOrtho setting
Here you can see space between dynamic body move to right top corner

What can cause this space?