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

Class DampedRotarySpring

object --+    
         |    
Constraint --+
             |
            DampedRotarySpring

Like a damped spring, but works in an angular fashion
Instance Methods
 
__init__(self, a, b, rest_angle, stiffness, damping)
Like a damped spring, but works in an angular fashion.
 
__del__(self) (Inherited from pymunk.constraint.Constraint)
 
activate_bodies(self) (Inherited from pymunk.constraint.Constraint)

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

Properties
  rest_angle
The relative angle in radians that the bodies want to have
  stiffness
The spring constant (Young's modulus).
  damping
How soft to make the damping of the spring.
  torque_func
Set the torque function
  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)
  error_bias
The rate at which joint error is corrected. (Inherited from pymunk.constraint.Constraint)
  impulse
Get the last impulse applied by this constraint. (Inherited from pymunk.constraint.Constraint)
  max_bias
The maximum rate at which joint error is corrected. Defaults to infinity (Inherited from pymunk.constraint.Constraint)
  max_force
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity (Inherited from pymunk.constraint.Constraint)

Inherited from object: __class__

Method Details

__init__(self, a, b, rest_angle, stiffness, damping)
(Constructor)

 
Like a damped spring, but works in an angular fashion.
Parameters:
  • rest_angle - The relative angle in radians that the bodies want to have
  • stiffness - The spring constant (Young's modulus).
  • damping - How soft to make the damping of the spring.
Overrides: object.__init__

Property Details

rest_angle

The relative angle in radians that the bodies want to have
Get Method:
_get_rest_angle(self)
Set Method:
_set_rest_angle(self, rest_angle)

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)

torque_func

Set the torque function

func(self, relative_angle) -> torque

Callback Parameters
relative_angle : float
The relative angle
Set Method:
_set_torque_func(self, func) - Set the torque function