safon007 / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

new Lua-Function for Collision/TouchSensor: getHitObjectCount() and getHitObject(int) #199

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Gamekit could need a way to get the Objects that actually fire the 
Collision/TouchSensor. 
The way it is at the moment is that it only query if there is a collison but do 
not care about the collision objects itselfs. 
I patched this the following way:
The gkPhysicsController's bool:sensorCollides(...)-method actually does the 
job. I changed the method-call is this bool:sensorCollides(..., 
utArray<gkGameObject*>* list=NULL) If you call the method the old way the old 
behaviour is still there (stop processing after first match) but if you add a 
list as parameter all matching object-pointers are placed in that.

Feel free to change the method-call and everything (like typedef-terror and 
such :D) 

Original issue reported on code.google.com by thomas.t...@googlemail.com on 8 Nov 2011 at 5:05

Attachments:

GoogleCodeExporter commented 8 years ago
Patch is applied to trunk. Thanks.

Original comment by harkon...@gmail.com on 12 Nov 2011 at 2:39