[OdeJava] About dCollide function

Ode.dCollide(SWIGTYPE_p_dGeomID o1,SWIGTYPE_p_dGeomID o2,int flags,dContactGeom contact,int skip);

I would like to use this function to get the distance between the start point of a GeomRay and the Geom it contacts with.

How should I set the parameter flags and skip? I don’t know the size of dContactGeom object.

Thanks!

can you elaborate please? How do you know that function is the one you want?

What if you do a getPosition and getRadius on the Geom that it contacts with? You will then know where it is, how big it is, and you already know how big the GeomRay is so it might just be a matter of some trig functions to calculate the position of the collision point you are after.

Will.

To be more specific, i would like to get the distance from a specific point with a specific direction to its nearest object in the Virtual Environment. It’s something like a
ray and the object it shine on.

So I would first try to create a GeomRay object, and then use the dCollide function to get the distance. But I have the problems in using the function as I have mentioned.:frowning: