Would someone mind giving me an example of how to implement OdeRayGeom?

Panda3D’s reference is almost useless and comparing it to the official ODE reference is of no use either because the functions are different or have different naming.


Using the PyODE documentation helps, the difference in naming conventions is consistent enough to let you search reliably. The ODE section of the manual also covers usage of OdeRayGeom albeit not in great detail, its under the Geometry section.

Basically to use it:

ray = OdeRayGeom(space, ray_length)
ray.set(Vec3(<3 position components>), Vec3(<direction vector>))

I’m not quite sure if a ray can use setBody since if I remember correctly from using PyODE, RayGeom’s aren’t quite consistent with setPosition and setQuaternion.

Thanks for the links.

How would I know when its collided with another geom? I found the function collide(geom1, geom2) which returns a list of contact objects. How would I use it to get the point or a certain point where its collided?

I’m trying to get a 3rd person camera from going into walls, maybe there’s an easier or better way?

Which panda class is the collide() function from? The big difference between PyODE and panda’s integrated ODE is the collision handling, there’s an autoCollide() function that does all the work for you. The problem with that is you get less control so I’m not quite sure how to do that. You will be able to do a near callback manually when 1.6.0 comes out though.

Well, I found the collide function in the pyode documentation, but anyway, it would not have been very helpfull because I won’t always know which geom the ray should collide with.

Anyone know of another way for me to find what is blocking the camera view in 3rd person and fixing the camera’s position?

Well you could use panda’s own collision system if all you need is collisions and not physics.