Box2D - body's position is incorrect

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.

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
Image

What can cause this space?
I don't know what's causing the space, but this does not make sense:
rightShape.setAsBox(0, 1000);
Hello, I solved my problem after long time - in this line

Code: Select all

rightDef.position.set(640/30, 480/30);

I forgotten add f, so code must be

Code: Select all

rightDef.position.set(640/30f, 480/30f);

Original thread: https://box2d.org/forum/viewtopic.php?t=9083