which joint for vehicle/motorcycle

General discussion about Box2D tutorials
Post Reply
vkreal
Posts: 66
Joined: Sun Jan 13, 2013 7:29 pm

which joint for vehicle/motorcycle

Post by vkreal »

Hi Iforce2d,

In some of your rube samples I see you use 'revolute' for example motorcycle wheels, is this the best way to go or should it be 'wheel' joints. I am getting weird issues using motorcycle sample and i think it might be using the wrong joint. Would have to set high numbers for it to go up slopes.

Code: Select all

  
m_rearDrivejoint->SetMaxMotorTorque(40);
        m_rearDrivejoint->SetMotorSpeed(-2000);
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: which joint for vehicle/motorcycle

Post by iforce2d »

Wheel joints are much better, if the port you are using has them. I'm pretty sure all the examples will be using wheel joints for the motorbike, at least in the exported .json file. Depending on which sample you are talking about, the loader sometimes needs to use a different joint type, eg. for Javascript, box2dweb has no wheel joint so the loader makes a line and distance joint combo instead.
vkreal
Posts: 66
Joined: Sun Jan 13, 2013 7:29 pm

Re: which joint for vehicle/motorcycle

Post by vkreal »

I am very newb to box2d, why wheel joint much better than revolute joint in respect to making vehicle wheels. Do you know the advantages and disadvantages between them in this aspect?

question about your downhill game, are you applying force on the bicyclist when he is paddling to get speed/acceleration or is just from wheel motor joint and down hill momentum?

Thanks!
iforce2d
Site Admin
Posts: 861
Joined: Sat Dec 22, 2012 7:20 pm

Re: which joint for vehicle/motorcycle

Post by iforce2d »

The wheel joint has suspension, and it was designed to be used with vehicles. You can use revolute joints for a car but they have no spring or damping behaviour, so it looks very rigid like an old wooden cart. The suspension also helps to keep the wheel touching the ground which is better for getting traction to drive and brake.

In DHS only the wheel motor is used to move the bike.
Post Reply