Advanced collision detection technique resources

Started by
3 comments, last by Krohm 10 years, 7 months ago

Hello all,

I am looking for some resources or information for developing a complex collision detection\response system. I have a swept-ellipsoid system up and running for player-world collisions but where I am running into issues is combining object-object and object world collisions.

The real issue I am trying to resolve in the design phase is when looking at objects that could potentially stop or alter another object's motion (say some crates that can be moved, but act as "walls" when the player runs up against them.)

I imagine that I would have to do something similar to the following:

  1. Find the displacement of the object
  2. Find the earliest time that the object collides with the world (a)
  3. Find the earliest time that the object collides with ANY other object (culled in the broad phase, of course)
  4. Move the object along the displacement by the less of (a) or (b) and perform response
  5. Iterate until the displacement is entirely used

Is this correct? This seems like it will be very expensive as I will have to check each possible colliding object every iteration of the check.

Another issue: What about objects that push other objects:

Example, say a crate falls and pushes a player. I would need to move the crate until it hits the player, then do an entire collision detection run for the player as it is pushed before finishing the crate's movement. That also seems like it could get prohibitively expensive as a push may cause another push, and so on.

Most of the information I have found is to determine whether 2 object collide, which I already have a firm grasp of. I need to expand that into a collision system with multiple objects. Any guidance is much appreciated.

Advertisement

All systems I know deals collision and response object-to-object. And there are no earliest time, everything goes at curient time and collision response depends on object shape overlapping, movement directins, mass and etc...

I think if there was more complex system than it was to expensive for cpu...

Sorry Serumas, but this is not correct. E.g Box2D has what is called a TOI solver to handle collisions in the order in which they occur. Ipion (the physics engine used in Half-Life 2 and which later was merged into Havok) had one as well. Havok also solves TOI events. I am also aware of other in-house physics engines which solve TOI events.

If you want to have a look at an example TOI solver I recommend looking at Box2D source code. Check b2World::SolveTOI()

Erin also gave a great presentation this year at the GDC how to calculate the TOI between two objects. It is an improvement of the Conservative Advancement method suggested by Mirtich.

You can find the downloads here: https://code.google.com/p/box2d/downloads/list

Here is another reference how to handle multiple TOI events:

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.65.532


Example, say a crate falls and pushes a player. I would need to move the crate until it hits the player, then do an entire collision detection run for the player as it is pushed before finishing the crate's movement
Major problem here.

There are three object types in real-world simulated physics for games. Static, dynamic and kinematic, player avatars often being in the third class.

Kinematics are not intended to be subject from "standard" physics and I strongly suggest you to not allow that. Don't move kinematics just because you feel like it. At the very least, you need some kind of notification system.

To solve this in an useful way, I'd ditch the academical references and just go browsing Bullet source code.

Previously "Krohm"

This topic is closed to new replies.

Advertisement