Sign in to follow this  
kanageddaamen

Advanced collision detection technique resources

Recommended Posts

kanageddaamen    135

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.

Share this post


Link to post
Share on other sites
serumas    796

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...

Share this post


Link to post
Share on other sites
DonDickieD    2751

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

Edited by Dirk Gregorius

Share this post


Link to post
Share on other sites
Krohm    5030


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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this