Physics, world representation

Massimo Del Zotto <[email protected]> Mon, 11 Jun 2012 09:54:32 +0200
Newsgroups gmane.games.devel.sweng
Message-ID <CALWCaoZmaxHqAsYddDbo=OejGwXzR=ncSAe4YRPTYHx=JG1KTA@mail.gmail.com>
--===============0257028813==
Content-Type: multipart/alternative; boundary=f46d0447f19a1261f604c22da960

--f46d0447f19a1261f604c22da960
Content-Type: text/plain; charset=ISO-8859-1

Hello to all contributors.
I need some help in understanding how physics libraries are supposed to be
used. I am referring to Bullet in particular as it appears to have
everything I need with a liberal, cross-platform licensing.
So far I have been experimenting with physics for a few months with mixed
results at best. As I write this, I have just resolved an issue with
player-controlled objects which has been keeping me awake at night for
quite a while so I'm thinking at the next problem I see on the horizon.

Now, in Bullet there are three kinds of objects:

   1. STAtic
   2. DYNamic
   3. KINematic

I think I have finally got a kinematic behaviour that works right for my
game.
The point of this email is the interaction of dynamic objects and a world
built from static objects.
I started modelling my world by procedurally generating a set of hulls, in
most cases, those were boxes. I don't remember the exact numbers but I'd
say my current data set for the world is about 96% boxes (mostly
axis-aligned) and 4% hulls.
The *main problem* I've observed is that *DYN objects won't interact
properly with static collision geometry at bounduaries*. I am not well
aware if this happens as I allow the static geometry to overlap or not.
That is, I don't know if adjusting the collision geometry by a margin would
fix that.

The current line of thinking in Bullet forums appears to be using generic
trimeshes and GIMPACT collision. Trimeshes allow to mark internal edges and
thus provide proper information to dynamic bodies to interact properly.

Now, let's leave out the fact that Bullet's demo about internal edges does
not seem to work as intended on my system.
Let's leave out the problem that I would need to write some code in the
filter to brute-force internal edge detection.
Let's start by considering that in general, I don't really feel ok with
feeding collision systems with graphics-oriented meshes. It *might* work
for now, but I'm afraid someone should be producing a reduced polycount
mesh.

But my main problem is that I feel like I'm seriously missing
something. For example, Bullet has a BSP demo from which they build
collision geometry. Now, BSPs are strictly related to convex hulls so it
appears to me that worlds are meant to be built as an assembly of multiple
rigid bodies rather than a single big trimesh. BSP demo *appears *to work
ok with dynamic rigid bodies to me.

So in short, *I am asking for a direction is choosing a world
representation for my collisions*. *Maybe collision shapes are only meant
to be used for dynamics, with trimeshes being the only way to represent a
world?*

I cannot quite see a big picture with those things, so I start thinking
perhaps I've misunderstood everything since day 0.

Elaborations are welcome.

Massimo

--f46d0447f19a1261f604c22da960
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello to all contributors.<div>I need some help in understanding how physic=
s libraries are supposed to be used. I am referring to Bullet in particular=
 as it appears to have everything I need with a liberal, cross-platform lic=
ensing.</div>
<div>So far I have been experimenting with physics for a few months with mi=
xed results at best. As I write this, I have just resolved an issue with pl=
ayer-controlled objects which has been keeping me awake at night for quite =
a while so I&#39;m thinking at the next problem I see on the horizon.</div>
<div><br></div><div>Now, in Bullet there are three kinds of objects:</div><=
div><ol><li>STAtic</li><li>DYNamic</li><li>KINematic</li></ol></div><div>I =
think I have finally got a kinematic behaviour that works right for my game=
.</div>
<div>The point of this email is the interaction of dynamic objects and a wo=
rld built from static objects.</div><div>I started modelling my world by pr=
ocedurally generating a set of hulls, in most cases, those were boxes. I do=
n&#39;t remember the exact numbers but I&#39;d say my current data set for =
the world is about 96% boxes (mostly axis-aligned) and 4% hulls.</div>
<div>The <b>main problem</b> I&#39;ve observed is that <b>DYN objects won&#=
39;t interact properly with static collision geometry at bounduaries</b>. I=
 am not well aware if this happens as I allow the static geometry to overla=
p or not. That is, I don&#39;t know if adjusting the collision geometry by =
a margin would fix that.</div>
<div><br></div><div>The current line of thinking in Bullet forums appears t=
o be using generic trimeshes and GIMPACT collision. Trimeshes allow to mark=
 internal edges and thus provide proper information to dynamic bodies to in=
teract properly.</div>
<div><br></div><div>Now, let&#39;s leave out the fact that Bullet&#39;s dem=
o about internal edges does not seem to work as intended on my system.</div=
><div>Let&#39;s leave out the problem that I would need to write some code =
in the filter to brute-force internal edge detection.</div>
<div>Let&#39;s start by considering that in general, I don&#39;t really fee=
l ok with feeding collision systems with graphics-oriented meshes. It <b>mi=
ght</b>=A0work for now, but I&#39;m afraid someone should be producing a re=
duced polycount mesh.</div>
<div><br></div><div>But my main problem is that I feel like I&#39;m serious=
ly missing something.=A0For example, Bullet has a BSP demo from which they =
build collision geometry. Now, BSPs are strictly related to convex hulls so=
 it appears to me that worlds are meant to be built as an assembly of multi=
ple rigid bodies rather than a single big trimesh. BSP demo <b>appears </b>=
to work ok with dynamic rigid bodies to me.</div>
<div><br></div><div>So in short, <b>I am asking for a direction is choosing=
 a world representation for my collisions</b>. <b>Maybe collision shapes ar=
e only meant to be used for dynamics, with trimeshes being the only way to =
represent a world?</b></div>
<div><br></div><div>I cannot quite see a big picture with those things, so =
I start thinking perhaps I&#39;ve misunderstood everything since day 0.</di=
v><div><br></div><div>Elaborations are welcome.</div><div><br></div><div>
Massimo</div>

--f46d0447f19a1261f604c22da960--

--===============0257028813==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Sweng-Gamedev mailing list
[email protected]
http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com

--===============0257028813==--