[ODE] Re: Collision triangle culling
Erwin de Vries
erwin at vo.com
Thu Dec 6 06:47:01 2001
> > From: "Erwin de Vries" <erwin@vo.com>
> ...
> > What we did was quite easy. Check if the center of the box is at the
> > positive side of the plane. Beware though. This does not give perfect
> > results in all cases. This was also a problem i didnt quite
> > know how to solve.
>
> Thanks for that suggestion, should indeed work in 99% of the cases I
guess.
We use it in our (racing)game, so i'd say it works good enough for your
average racinggame. =)
> Ofcourse, the quantum effect of a speeding car jumping through a fence in
> one timestep isn't catched, but well.
It works pretty good in our game. Often very small objects fall through the
floor, but thats not a problem at all since the playercar's behavior is
good.
> Given that aerodynamics will make sure a car doesn't move in any direction
> faster than say, 400 km/h... This is 111 m/s. I step at about 250Hz, which
> then amounts to 0.44 m per step.
250hz?!?!?! Whoa!! You could get some major speeds at that rate! We only use
somewhere near 60hz, and our car can reach speeds like 350km/h without too
many problems.
> Quite a lot actually, but should work most
> of the time. Little things like broken off wheels and such will probably
> need a smaller timestep or double checking (if speed>highspeedThreshold
then
> check at both p and p+v/2; for example, hm).
It would be really nice to have functions in ODE to do this automatically
with some user control like setting a minimum simulation time, or a minimum
velocity on a per body basis.
> In fact, previously I had a better but slower function. I used Dave
Eberly's
> OBB-triangle intersection function (I still do, but more as a
> TestIntersection than a FindIntersection), which takes the OBB's linear
> velocity and calculates the time at which the OBB touches the triangle (so
> quantum effects can be overcome). However, this requires more triangles to
> check, and was quite a bit slower.
Hmm. Too bad. I found that in our physicscode the collision detection isnt
much of a problem at all. Most time is spent in the dynamics part. But this
depends on a lot of things of course.
Erwin