public class WheelJoint
A wheel joint. This joint provides two degrees of freedom: translation along an axis fixed in
bodyA and rotation in the plane. You can use a joint limit to restrict the range of motion and a
joint motor to drive the rotation or to model rotational friction. This joint is designed for
vehicle suspensions.
Constructors
protected WheelJoint(IWorldPool argPool, WheelJointDef def) |
Methods
Inherited fields
From Joint
m_prev, m_next, m_edgeA, m_edgeB, m_bodyA, m_bodyB, m_islandFlag, m_userData, pool
Inherited methods
Constructor details
WheelJoint
protected WheelJoint(IWorldPool argPool, WheelJointDef def)Method details
getLocalAnchorA
public Vec2 getLocalAnchorA()getLocalAnchorB
public Vec2 getLocalAnchorB()getAnchorA
public void getAnchorA(Vec2 argOut)get the anchor point on bodyA in world coordinates.
getAnchorB
public void getAnchorB(Vec2 argOut)get the anchor point on bodyB in world coordinates.
getReactionForce
public void getReactionForce(float inv_dt, Vec2 argOut)get the reaction force on body2 at the joint anchor in Newtons.
getReactionTorque
public float getReactionTorque(float inv_dt)get the reaction torque on body2 in N*m.
getJointTranslation
public float getJointTranslation()getLocalAxisA
public Vec2 getLocalAxisA()For serialization
getJointSpeed
public float getJointSpeed()isMotorEnabled
public boolean isMotorEnabled()enableMotor
public void enableMotor(boolean flag)setMotorSpeed
public void setMotorSpeed(float speed)getMotorSpeed
public float getMotorSpeed()getMaxMotorTorque
public float getMaxMotorTorque()setMaxMotorTorque
public void setMaxMotorTorque(float torque)getMotorTorque
public float getMotorTorque(float inv_dt)setSpringFrequencyHz
public void setSpringFrequencyHz(float hz)getSpringFrequencyHz
public float getSpringFrequencyHz()setSpringDampingRatio
public void setSpringDampingRatio(float ratio)getSpringDampingRatio
public float getSpringDampingRatio()initVelocityConstraints
public void initVelocityConstraints(SolverData data)solveVelocityConstraints
public void solveVelocityConstraints(SolverData data)solvePositionConstraints
public boolean solvePositionConstraints(SolverData data)This returns true if the position errors are within tolerance.