Options
All
  • Public
  • Public/Protected
  • All
Menu

A revolute joint constrains to bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.

Hierarchy

Index

Constructors

constructor

Methods

EnableLimit

  • EnableLimit(flag: boolean): void
  • Enable/disable the joint limit.

    Parameters

    • flag: boolean

      True to enable, false to disable.

    Returns void

EnableMotor

  • EnableMotor(flag: boolean): void
  • Enable/disable the joint motor.

    Parameters

    • flag: boolean

      True to enable, false to diasable.

    Returns void

GetAnchorA

  • Get the anchor point on bodyA in world coordinates.

    Returns b2Vec2

    Body A anchor.

GetAnchorB

  • Get the anchor point on bodyB in world coordinates.

    Returns b2Vec2

    Body B anchor.

GetBodyA

  • Get the first body attached to this joint.

    Returns b2Body

    Body A.

GetBodyB

  • Get the second body attached to this joint.

    Returns b2Body

    Body B.

GetJointAngle

  • GetJointAngle(): number
  • Get the current joint angle in radians.

    Returns number

    Joint angle.

GetJointSpeed

  • GetJointSpeed(): number
  • Get the current joint angle speed in radians per second.

    Returns number

    Joint speed.

GetLowerLimit

  • GetLowerLimit(): number
  • Get the lower joint limit in radians.

    Returns number

    Lower limit.

GetMotorSpeed

  • GetMotorSpeed(): number
  • Get the motor speed in radians per second.

    Returns number

    Motor speed.

GetMotorTorque

  • GetMotorTorque(): number
  • Get the current motor torque, usually in N-m.

    Returns number

    Motor torque.

GetNext

  • Get the next joint the world joint list.

    Returns b2Joint

    Next joint.

GetReactionForce

  • GetReactionForce(inv_dt: number): b2Vec2
  • Get the reaction force on body2 at the joint anchor in N.

    Parameters

    • inv_dt: number

    Returns b2Vec2

    Reaction force in N.

GetReactionTorque

  • GetReactionTorque(inv_dt: number): number
  • Get the reaction torque on body 2 in N.

    Parameters

    • inv_dt: number

    Returns number

    Reaction torque in N.

GetType

  • GetType(): number
  • Get the type of the concrete joint.

    Returns number

    Joint type.

GetUpperLimit

  • GetUpperLimit(): number
  • Get the upper joint limit in radians.

    Returns number

    Upper limit.

GetUserData

  • GetUserData(): any
  • Get the user data pointer.

    Returns any

    User data. Cast to your data type.

IsActive

  • IsActive(): boolean
  • Short-cut function to determine if either body is inactive.

    Returns boolean

    True if active, otherwise false.

IsLimitEnabled

  • IsLimitEnabled(): boolean
  • Is the joint limit enabled?

    Returns boolean

    True if enabled, false if disabled.

IsMotorEnabled

  • IsMotorEnabled(): boolean
  • Is the joint motor enabled?

    Returns boolean

    True if enabled, false if disabled.

SetLimits

  • SetLimits(lower: number, upper: number): void
  • Set the joint limits in radians.

    Parameters

    • lower: number

      New lower limit.

    • upper: number

      New upper limit.

    Returns void

SetMaxMotorTorque

  • SetMaxMotorTorque(torque: number): void
  • Set the maximum motor torque, usually in N-m.

    Parameters

    • torque: number

      New max torque.

    Returns void

SetMotorSpeed

  • SetMotorSpeed(speed: number): void
  • Set the motor speed in radians per second.

    Parameters

    • speed: number

      New motor speed.

    Returns void

SetUserData

  • SetUserData(data: any): void
  • Set the user data pointer.

    Parameters

    • data: any

      Your custom data.

    Returns void

Generated using TypeDoc