b2PrismaticJoint Class
A prismatic joint provides one degree of freedom: translation along an axis fixed in body1. Relative rotation is prevented. 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.
Example:
// create the prismatic joint
// set joint
var jointDef = {
lowerTranslation : -3.0, // meters
upperTranslation : 5.0, // meters
enableLimit : true,
enableMotor : true,
motorSpeed : 1.0,
maxMotorForce : 100.0,
}
this._prismaticJoint = this.createPrismaticJoint(this._ground, this._rect1, System.width / 2, System.height / 2, 0.0, 1.0, 0.0, jointDef, true)
Item Index
Properties
Methods
getLimits
() Multivalue
Another way to get lower and upper limit.
Returns:
Multivalue: Pair of float values: lower and upper limit.