public class WheelJoint

  1. Object
  2. Joint
  3. 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

public Vec2 getLocalAnchorA()
public Vec2 getLocalAnchorB()
public void getAnchorA(Vec2 argOut)get the anchor point on bodyA in world coordinates.
public void getAnchorB(Vec2 argOut)get the anchor point on bodyB in world coordinates.
public void getReactionForce(float inv_dt, Vec2 argOut)get the reaction force on body2 at the joint anchor in Newtons.
public float getReactionTorque(float inv_dt)get the reaction torque on body2 in N*m.
public float getJointTranslation()
public Vec2 getLocalAxisA()For serialization
public float getJointSpeed()
public boolean isMotorEnabled()
public void enableMotor(boolean flag)
public void setMotorSpeed(float speed)
public float getMotorSpeed()
public float getMaxMotorTorque()
public void setMaxMotorTorque(float torque)
public float getMotorTorque(float inv_dt)
public void setSpringFrequencyHz(float hz)
public float getSpringFrequencyHz()
public void setSpringDampingRatio(float ratio)
public float getSpringDampingRatio()
public void initVelocityConstraints(SolverData data)
public void solveVelocityConstraints(SolverData data)
public boolean solvePositionConstraints(SolverData data)This returns true if the position errors are within tolerance.

Inherited fields

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.