Package pymunk :: Module constraint :: Class DampedSpring
[frames] | no frames]

Class DampedSpring

object --+    
         |    
Constraint --+
             |
            DampedSpring

A damped spring
Instance Methods
 
__init__(self, a, b, anchr1, anchr2, rest_length, stiffness, damping)
Defined much like a slide joint.
 
__del__(self) (Inherited from pymunk.constraint.Constraint)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties
  anchr1
  anchr2
  rest_length
The distance the spring wants to be.
  stiffness
The spring constant (Young's modulus).
  damping
How soft to make the damping of the spring.
  a
The first of the two bodies constrained (Inherited from pymunk.constraint.Constraint)
  b
The second of the two bodies constrained (Inherited from pymunk.constraint.Constraint)
  bias_coef
The percentage of error corrected each step of the space. (Inherited from pymunk.constraint.Constraint)
  max_bias
The maximum speed at which the constraint can apply error correction. (Inherited from pymunk.constraint.Constraint)
  max_force
The maximum force that the constraint can use to act on the two bodies. (Inherited from pymunk.constraint.Constraint)

Inherited from object: __class__

Method Details

__init__(self, a, b, anchr1, anchr2, rest_length, stiffness, damping)
(Constructor)

 
Defined much like a slide joint.
Parameters:
  • rest_length (float) - The distance the spring wants to be.
  • stiffness (float) - The spring constant (Young's modulus).
  • damping (float) - How soft to make the damping of the spring.
Overrides: object.__init__

Property Details

anchr1

Get Method:
_get_anchr1(self)
Set Method:
_set_anchr1(self, anchr)

anchr2

Get Method:
_get_anchr2(self)
Set Method:
_set_anchr2(self, anchr)

rest_length

The distance the spring wants to be.
Get Method:
_get_rest_length(self)
Set Method:
_set_rest_length(self, rest_length)

stiffness

The spring constant (Young's modulus).
Get Method:
_get_stiffness(self)
Set Method:
_set_stiffness(self, stiffness)

damping

How soft to make the damping of the spring.
Get Method:
_get_damping(self)
Set Method:
_set_damping(self, damping)