Package pymunk :: Class PivotJoint
[frames] | no frames]

Class PivotJoint

object --+    
         |    
Constraint --+
             |
            PivotJoint

Simply allow two objects to pivot about a single point.
Instance Methods
 
__init__(self, a, b, *args)
a and b are the two bodies to connect, and pivot is the point in world coordinates of the pivot.
 
__del__(self) (Inherited from pymunk.Constraint)

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

Properties
  anchr1
  anchr2
  a (Inherited from pymunk.Constraint)
  b (Inherited from pymunk.Constraint)
  bias_coef
The percentage of error corrected each step of the space. (Inherited from pymunk.Constraint)
  max_bias
The maximum speed at which the constraint can apply error correction. (Inherited from pymunk.Constraint)
  max_force
The maximum force that the constraint can use to act on the two bodies. (Inherited from pymunk.Constraint)

Inherited from object: __class__

Method Details

__init__(self, a, b, *args)
(Constructor)

 

a and b are the two bodies to connect, and pivot is the point in world coordinates of the pivot. Because the pivot location is given in world coordinates, you must have the bodies moved into the correct positions already. Alternatively you can specify the joint based on a pair of anchor points, but make sure you have the bodies in the right place as the joint will fix itself as soon as you start simulating the space.

That is, either create the joint with PivotJoint(a, b, pivot) or PivotJoint(a, b, anchr1, anchr2).

a : Body
The first of the two bodies
b : Body
The second of the two bodies
args : [Vec2d] or [Vec2d,Vec2d]
Either one pivot point, or two anchor points
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)