Class MotorJoint

java.lang.Object
org.jbox2d.dynamics.joints.Joint
org.jbox2d.dynamics.joints.MotorJoint

public class MotorJoint extends Joint
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
Repolink:
Github: erincatto/box2d src/dynamics/b2_motor_joint.cpp
  • Constructor Details

  • Method Details

    • getAnchorA

      public void getAnchorA(Vec2 out)
      Description copied from class: Joint
      Get the anchor point on bodyA in world coordinates.
      Specified by:
      getAnchorA in class Joint
    • getAnchorB

      public void getAnchorB(Vec2 out)
      Description copied from class: Joint
      Get the anchor point on bodyB in world coordinates.
      Specified by:
      getAnchorB in class Joint
    • getReactionForce

      public void getReactionForce(float invDt, Vec2 out)
      Description copied from class: Joint
      Get the reaction force on body2 at the joint anchor in Newtons.
      Specified by:
      getReactionForce in class Joint
    • getReactionTorque

      public float getReactionTorque(float invDt)
      Description copied from class: Joint
      Get the reaction torque on body2 in N*m.
      Specified by:
      getReactionTorque in class Joint
    • getCorrectionFactor

      public float getCorrectionFactor()
    • setCorrectionFactor

      public void setCorrectionFactor(float correctionFactor)
    • setLinearOffset

      public void setLinearOffset(Vec2 linearOffset)
      Set the target linear offset, in frame A, in meters.
    • getLinearOffset

      public void getLinearOffset(Vec2 out)
      Get the target linear offset, in frame A, in meters.
    • getLinearOffset

      public Vec2 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

      public void initVelocityConstraints(SolverData data)
      Description copied from class: Joint
      Internal
      Specified by:
      initVelocityConstraints in class Joint
    • solveVelocityConstraints

      public void solveVelocityConstraints(SolverData data)
      Description copied from class: Joint
      Internal
      Specified by:
      solveVelocityConstraints in class Joint
    • solvePositionConstraints

      public boolean solvePositionConstraints(SolverData data)
      Description copied from class: Joint
      This returns true if the position errors are within tolerance. Internal.
      Specified by:
      solvePositionConstraints in class Joint