API Documentation for:
Show:

b2PrismaticJointDef Class

Extends B2JointDef
Module: Joints

Prismatic 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.

Constructor

b2PrismaticJointDef

()

Methods

initialize

(
  • bodyA
  • bodyB
  • anchor
  • axis
)
Void public

Defined in initialize:194

Parameters:

  • bodyA B2Body
  • bodyB B2Body
  • anchor B2Vec2
  • axis B2Vec2

Returns:

Void:

Properties

enableLimit

Boolean public

Defined in enableLimit:105

Enable/disable the joint limit.

Default: false

enableMotor

Boolean public

Defined in enableMotor:135

Enable/disable the joint motor.

Default: false

localAnchorA

B2Vec2 public

Defined in localAnchorA:55

The local anchor point relative to bodyA's origin.

localAnchorB

B2Vec2 public

Defined in localAnchorB:64

The local anchor point relative to bodyB's origin.

localAxisA

B2Vec2 public

Defined in localAxisA:73

The local translation unit axis in bodyA.

lowerTranslation

Float public

The lower translation limit, usually in meters.

Default: 0.0

maxMotorForce

Float public

Defined in maxMotorForce:145

The maximum motor torque, usually in N-m.

Default: 0.0

motorSpeed

Float public

Defined in motorSpeed:155

The desired motor speed in radians per second.

Default: 0.0

referenceAngle

Float public

Defined in referenceAngle:94

The constrained angle between the bodies: bodyB_angle - bodyA_angle.

Default: 0.0

type

Int public

Defined in type:86

upperTranslation

Float public

The upper translation limit, usually in meters.

Default: 0.0