Jump to content
  • Advertisement
Sign in to follow this  
Thanamos

Preparing for physics

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

Hey guys. I have just finished specifications for a new game I want to write, but this time I want to include physics and ragdoll, although just as eyecandy. The game, a 3D sideway scroller really has no need for physics, but for certain things, like the player dying, I want a dramatic ragdoll effect. Or when a thing explodes I would like to see parts flying and bouncing on the floor, things that look good but have no real impact on the game. But since I have never done anything related to physics I am a bit unsure how to implement this, and I would therefore like to wait with that specific implementation. I also want to keep the complexity at a reasonable level. So my question is this, what do I need to keep in mind while writing the game to make is easier to implement physics in the end? Consider this a physics learning project.

Share this post


Link to post
Share on other sites
Advertisement
I dont think there is much to it, apart from the obvious. It is best to keep a separation between collision detection and the physics itself.

doing effects triggered by collisions are usually done via callbacks / message systems.

The collision systems are usually split into two.

- Broad phase (where the objects bound by simple volumes, are spacially 'sorted'). Using a bounding volume hierarchy, it builds a list of object pairs that can potentially collide.

- Narrow phase. This is responsible for detecting exact collisions between the pairs of objects to test.

- The collision objects are usually simple. Boxes, spheres, and terrains (list of edges in 2D).

plus some extra candy, like queries (ray intersection queries, objects inside an volume, ...).

For a simple effect system, I'd keep it simple and ignore the broad phase collision (and do a 'test against everything'). Your ragdoll / particles will collide against the terrain only, so there is no need for it).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!