Sign in to follow this  

Graphics and physics integration - Is there another way?

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

This topic is 4276 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this