Trouble creating a motor with a revolute joint.

Hey guys,

I'm trying to create a top down car game and I'm using box2D to drive the cars. I wanted to make it pretty simple, so I'm only using one joint to drive the car (no need for realistic driving). I am able to draw the car and the joint in the middle of it but whatever I do, the car does not move.

Here is a snippet of how I create the car (It's based on the flash top down car example and the revolute joint testbed example.)

http://pastebin.com/PWaFc56B

and here is how I try to move the car

http://pastebin.com/gTq0GL9P

But whatever I change, the car stays still. The vector is increasing but nothing happens. This is my first time working with joints so any hints or example codes would be awesome.

Thanks.
Hi, I'm pretty new to box2d too so I could be wrong about this,
but your setting your wheel as a box.

PolygonShape wheelShape = new PolygonShape();
wheelShape.setAsBox(2, 2);

should be something like:

wheelShape = new CircleShape();
wheelShape.m_radius = radius;
...

have a look at this: http://www.emanueleferonato.com/2009/04 ... ox2d-cars/
I know its in flash, but I converted the second example to java without much trouble, they are very similar.
I'm an idiot.

I found the issue. 😳

Forgot to do a world.step()... thanks for the help though.

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