Setting up physics for different models

Started by
2 comments, last by Krohm 10 years, 10 months ago

Which shapes are appropriate to use for setting up physics for different kinds of meshes?

Such as:

- Building

- Tank

- Airstrike/Helicopter

- Character

I thought about using btConvexHullShape for buildings, not sure if that's a good idea, but I need some advise related to setting up physics shapes.

Advertisement

The simplest possible compounds of: Box, Capsule, Sphere.

I need alittle bit more of details.

- Can I use btConvexHullShape for buildings?

- What should I use for enemy character? Capsule?

- What shape is appropriate for tanks and airstrikes? (remember that the tank will be moving so I can NOT use a box shape also the airstrike could move on the terrain (e.g: taking off)

btConvexHullShape is quite fast in my experience. Not as fast as the box but still very viable. Use it whatever you see fit.

Keep in mind that you probably don't really want to create an association between a resource type and a collision shape. Have the resource encode its own collision shape, pull it out the asset. Use a special texture, a node name, an annotation to figure out what set of vertices to use and how.

- What shape is appropriate for tanks and airstrikes? (remember that the tank will be moving so I can NOT use a box shape also the airstrike could move on the terrain (e.g: taking off)

Moving has no relation with collision shapes in Bullet. Collision shapes are "eternal" entities and does not really exist. They are instanced using btCollisionObject or btRigidBody. If you need to move a btRigidBody then you have to mark it kinematic. That said:
  • The tank would be a kinematic object, eventually with its own ghost object sensor.
  • The airstrike (or better, the airplanes bombing the place) are pretty much the same thing.
  • The explosions would probably be instant collision queries with spheres and won't even exist in the world.

Previously "Krohm"

This topic is closed to new replies.

Advertisement