class CP::Constraint::SlideJoint

Overview

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.

Defined in:

chipmunk/constraint.cr

Constructors

Instance Method Summary

Instance methods inherited from class CP::Constraint

bodies : Tuple(Body, Body) bodies, body_a : Body body_a, body_b : Body body_b, collide_bodies=(collide_bodies : Bool) collide_bodies=, collide_bodies? : Bool collide_bodies?, error_bias : Float64 error_bias, error_bias=(error_bias : Number) error_bias=, impulse : Float64 impulse, max_bias : Float64 max_bias, max_bias=(max_bias : Number) max_bias=, max_force : Float64 max_force, max_force=(max_force : Number) max_force=, post_solve(space : Space) post_solve, pre_solve(space : Space) pre_solve, space : Space | Nil space

Constructor Detail

def self.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.


[View source]

Instance Method Detail

def anchor_a : Vect #

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


[View source]
def anchor_a=(anchor_a : Vect) #

[View source]
def anchor_b : Vect #

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


[View source]
def anchor_b=(anchor_b : Vect) #

[View source]
def max : Float64 #

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


[View source]
def max=(max : Number) #

[View source]
def min : Float64 #

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


[View source]
def min=(min : Number) #

[View source]