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

Class Constraint

object --+
         |
        Constraint
Known Subclasses:

Base class of all constraints.

You usually don't want to create instances of this class directly.

A constraint is something that describes how two bodies interact with each other. (how they constraint each other). Constraints can be simple joints that allow bodies to pivot around each other like the bones in your body, or they can be more abstract like the gear joint or motors.

Instance Methods
 
__init__(self, constraint=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
activate_bodies(self)
 
__del__(self)

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

Properties
  max_force
The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
  error_bias
The rate at which joint error is corrected.
  max_bias
The maximum rate at which joint error is corrected. Defaults to infinity
  impulse
Get the last impulse applied by this constraint.
  a
The first of the two bodies constrained
  b
The second of the two bodies constrained

Inherited from object: __class__

Method Details

__init__(self, constraint=None)
(Constructor)

 
x.__init__(...) initializes x; see help(type(x)) for signature
Overrides: object.__init__
(inherited documentation)

Property Details

max_force

The maximum force that the constraint can use to act on the two bodies. Defaults to infinity
Get Method:
_get_max_force(self)
Set Method:
_set_max_force(self, f)

error_bias

The rate at which joint error is corrected.

Defaults to pow(1.0 - 0.1, 60.0) meaning that it will correct 10% of the error every 1/60th of a second.

Get Method:
_get_error_bias(self)
Set Method:
_set_error_bias(self, error_bias)

max_bias

The maximum rate at which joint error is corrected. Defaults to infinity
Get Method:
_get_max_bias(self)
Set Method:
_set_max_bias(self, max_bias)

impulse

Get the last impulse applied by this constraint.
Get Method:
_get_impulse(self)

a

The first of the two bodies constrained
Get Method:
unreachable(self)

b

The second of the two bodies constrained
Get Method:
unreachable(self)