Add this code in ode.pyx near the end and recompile pyode:
def collide2(geom1, geom2, arg, callback):
cdef void* data
cdef object tup
cdef long id1
cdef long id2
id1 = geom1._id()
id2 = geom2._id()
tup = (callback, arg)
data = <void*>tup
dSpaceCollide2(<dGeomID>id1, <dGeomID>id2, data, collide_callback)
And you will have collide2 funcion :) It will work like ordinary collide
function just with this special space checking. I did this for me,
because I too needed collide2 function between two spaces.
--
Mārtiņš Možeiko
-------- Original Message --------
> I just wanted to check:
> At the moment, in PyODE, there is no (quick for spaces with many
> objects) way to do check for collisions between objects in two different
> spaces (like the collide2 function available in the C API of ODE) right?
>
> I was going to put static world things in one space, and dynamic things
> in another space and do collide2 between them, putting them in one space
> seems to waste so much time doing collision between static things that
> it is faster to just use nested for loops to check the various pairings...
>
> (static, moving)
> (stopped, moving)
> (moving, moving)
>
> (where stopped are those that have body.enabled set to false)
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Pyode-user mailing list
> Pyo...@li...
> https://lists.sourceforge.net/lists/listinfo/pyode-user
>
|