public class PrismaticJoint
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in
bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion
and a joint motor to drive the motion or to model joint friction.
Fields
protected final Vec2 m_localAnchorA | |
protected final Vec2 m_localAnchorB | |
protected final Vec2 m_localXAxisA | |
protected final Vec2 m_localYAxisA | |
protected float m_referenceAngle |
Constructors
protected PrismaticJoint(IWorldPool argWorld, PrismaticJointDef 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
Field details
m_localAnchorA
protected final Vec2 m_localAnchorAm_localAnchorB
protected final Vec2 m_localAnchorBm_localXAxisA
protected final Vec2 m_localXAxisAm_localYAxisA
protected final Vec2 m_localYAxisAm_referenceAngle
protected float m_referenceAngleConstructor details
PrismaticJoint
protected PrismaticJoint(IWorldPool argWorld, PrismaticJointDef 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.
getJointSpeed
public float getJointSpeed()Get the current joint translation, usually in meters.
getJointTranslation
public float getJointTranslation()isLimitEnabled
public boolean isLimitEnabled()Is the joint limit enabled?
enableLimit
public void enableLimit(boolean flag)Enable/disable the joint limit.
getLowerLimit
public float getLowerLimit()Get the lower joint limit, usually in meters.
getUpperLimit
public float getUpperLimit()Get the upper joint limit, usually in meters.
setLimits
public void setLimits(float lower, float upper)Set the joint limits, usually in meters.
isMotorEnabled
public boolean isMotorEnabled()Is the joint motor enabled?
enableMotor
public void enableMotor(boolean flag)Enable/disable the joint motor.
setMotorSpeed
public void setMotorSpeed(float speed)Set the motor speed, usually in meters per second.
getMotorSpeed
public float getMotorSpeed()Get the motor speed, usually in meters per second.
setMaxMotorForce
public void setMaxMotorForce(float force)Set the maximum motor force, usually in N.
getMotorForce
public float getMotorForce(float inv_dt)Get the current motor force, usually in N.
getMaxMotorForce
public float getMaxMotorForce()getReferenceAngle
public float getReferenceAngle()getLocalAxisA
public Vec2 getLocalAxisA()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.