Package pybox2d :: Module Box2D :: Class b2ContactListener
[hide private]
[frames] | no frames]

type b2ContactListener

source code


Implement this class to get collision results. You can use these results for things like sounds and game logic. You can also get contact results by traversing the contact lists after the time step. However, you might miss some contacts because continuous physics leads to sub-stepping. Additionally you may receive multiple callbacks for the same contact in a single time step. You should strive to make your callbacks efficient because there may be many callbacks per time step. WARNING: The contact separation is the last computed value.

You cannot create/destroy Box2D entities inside these callbacks.

Instance Methods [hide private]
 
__swig_destroy__(...)
delete_b2ContactListener(b2ContactListener self)
 
__repr__(self) source code
 
__getstate__(self, additional_ignore=[])
Returns a dictionary representation of self, with dict(var=value [, ...])
source code
 
__setstate__(self, dict)
Takes each variable=value pair in the dictionary and sets the attributes based on them
source code
b2ContactListener
__init__(self) source code
 
__disown__(self) source code
 
Add(...)
b2ContactListener_Add(b2ContactListener self, b2ContactPoint point)
source code
 
Persist(...)
b2ContactListener_Persist(b2ContactListener self, b2ContactPoint point)
source code
 
Remove(...)
b2ContactListener_Remove(b2ContactListener self, b2ContactPoint point)
source code
 
Result(...)
b2ContactListener_Result(b2ContactListener self, b2ContactResult point)
source code
Properties [hide private]
  thisown
The membership flag
Method Details [hide private]

__repr__(self)
(Representation operator)

source code 
Overrides: object.__repr__
(inherited documentation)

__getstate__(self, additional_ignore=[])

source code 

Returns a dictionary representation of self, with 
 dict(var=value [, ...])

additional_ignore can be specified to ignore certain
properties. 

__init__(self)
(Constructor)

source code 
Returns: b2ContactListener
Overrides: object.__init__

Add(...)

source code 

b2ContactListener_Add(b2ContactListener self, b2ContactPoint point)

Called when a contact point is added. This includes the geometry and the forces.

Persist(...)

source code 

b2ContactListener_Persist(b2ContactListener self, b2ContactPoint point)

Called when a contact point persists. This includes the geometry and the forces.

Remove(...)

source code 

b2ContactListener_Remove(b2ContactListener self, b2ContactPoint point)

Called when a contact point is removed. This includes the last computed geometry and forces.

Result(...)

source code 

b2ContactListener_Result(b2ContactListener self, b2ContactResult point)

Called after a contact point is solved.


Property Details [hide private]

thisown

The membership flag