Jump to content
  • Advertisement

Archived

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

fakemind

after collision detection?

This topic is 6051 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

i just want to hear some ideas that have worked in the past for you all. after you find out that two entities collide, what did you do? im currently making the physics for my game, and i think hearing things that have already worked might spark some good ideas for me. doesnt really matter what game it was, simple or complex, im just curious about how you handled the physics involved in colisions. - jeremiah http://fakemind.com

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster


Well, I have been working on a vehicle physics tech demo, and most everything is collision.

What I do is take both entities and where on the entity that the collision occured and determine how much rotation to give each entity. Then I have them both exchange velocities.


So if you have a space ship floating in space, not moving, and one rams into the side, it will bounce away, and the one that rammed it should lose all its momentum.

I would explain how to figure out the angular momentum if I wasn''t lazy. If you need it I will post some pseudo code...

Share this post


Link to post
Share on other sites
You have them both exchange velocities? What happens when a speck of dust flying about at the speed of sound hits a planet? Surely it''s not too hard to do some real momentum calculations...

Share this post


Link to post
Share on other sites
That was exactly what i was thinking...

But, if you would exchange the velocity divided by the entity''s volume, you vould get a more satisfying result...

The proccess of caltulation the volume of a collision-sphere is simple math:

V = (4 * PI * r^3) / 3

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!