broad phase with objects moving at very high speed

Please don't post Bullet support questions here, use the above forums instead.
vicviper
Posts: 21
Joined: Thu Jun 01, 2006 9:55 pm

broad phase with objects moving at very high speed

Post by vicviper »

Let's assume this scenario: we have a group of objects that are moving really fast relative to the world (speeds of 50.000km/h) but that appear stationary to each other, because all objects are moving at the same speed in the same direction.

If you have problems figuring this scenario, just think of a space station and a shuttle orbiting a planet.

how could modern physics engines react to this scenario? from what I know, most of them would fall apart.

And, how could be solved? the first problem I see is in the broad phase, where space is subdivided according to objects position and velocity, but, with such high speeds, I don't think any normal broad phase filter that takes velocity into account would work correctly.

I don't know what would happen in the narrow phase, but I figure that, since prior collision detection, the speeds would be nullified when making objects relative to others.

There's a video of a game that, unfortunately will never see, that apparently takes in account orbital velocities when using collision detection, and it looks really impressive to me:
http://www.gametrailers.com/player/user ... l?id=16457
colinvella
Posts: 24
Joined: Sat Feb 09, 2008 2:38 pm
Location: Malta

Re: broad phase with objects moving at very high speed

Post by colinvella »

In the scenario you are describing, one approach could be to have the environment define a number of world frames defined for each major entity e.g. large space station or mothership, and switch appropariately when in the vicinity of such entities. This would allow you to use an efficient space partitioning system for the large (relatively) stationary objects.

It doesn't matter if the planets orbit around the station / mothership because they would be far anyway. The matter might become more complicated if multiple perspectives are required.. in which case the environment would have to be replicated for each perspective.
vicviper
Posts: 21
Joined: Thu Jun 01, 2006 9:55 pm

Re: broad phase with objects moving at very high speed

Post by vicviper »

Yes, I already thought on that solution, and I think there are a few projects arround that use it ,partially because they can't afford to mess with the insides of the physics engines in use.

The problem with that solution is that it needs an extra layer interface that handles the different perspectives, and more importantly, handling the change of perspective of an object.

Another issue I just found with the current broad phase filters, and 3D engines in general, is that they're usually tailored to 32bit floating point positions, and that greatly limits the range in which you can place objects, and clearly, a solar system wide range is not going to happen.

So, I must assume that, in order to support very large zones (and very high speeds) is to have a custom rigid body system and broad phase, and using only the narrow phase and collision detection systems of physics engines?
bone
Posts: 231
Joined: Tue Feb 20, 2007 4:56 pm

Re: broad phase with objects moving at very high speed

Post by bone »

Yeah, I'd probably agree with that approach. With the range of your world, I'm pretty sure you'll need to store double-precision positions (at least for the base object position, not necessarily vertex or other local-space data). However, after broad phase, if you can transform objects to a local space (presumably one of the objects you are checking), then you can probably safely store and use the local positions as single-precision. In other words, you can probably use any existing engine for that part of the collision. I think, but do not know for sure, that Bullet uses local space for collision, which generally makes it more accurate.

Note: It is often a pain to switch between single- and double-precision, so you probably need to be careful to have a clean interface between the two.