Archived

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

fakemind

after collision detection?

Recommended Posts

fakemind    122
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
Guest Anonymous Poster   
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
Dracoliche    122
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
Tjoppen    122
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