class

CP::Constraint::SlideJoint

Inherits CP::Constraint / Reference / Object

Like pin joints, but have a minimum and maximum distance. A chain could be modeled using this joint. It keeps the anchor points from getting too far apart, but will allow them to get closer together.

Constructors

new(a : Body, b : Body, anchor_a : Vect, anchor_b : Vect, min : Number, max : Number)

a and b are the two bodies to connect, anchor_a and anchor_b are the anchor points on those bodies, and min and max define the allowed distances of the anchor points.

Source

Instance methods

anchor_a

The location of the first anchor relative to the first body.

Source
anchor_a=(anchor_a : Vect)
Source
anchor_b

The location of the second anchor relative to the second body.

Source
anchor_b=(anchor_b : Vect)
Source
max

The maximum distance the joint will maintain between the two anchors.

Source
max=(max : Number)
Source
min

The minimum distance the joint will maintain between the two anchors.

Source
min=(min : Number)
Source