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

Class Arbiter

object --+
         |
        Arbiter

Arbiters are collision pairs between shapes that are used with the collision callbacks.

IMPORTANT: Because arbiters are handled by the space you should never hold onto a reference to an arbiter as you don't know when it will be destroyed! Use them within the callback where they are given to you and then forget about them or copy out the information you need from them.

Instance Methods
 
__init__(self, _arbiter, space)
Initialize an Arbiter object from the Chipmunk equivalent struct and the Space.

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

Properties
  contacts
Information on the contact points between the objects.
  shapes
Get the shapes in the order that they were defined in the collision handler associated with this arbiter
  elasticity
Elasticity
  friction
Friction
  surface_velocity
Used for surface_v calculations, implementation may change
  stamp
Time stamp of the arbiter.
  is_first_contact
Returns true if this is the first step that an arbiter existed.

Inherited from object: __class__

Method Details

__init__(self, _arbiter, space)
(Constructor)

 

Initialize an Arbiter object from the Chipmunk equivalent struct and the Space.

Note: You should never need to create an instance of this class directly.

Overrides: object.__init__

Property Details

contacts

Information on the contact points between the objects.
Get Method:
_get_contacts(self)

shapes

Get the shapes in the order that they were defined in the collision handler associated with this arbiter
Get Method:
_get_shapes(self)

elasticity

Elasticity
Get Method:
_get_elasticity(self)
Set Method:
_set_elasticity(self, elasticity)

friction

Friction
Get Method:
_get_friction(self)
Set Method:
_set_elasticity(self, elasticity)

surface_velocity

Used for surface_v calculations, implementation may change
Get Method:
_get_surface_velocity(self)

stamp

Time stamp of the arbiter. (from the space)
Get Method:
_get_stamp(self)

is_first_contact

Returns true if this is the first step that an arbiter existed. You can use this from preSolve and postSolve to know if a collision between two shapes is new without needing to flag a boolean in your begin callback.
Get Method:
_get_is_first_contact(self)