Options
All
  • Public
  • Public/Protected
  • All
Menu

A line joint. This joint provides one degree of freedom: translation along an axis fixed in body1. 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.

Hierarchy

Index

Constructors

constructor

Methods

EnableLimit

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

    Parameters

    • flag: boolean

      True to enable, false to disable limits

    Returns void

EnableMotor

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

    Parameters

    • flag: boolean

      True to enable, false to disable the motor.

    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.

GetJointSpeed

  • GetJointSpeed(): number
  • Get the current joint translation speed, usually in meters per second.

    Returns number

    Joint speed.

GetJointTranslation

  • GetJointTranslation(): number
  • Get the current joint translation, usually in meters.

    Returns number

    Joint translation.

GetLowerLimit

  • GetLowerLimit(): number
  • Get the lower joint limit, usually in meters.

    Returns number

    Lower limit.

GetMaxMotorForce

  • GetMaxMotorForce(): number
  • Get the maximum motor force, usually in N.

    Returns number

    Max motor force.

GetMotorForce

  • GetMotorForce(): number
  • Get the current motor force, usually in N.

    Returns number

    Motor force.

GetMotorSpeed

  • GetMotorSpeed(): number
  • Get the motor speed, usually in meters per second.

    Returns number

    Motor speed.

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, usually in meters.

    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 otherwise false.

IsMotorEnabled

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

    Returns boolean

    True if enabled, otherwise false.

SetLimits

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

    Parameters

    • lower: number

      Lower limit.

    • upper: number

      Upper limit.

    Returns void

SetMaxMotorForce

  • SetMaxMotorForce(force: number): void
  • Set the maximum motor force, usually in N.

    Parameters

    • force: number

      New max motor force.

    Returns void

SetMotorSpeed

  • SetMotorSpeed(speed: number): void
  • Set the motor speed, usually in meters 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