List of usage examples for com.badlogic.gdx.physics.box2d.joints FrictionJointDef initialize
public void initialize(Body bodyA, Body bodyB, Vector2 anchor)
From source file:com.laex.cg2d.render.util.ProtoBufTypeConversionUtil.java
License:Open Source License
/** * As friction joint def./*from www . j a va 2 s . c o m*/ * * @param bodyA the body a * @param bodyB the body b * @param _j the _j * @return the friction joint def */ public static FrictionJointDef asFrictionJointDef(Body bodyA, Body bodyB, CGJoint _j) { FrictionJointDef jdef = new FrictionJointDef(); jdef.collideConnected = _j.getFrictionJointDef().getCollideConnected(); jdef.maxForce = _j.getFrictionJointDef().getMaxForce(); jdef.maxTorque = _j.getFrictionJointDef().getMaxTorque(); jdef.initialize(bodyA, bodyB, bodyA.getWorldCenter()); if (_j.getUseLocalAnchors()) { jdef.localAnchorA.set(Vector2Adapter.asVector2(_j.getLocalAnchorA())); jdef.localAnchorB.set(Vector2Adapter.asVector2(_j.getLocalAnchorB())); } return jdef; }