BGE: Adding a Python collision API. The initial patch was provided by agoose77, with some edits by me.
KX_GameObject now has a collisionCallbacks list which is a list of callables that are called when a collision occurs. The callables will be called with an argument that contains a reference to the other object involved in the collision (i.e., not self).
This commit is contained in:
@@ -134,6 +134,12 @@ base class --- :class:`SCA_IObject`
|
||||
|
||||
:type: :class:`KX_GameObject` or None
|
||||
|
||||
.. attribute:: collisionCallbacks
|
||||
|
||||
A list of callables to be run when a collision occurs.
|
||||
|
||||
:type: list
|
||||
|
||||
.. attribute:: scene
|
||||
|
||||
The object's scene. (read-only).
|
||||
|
||||
Reference in New Issue
Block a user