I am currently developing car game in AndEngine. In which I was using revolute joint for car wheel and chassis attachment. But my friend suggest me that use wheel joint for that purpose for better behavior of the car. In AndEnginen I didn't found the wheel joint implementation. So what I have to do for wheel joint implementation.

I think I have to manually update the box2d library for this purpose but I don't know how many things get updated. Please suggest me some guidance on achieving better car behavior in AndEngine.

  • \$\begingroup\$ For wheel joint implementation in AndEngine, combine both revolute and prismatic joint. You get similar effect of wheel joint using combination of this both joint. \$\endgroup\$ – Siddharth Jan 15 '13 at 15:10

I am using box2d version >2.3.0 where it supports wheel joint and also updated in the andengine source,

source:Andengine Example code like,

import com.badlogic.gdx.physics.box2d.joints.WheelJointDef

WheelJointDef f = new WheelJointDef();
f.initialize(bodyA, bodyB, anchorBody, axis);//axis for suspension feature(Vector2)
f.frequencyHz=2; //this indicates ration for suspension, set the value as needed in the game.

Search Wheel joint on this link : box2d manual

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.