1
\$\begingroup\$

I'm wondering what is the most efficient collision shape to use with APIs like Bullet or Havok for rooms/interiors. Rooms tend to be boxes but are concave since the normals point inward which means no to the box shape. Rooms also can have holes in the walls (doors, windows, etc) too. If I'm assigning shapes with a modeling tool like Blender it seems like my only option is a Triangle Mesh shape but it seems like I should be able to get away with a cheaper (performance-wise) shape for something like this.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ bullet or havok are supposed to build bsp tree for your rooms. but am not sure what do you mean by shape, aren't you supposed to pass the polygons/triangles? \$\endgroup\$
    – concept3d
    Nov 25, 2013 at 7:15
  • \$\begingroup\$ Boxes are pretty efficient... Collision meshes are not in case you have too many triangles. \$\endgroup\$ Nov 25, 2013 at 15:13
  • \$\begingroup\$ The question is lacking cause it doesn't contain any details of the game level design. If the game is an FPS like Quake and HL where the rooms are very complex composite areas built from dozens or hundreds of convex shapes than obviously, this is the data you want to pass (unless the detail is just scenery and you can't walk to the complex detailed areas and they are just there for decor). If the rooms in the game are very simple, you may be able to get away with representing the walls, floors and ceilings as boxes. \$\endgroup\$
    – AturSams
    Mar 1, 2014 at 11:30

2 Answers 2

3
\$\begingroup\$

Boxes are not what you want; they are solid. (That is, they have a filled interior. Anything inside a box will be thrown out of it.)

Assuming you wrap the triangle mesh in some sort of bounding hierarchy (such as Havok's MOPP or Bullet's BvhTriangleMesh) you should not see any performance problems unless you are running massive numbers of casts or simulating massive numbers of objects. AAA games regularly represent level geometry with mesh shapes consisting of tens of thousands of triangles; if you have shapes as simple as you describe you should be fine.

\$\endgroup\$
0
\$\begingroup\$

Not all rooms, halls and pathways are born alike. Some games have very plain level design. For instance in some Beat'em Ups VS fighting games, classic RPGs and some other games, the rooms are sometimes very square and planar. If the rooms lack any complex detail that the player is supposed to interact with physically (as in jump on or bump into), you may be able to easy define walls as boxes. In most (99.9%) FPS, Adventure and modern third person RPG games you will likely not get away with that. In these games the level is very detailed and there are lots strangely shaped corridors, platforms, terrain and also maze-like structures that you simply load into the physics engine knowing the player will likely physically interact with it. You may however often want to have a detailed (high-poly) mesh for rendering purposes and a very rough (low-poly) one for physics.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .