Archived

This topic is now archived and is closed to further replies.

browny

Ode collision problem

Recommended Posts

browny    139
i am using Ode to do both physics and collision detection in my engine. But the problem with ODE is that.. if the time step or the speed of a body is too high.. the body gracefully passes trough a solid object without any collision being detected. I do understand what the problem is all about. I just want to know how it could be solved. I have got one idea though. While updating the position of an Y-Axis aligned cylinder ( in OpenGL ) we can check whether the ditance between the current position and the projected position is greater than ; perhaps half the radius of the cylinder.. and if it is.. we will position the cylinder in the mid way between the current position and the projected position and test for collision again. This way we can avoid collision miss due to large time steps or high velocities. Is there anyone who has successfully solved this problem using ODE.. i would be an humble listener.

Share this post


Link to post
Share on other sites
Psychor    202
Firstly, I have no idea what Ode is, so can''t help you with that

In general though, this problem is solvable in several different ways, depending on how exactly you''re doing collision detection. As a simple example, if your objects are bounded by spheres, then it''s possible to use a swept sphere algorithm in order to detect whether/where two objects collide (there are methods of doing this for other shapes too, and it can even be done per polygon for exact collision provided that bounding or space partitioning is used to reduce the number of tests required).

A good starting resource might be http://www.gamasutra.com/features/20020118/vandenhuevel_01.htm

Since your idea of generating additional steps for an object probably wouldn''t be much less expensive than a sweeping algorithm (especially if many steps are required), and is less exact, I''d recomment implementing something similar to this.

Share this post


Link to post
Share on other sites
MrRowl    2490
quote:
Original post by Psychor
Since your idea of generating additional steps for an object probably wouldn''t be much less expensive than a sweeping algorithm (especially if many steps are required), and is less exact, I''d recomment implementing something similar to this.


I''m not convinced about this... if most of your objects aren''t moving fast enough most of the time to require multiple collision checks, then I would have thought that doing occasional multiple checks for just a few objects would be better than doing sweep tests for all objects, all of the time.


Share this post


Link to post
Share on other sites
oliii    2196
I think you've got it nailed, browny. That's the simplest way to modify your code and improve collision accuracy.

You can also fragment the step if the collision penetration depth is too high, which usually yields invalid collision responses. Say a fast moving box clips another box on the other side of what the impact should be, then the box will bounce the other way (or not at all, since the impact velocity will be positive, I don't know what ODE does in that case).

swept tests, beside being slightly more expensive, are both complicated, and require a rethink of the physics loop and all that jive.

[edited by - oliii on January 4, 2004 7:04:51 PM]

Share this post


Link to post
Share on other sites