class CP::Constraint::DampedSpring
- CP::Constraint::DampedSpring
- CP::Constraint
- Reference
- Object
Defined in:
chipmunk/constraint.crConstructors
-
.new(a : Body, b : Body, anchor_a : Vect, anchor_b : Vect, rest_length : Number, stiffness : Number, damping : Number)
Defined much like a slide joint.
Instance Method Summary
-
#anchor_a : Vect
The location of the first anchor relative to the first body.
- #anchor_a=(anchor_a : Vect)
-
#anchor_b : Vect
The location of the second anchor relative to the second body.
- #anchor_b=(anchor_b : Vect)
-
#damping : Float64
How soft to make the damping of the spring.
- #damping=(damping : Number)
-
#rest_length : Float64
The distance the spring wants to be at.
- #rest_length=(rest_length : Number)
-
#spring_force(dist : Float64) : Number
(can be overridden in a subclass)
-
#stiffness : Float64
The stiffness of the spring in force/distance.
- #stiffness=(stiffness : Number)
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, rest_length : Number, stiffness : Number, damping : Number)
#
Defined much like a slide joint.
- anchor_a: Anchor point a, relative to body a
- anchor_b: Anchor point b, relative to body b
- rest_length: The distance the spring wants to be at
- stiffness: The spring constant (Young's modulus)
- damping: How soft to make the damping of the spring