[ODE] "synchronous" ray intersection tests?

Lars Pedersen larsped at gmail.com
Thu Aug 4 23:45:41 MST 2005


Hi all,
Let me see if I can explain my problem. I'm in the process of
replanting an existing game to use ODE and this issue confuses me. In
the game, I have a collision test in the main loop which can easily be
refactored to be used as the collision callback method in ODE. So far,
so good. But in a lot of places outside this method I am doing
individual line intersection tests. The calls look like this:

bool result = IsLineOfSightBlocked(Vector from, Vector to)

This code is stuff like AI routines, weapons simulations and so on.
Now, in ODE line intersection tests are done as part of the main
collision call, with ray geoms added to the system for just one step.
So if I do it this way, it means that the line intersection test is
asynchronous because the result will only be available later in the
game loop. This makes my job hard because I need to change a lot of
code.

Is there a reasonable way, performance-wise, that I can make
"throw-away" line intersection tests like above with ODE and
encapsulate it in a method that will give me my result right away? I
imagine I need to call one of the collide functions, but how do I
organize it so only the single ray is collision tested?

I hope this made sense. Any advice appreciated.



More information about the ODE mailing list