Bullet collision tips

if i’m gonna use bullet physics and make my game maps in blender, what’s the best way to set up the collision solids for the map? can you / should you do this in blender, or should you do it programmatically somehow after you load the map model?

I’m not sure that there is a single “best” way to do it; different projects will be better served by different approaches, and different developers will prefer different approaches, I feel.

You can very much do this in Blender, I do believe. (At least in 2.78; I’m not sure about support in later versions.)

To start with, specify collision geometry in Blender as though for Panda’s collision system, and export as usual. Then, in your code, convert the resultant Panda collision geometry into Bullet collision geometry via the “fromCollisionSolids” method of the “BulletHelper” class.

This is also an option, depending on what works for you and for your project.

1 Like

thanks :slight_smile: that’s exactly what i’m looking for. I just found this in the ball maze bullet sample. documentation for bullet in general is really hard to come by x.x my project is a flight sim of sorts. and yes i’m using blender 2.79. my old timey computer won’t run blender 2.8+, which is part of why i am working with panda instead of unity/etc

1 Like

It’s my pleasure. :slight_smile:

I’m afraid that I’m not in a position to help with Blender 7.9–I use 7.8, as my workflow is built around elements that were changed in 7.9, I believe.

As to documentation for Bullet, do I take it that you’ve been through the Bullet section of the manual?

As for the surface, take a look at https://docs.panda3d.org/1.10/python/programming/physics/bullet/collision-shapes#triangle-mesh-shape

In any case, you must determine where you will make do with primitives and where with a grid of triangles. For example, it is better to represent a barrel as a cylinder as a primitive, and use a triangle mesh for the house. However, it is worth noting that in any case, you need to create a simplified geometry for the bullet. In other words, use high-poly for rendering, and low-poly for physics.

1 Like

As a heads up, blend2bam allows converting Blender’s rigid body properties to Bullet shapes for use in Panda.

1 Like