Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Collision response idea (Or not)

This topic is 5619 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, I''m trying to work on a collision response system. Here''s what I have so far: I''m using OBBTrees for collision detection. Currently, I''m working with rigid bodies only. My OBBTree/OBBTree collision detection gives me all points (and lines) of contact. This does not include triangles that are completely within the objects (in other words, it only returns points that are on the surfaces of BOTH objects). My objects are assumed to have a constant density throughout (i.e. each point has the same mass, mass(point) = mass(object)/numPoints). I''m working from the reference frame of one of the objects (even if they''re both moving I''m making the motion of B relative to a "stationary" A). My idea is as follows: Find the centroid of all of these collision points (each line is counted as two points for simplicity). This is equivalent to the center of mass (I think) of those points. The first thing is to push the object back (by pushing on the centroid point) until it is outside of the object (how do I calculate that, is there a good way?), then determine (using physics mojo) how much actual force to apply to the object. I could then calculate how much of the objects movement had to be "rolled back" and determind the time that the object travelled up to the collision and take the remaining time for the frame and apply that force (so that it doesn''t stop for a fraction of a frame). A few problems: Multiple moving objects: Imagine a pool table. One ball hits another, which, in the same frame, hits a 3rd ball as a result. Do I have to do this iteratively to be correct? Reverse: How to determine how far back to push on the object at the centroid of the collision points? Also, could this create collisions again on the "other side" of the object''s center of mass (since pushing off-center would rotate the object)? Hmmm...okay, after typing all of this I have quite a few problems with this idea. Is it worth pursuing or is there a much better way to do it that I could add after my basic OBBTree collisions?

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!