Options
All
  • Public
  • Public/Protected
  • All
Menu

A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces. Note: this joint is not fully documented as it is intended primarily for the testbed. See that for more instructions.

Hierarchy

Index

Constructors

constructor

Methods

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.

GetDampingRatio

  • GetDampingRatio(): number
  • Gets the damping ratio.

    Returns number

    Damping ratio.

GetFrequency

  • GetFrequency(): number
  • Gets the frequency.

    Returns number

    Frequency.

GetMaxForce

  • GetMaxForce(): number
  • Gets the max force.

    Returns number

    Max force.

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.

GetTarget

  • Gets the target.

    Returns b2Vec2

    Target.

GetType

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

    Returns number

    Joint type.

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.

SetDampingRatio

  • SetDampingRatio(ratio: number): void
  • Sets the damping ratio.

    Parameters

    • ratio: number

      New damping ratio.

    Returns void

SetFrequency

  • SetFrequency(hz: number): void
  • Sets the frequency.

    Parameters

    • hz: number

      New frequency (hertz).

    Returns void

SetMaxForce

  • SetMaxForce(maxForce: number): void
  • Sets the max force.

    Parameters

    • maxForce: number

      New max force.

    Returns void

SetTarget

  • SetTarget(target: b2Vec2): void
  • Use this to update the target point.

    Parameters

    Returns void

SetUserData

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

    Parameters

    • data: any

      Your custom data.

    Returns void

Generated using TypeDoc