Jump to content

  • Log In with Google      Sign In   
  • Create Account


Advanced collision detection technique resources


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 kanageddaamen   Members   -  Reputation: 135

Like
1Likes
Like

Posted 14 September 2013 - 11:44 AM

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.



Sponsor:

#2 serumas   Members   -  Reputation: 710

Like
0Likes
Like

Posted 15 September 2013 - 09:24 AM

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



#3 Dirk Gregorius   Members   -  Reputation: 717

Like
2Likes
Like

Posted 15 September 2013 - 10:46 PM

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, 15 September 2013 - 10:48 PM.


#4 Dirk Gregorius   Members   -  Reputation: 717

Like
0Likes
Like

Posted 16 September 2013 - 09:21 AM

Here is another reference how to handle multiple TOI events:

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



#5 Krohm   Crossbones+   -  Reputation: 2975

Like
0Likes
Like

Posted 19 September 2013 - 12:41 AM


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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS