Class b2LineJointDef

Line joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.

Hierarchy

Index

Constructor methods

Properties

Methods

Constructor methods

constructor(): b2LineJointDef

Constructor.

Returns

b2LineJointDef

Properties

public bodyA: b2Body

The first attached body.

public bodyB: b2Body

The second attached body.

public collideConnected: boolean

Set this flag to true if the attached bodies should collide.

public enableLimit: boolean

Enable/disable the joint limit.

public enableMotor: boolean

Enable/disable the joint motor.

public localAnchorA: b2Vec2

The local anchor point relative to body1's origin.

public localAnchorB: b2Vec2

The local anchor point relative to body2's origin.

public localAxisA: b2Vec2

The local translation axis in bodyA.

public lowerTranslation: number

The lower translation limit, usually in meters.

public maxMotorForce: number

The maximum motor torque, usually in N-m.

public motorSpeed: number

The desired motor speed in radians per second.

public type: number

The joint type is set automatically for concrete joint types.

public upperTranslation: number

The upper translation limit, usually in meters.

public userData: any

Use this to attach application specific data to your joints.

Methods

public Initialize(bA: b2Body, bB: b2Body, anchor: b2Vec2, axis: b2Vec2)

Initialize the bodies, anchors, and length using the world anchors.

Parameters