Jump to content
  • Advertisement
Sign in to follow this  
small_duck

Graphics and physics integration - Is there another way?

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

Hello all! I'm struggling to get this together. For simple models (characters, a stone), a simple bounding box is easy enough. But how to do that when trying to detect collisions with a full castle on several floors? I came with an idea, that is to create a simple language similar to the Povray script, where I can define cubes, spheres, polygons, with their textures, etc. so that I can create the graphical shape at the same time as the physical shape. But that's basically providing a (bad) modelling tool, which will be complicated for graphists to use, and on which I will anyway spend a huge amount of energy instead of concentrating on my game. Finally, I'd really like to decouple the physics from the rendering (I want the physics to be calculated on a server, while graphics are rendered on the client). It therefore rules out using the renderer to perform collision checks. Any ideas?

Share this post


Link to post
Share on other sites
Advertisement
This is where you start doing collision testing against the castle's model. On the castle's floor you're going to have a lot of polygons to give you the detail necessary when rendering it. However when dealing with collision detection you don't need all that detail, you can just use one giant polygon that spans the entire floor of the castle, so when performing collision detection of the castle's floor with a sphere you only need to perform a single polygon-sphere collision test instead of thousands of them. So the first thing to do is to create a very low polygon version of the castle's model to use for collision detection.

This isn't enough though, there could still be a couple of thousand polygons in the entire castle and testing against all of them would be incredibly slow. This is where spatial partitioning comes into play, structures such as BSP trees and octrees are useful here for narrowing down the number of polygons that need to be tested against to just a handful.

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!