World representation structure and dynamics

Started by
1 comment, last by Krohm 11 years, 10 months ago
I've been playing Portal2 recently and the spherical weight gives me the creeps. It's just a ball and it rolls around. Am I getting excited because of standard rigid body dinamics? Yes I am.
Main problem is that I still have no idea how to produce that stable behaviour.
For the game I'm currently working on, I'm targeting low-end hardware. 1st gen Atoms to be clear.
It appears world should be loaded as triangle soups with marked internal edges. In my case, that did not quite cut it performance-wise. I plan to repeat the benchs as soon as the physics code stabilizes again. Odds are I might afford it now but in the last tests, the overhead of processing the triangle mesh appeared too much compared to the simplified hulls and boxes.
So the world was made out of hulls, and this means my ball would never roll correctly as it would get stuck in (I guess) the minimal FP approximations between adjacent rigid bodies.
At least it appeared to work like that last time I tried and yes, I will test that again.

In the meanwhile, I would like to read opinions on how to represent the world. It appears there's a growing trend in just making it a GIMPACT polysoup - apparently, Erwin Coumans himself seems to advice for this. It is my understanding it used to be hulls out of BSPs. If I look at some UDN articles about collisions, most things appear to work on hulls to me.

Note: my current world features lots of non-manifold geometry so... I'm unsure how convex extraction would work.

Previously "Krohm"

Advertisement
There're several ways, BSP might not be the best.

You should always utilise mutli-level collision detection, that is, first test against its AABB, then again the primitives or polysoup. The trick for a polysoup is, to subdivide the poly-set into some really compact AABBs with a reasonable number of polys inside. The AABBs could be put into an oct-tree like structures or some other data-structure(sweep'n'prune etc). This way you will have a very fast and constant access to your polysoup (gimpact does something similar ?).

An other way is to utilise callbacks (i.e. when using bullet). My terrain collision detection works only with callbacks, I calculate the mesh (only a hand full of polys per collision object for terrain-object collision) on-the-fly.

There're several ways, BSP might not be the best.

You should always utilise mutli-level collision detection, that is, first test against its AABB, then again the primitives or polysoup. The trick for a polysoup is, to subdivide the poly-set into some really compact AABBs with a reasonable number of polys inside. The AABBs could be put into an oct-tree like structures or some other data-structure(sweep'n'prune etc). This way you will have a very fast and constant access to your polysoup (gimpact does something similar ?).
I've never looked at GIMPACT, rumor has it there is some kind of hierarchical representation. I don't know the details.
Bullet does indeed what you mean. AABB testing is the so called broadphase, then a narrowphase follows resolving an exact hit using the internal collision shape. The collision shape can be trasformed by a rigid transform. There are a variety of shapes, polysoup being one of them.
An other way is to utilise callbacks (i.e. when using bullet). My terrain collision detection works only with callbacks, I calculate the mesh (only a hand full of polys per collision object for terrain-object collision) on-the-fly.
As far as I know this will wreak havoc for dynamic objects. I will look again at the documentation but from what I recall, I don't see how callbacks could help me there.

As a side note, were never part of the picture. What I meant to say was that BSP leafs were conveted into hulls.

Previously "Krohm"

This topic is closed to new replies.

Advertisement