Archive 17/01/2023.

Rigidbodies does not collide

nergal

I have multiple rigid bodies with mass = 0 (they are static chunks in the world). Then I create chunks with mass that should collide with the world. But as you can see on the gif below, they don’t collide. They just fall by. But when I create small boxes with 1x1x1 in size, the boxes collide with the “world” bodies that has no mass.

I can’t see what I’m missing here, I really need some help.

Eugene

Only convex shapes are allowed to be dynamic. Triangle meshes are not.

nergal

Hm, but they seem to collide with each other?

nergal

ok! Now I see, creating a box around for the shape works good. Are there any plans to add Triangle mesh shapes for dynamic?

slapin

There are convex hulls which work.

Eugene

Note: In order to use convex hulls you have to decompose your mesh into convex subshapes.

Eugene

I’ve just added it.
It is available here GitHub - eugeneko/Urho3D: Cross-platform 2D and 3D game engine, will push it as soon as CI passes.
Use GImpactMesh shape type to allow triangle mesh be dynamic.

slapin

Isn’t Bullet momentum calculation will be off in case of non-convex mesh? I remember something like that,
did not try it myself though.

Eugene

I don’t know. If you mean inertia, I think it should be calculated for each dynamic object.
However, push me if you remember something more concrete.

1vanK

Most physics engines use “Separating Axis Theorem” for fast detection of collisions, but it requires convex shapes. Triangle to triangle collision uses something like brute force and is unsuitable for practical use in games

slapin

I mean shape which is used to calculate inertia should be convex for inertia to be correct. Otherwise you need to override
using btCompoundShapes btCompoundShape::calculatePrincipalAxisTransform. I mean inertia tensor of course.

This hit me very badly with vehicles behavior, so I had to learn all this things. This happens with convex hulls too,
but definitely will affect non-convex shapes.
BTW it is a way for Bullet to override “momentum shape” (inertia tensor) if anybody wishes for proper vehicle dynamics
like me.