POV-Ray : Newsgroups : povray.off-topic : Games programmers : Re: Games programmers Server Time
7 Sep 2024 09:24:39 EDT (-0400)
  Re: Games programmers  
From: scott
Date: 9 Sep 2008 16:30:04
Message: <48c6dccc@news.povray.org>
> I was under the impression that this is pretty much standard procedure; 
> compute the path of an object for the next few split seconds and see if it 
> intersects the path of anything else.

Well yes, but I can't do the full simulation any more often because it's 
already too slow (simulating car tyres accurately and suspension for several 
cars is not fast!).  What I think I could do is to wait until a normal 
physics step indicates two objects are colliding (it is unlikely they would 
completely miss each other, unless travelling very fast or only just 
"scraping" a corner at speed, both of which I think I can ignore for now). 
Then, assume constant velocity and work backwards until the two objects are 
*just* touching.  Do the same for any other collisions, then find the 
earliest collision in time, apply the repelling impulses and do a full 
physics step from that time onwards.  Then repeat the above until no more 
collisions are found in that time period.  Hopefully that will not require 
too many more physics steps and should avoid things going wrong with fast 
objects.

> Otherwise objects would have to collide exactly on the bounderies of your 
> time steps - which is, uh, "improbable". ;-)

Well currently I just detect if they are intersecting and moving towards 
each other, and if they are apply an impulse to each object to separate 
them.

> That's nothing! With the Havok physics engine, sometimes objects hit the 
> ground and flail around indefinitely. (Presumably the engine trying to 
> prevent the object intersecting the ground.) Sometimes objects just keep 
> jiggling and won't stop - and sometimes the movement is quite significant.

Yep!

>> I'm sure with a bit more hackery I can make it more robust without having 
>> to do more physics steps.  Then I need to optimise the collision 
>> *detection*, as it gets a bit slow when 10 or so objects are colliding 
>> simultaneously.
>
> Uh, yeah, I have no idea how to fix that...

Need to implement some sort of LOD / binary tree of the collision mesh, at 
the moment I just test every face of the mesh against every other face once 
the objects' bounding spheres are intersecting.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.