class CP::Constraint::DampedRotarySpring

Overview

Like a damped spring, but works in an angular fashion

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, rest_angle : Number, stiffness : Number, damping : Number) #

[View source]

Instance Method Detail

def damping : Float64 #

How soft to make the damping of the spring.


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

[View source]
def rest_angle : Float64 #

The relative angle in radians that the bodies want to have


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

[View source]
def spring_torque(relative_angle : Float64) : Number #

(can be overridden in a subclass)


[View source]
def stiffness : Float64 #

The stiffness of the spring in force/distance.


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

[View source]