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 x.__class__.__doc__ for signature
 
__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.
  bias_coef
The percentage of error corrected each step of the space.
  max_bias
The maximum speed at which the constraint can apply error correction.
  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 x.__class__.__doc__ 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)

bias_coef

The percentage of error corrected each step of the space. (Can cause issues if you don't use a constant time step) Defaults to 0.1
Get Method:
_get_bias_coef(self)
Set Method:
_set_bias_coef(self, bias_coef)

max_bias

The maximum speed at which the constraint can apply error correction. Defaults to infinity
Get Method:
_get_max_bias(self)
Set Method:
_set_max_bias(self, max_bias)

a

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

b

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