Sign in to follow this  
pondwater

What are efficient ways to represent your static environment?

Recommended Posts

I was wondering what the most popular methods are for representing the static environment.

I first though to construct the environment from a group of simple convex polyhedra (cubes, pyramids, etc) to create more elaborate structures. Therefore a landscape could be the combination of several simpler shapes that can be reduced through a simple broadphase detection algorithm. This seems the simplest to implement but for complex shapes i could see a lot of unneeded vertices that are unneccessarily tested. Also, what do you do if the object is intersecting two shapes at the same time? How would you go about correcting its position?

I also read about polysoups or surfaces of triangles? This seems like the most efficient way of giving a detailed structure with minla vertices but Im curious as to what type of algorithm would deal with this.

Share this post


Link to post
Share on other sites
hi,

i could not answer all of your questions,
so i only try my best to attempt to it.

first of all,
for your complex shapes with vertices redundancy,
there are always tradeoff between accuracy of shapes and redundancy of vertices.

what it means is ,
you could actually optimize the vertices distribution by reducing the closest vertices,
and re-grouped them together to form a closer-look shape which has reduced the use of vertices.
but the tradeoff is its accuracy in describing the detail of shapes.

if you are interested,
u can do some research on it with 3D vertices reduction or filtering --- related topics.


To your second question,
there is no absolute solution to this,
you can either interpolate the collision response from the two objects,
or you decide which object takes more penetration and should react more response,
or you could even try to eliminate which object time factor is more important (for e.g,the time of impact is earlier)



hope it helps,

Regards,
Daniel.

Share this post


Link to post
Share on other sites
The representation you choose depends on the particular traits and constraints of your project. In my game, I just divide the level into a grid of squares, and store a list of edge chains which intersect each square.


As for the physics, just look at Box2d and Bullet and see how they did things. In particular, an iterative solver with impulse accumulation is useful for resolving multiple simultaneous contacts.

Share this post


Link to post
Share on other sites

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