# What are efficient ways to represent your static environment?

This topic is 2633 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## 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 on other sites
hi,

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.

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 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.

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 12
• 9
• 9
• 9
• 14
• ### Forum Statistics

• Total Topics
633314
• Total Posts
3011325
• ### Who's Online (See full list)

There are no registered users currently online

×