Package org.jbox2d.dynamics.joints
Class MotorJoint
java.lang.Object
org.jbox2d.dynamics.joints.Joint
org.jbox2d.dynamics.joints.MotorJoint
A motor joint is used to control the relative motion between two bodies. A
typical usage is to control the movement of a dynamic body with respect to
the ground.
- Author:
- Daniel Murphy
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgetAnchorA(Vec2 out) Get the anchor point on bodyA in world coordinates.voidgetAnchorB(Vec2 out) Get the anchor point on bodyB in world coordinates.floatfloatGet the target linear offset, in frame A, in meters.voidgetLinearOffset(Vec2 out) Get the target linear offset, in frame A, in meters.floatGet the maximum friction force in N.floatGet the maximum friction torque in N*m.voidgetReactionForce(float invDt, Vec2 out) Get the reaction force on body2 at the joint anchor in Newtons.floatgetReactionTorque(float invDt) Get the reaction torque on body2 in N*m.voidInternalvoidsetAngularOffset(float angularOffset) Set the target angular offset, in radians.voidsetCorrectionFactor(float correctionFactor) voidsetLinearOffset(Vec2 linearOffset) Set the target linear offset, in frame A, in meters.voidsetMaxForce(float force) Set the maximum friction force in N.voidsetMaxTorque(float torque) Set the maximum friction torque in N*m.booleanThis returns true if the position errors are within tolerance.voidInternalMethods inherited from class org.jbox2d.dynamics.joints.Joint
create, destroy, destructor, getBodyA, getBodyB, getCollideConnected, getNext, getType, getUserData, isActive, setUserData
-
Constructor Details
-
MotorJoint
-
-
Method Details
-
getAnchorA
Description copied from class:JointGet the anchor point on bodyA in world coordinates.- Specified by:
getAnchorAin classJoint
-
getAnchorB
Description copied from class:JointGet the anchor point on bodyB in world coordinates.- Specified by:
getAnchorBin classJoint
-
getReactionForce
Description copied from class:JointGet the reaction force on body2 at the joint anchor in Newtons.- Specified by:
getReactionForcein classJoint
-
getReactionTorque
public float getReactionTorque(float invDt) Description copied from class:JointGet the reaction torque on body2 in N*m.- Specified by:
getReactionTorquein classJoint
-
getCorrectionFactor
public float getCorrectionFactor() -
setCorrectionFactor
public void setCorrectionFactor(float correctionFactor) -
setLinearOffset
Set the target linear offset, in frame A, in meters. -
getLinearOffset
Get the target linear offset, in frame A, in meters. -
getLinearOffset
Get the target linear offset, in frame A, in meters. Do not modify. -
setAngularOffset
public void setAngularOffset(float angularOffset) Set the target angular offset, in radians. -
getAngularOffset
public float getAngularOffset() -
setMaxForce
public void setMaxForce(float force) Set the maximum friction force in N. -
getMaxForce
public float getMaxForce()Get the maximum friction force in N. -
setMaxTorque
public void setMaxTorque(float torque) Set the maximum friction torque in N*m. -
getMaxTorque
public float getMaxTorque()Get the maximum friction torque in N*m. -
initVelocityConstraints
Description copied from class:JointInternal- Specified by:
initVelocityConstraintsin classJoint
-
solveVelocityConstraints
Description copied from class:JointInternal- Specified by:
solveVelocityConstraintsin classJoint
-
solvePositionConstraints
Description copied from class:JointThis returns true if the position errors are within tolerance. Internal.- Specified by:
solvePositionConstraintsin classJoint
-