[ODE] Acquiring & editing dContact structures after contactjointgroup is created

Jon Watte hplus-ode at mindcontrol.org
Fri Feb 6 12:07:11 MST 2004


>What I do in my C# wrapper is to collect an array of collisions in a native
>callback. Then I pass this array back as the result of SpaceCollide (or
>collide, for that matter). Then I let the managed code create the contacts
>it wants out of this array, before calling WorldStep. That seems to work
>fine.

Thanks for answering. However, I got this to work already, but this 
makes one (undeeded) Java call per each nearCallback call. I'd like to 

No, it does not. As I already described, the array gets collected inside the NATIVE code. There is no callback into the client; the callback is native. Instead, the full array is returned back to the caller. This means that the interface for SpaceCollide that I provide is different than the interface that SpaceCollide has in C.

> offer Odejava users also another solution. Keep nearcallbacks still on C 
> and allow users to change dContact structures just before stepping the 
> world.

That's exactly what I describe.

> My problem was related to manipulating dContact structures just before I 
> step the world (dWorldStep), how is this possible? I added some code to 

I don't understand how it's NOT possible. As I described, you do NOT create contacts inside the callback, in C. Instead, you just remember the fact that there was a contact. Later, when the array of all possible contacts has been returned to the user, the user decides to create contact joints using whatever data he feels like.

Cheers,

			/ h+




More information about the ODE mailing list