I've been messing around with jbox2d and was suprised when the x-velocity of a body was affected by the gravity of the world. Here's my code:
//create world
Vec2 gravity = new Vec2(0, 1);
boolean sleep = true;
world = new World(gravity, sleep);
//create wheel
BodyDef wheelBodyDef = new BodyDef();
wheelBodyDef.type = BodyType.DYNAMIC;
wheelBody = world.createBody(wheelBodyDef);
CircleShape circleShape = new CircleShape();
FixtureDef wheelFixtureDef = new FixtureDef();
wheelFixtureDef.shape = circleShape;
Fixture wheelFixture = wheelBody.createFixture(wheelFixtureDef);
wheelBody.setLinearVelocity(new Vec2(50, 0));
The linear velocity only makes a significant difference if I apply it every frame or if I disable gravity. Can anybody figure out what I'm doing wrong?