[ODE] dGeomRaySet doesn't work correctly?

michael kapelko kornerr at gmail.com
Fri Sep 15 07:21:24 MST 2006


I get position of target body, get position of a camera. Then I create 
vector = body_pos - cam_pos. Then I normalize it (make it of unit 
length). Then I do dGeomRaySet (gun_ray, cam_pos.X, cam_pos.Y, 
cam_pos.Z, vector.X, vector.Y, vector.Z) and get no ray-box collision! 
How's that possible? When I do only dGeomRaySet (gun_ray, cam_pos.X, 
cam_pos.Y, cam_pos.Z, 0, -1, 0), that is, make the ray come from camera 
to the ground, collision occurs when I move above boxes! But it doesn't 
work for arbitrary ray direction I'm trying to set. What am I doing 
wrong? Can someone show me the code with aligning a ray along camera 
view vector?
Thanks.


More information about the ODE mailing list