5
\$\begingroup\$

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.

\$\endgroup\$
1
  • \$\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
    Commented Jan 15, 2013 at 15:10

1 Answer 1

0
\$\begingroup\$

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.enableMotor=true;
f.frequencyHz=2; //this indicates ration for suspension, set the value as needed in the game.
getPhysicsWorld().createJoint(f);

Search Wheel joint on this link : box2d manual

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .