Hello! I created my object but it has no collision with other similar objects. Is there a way to add collision to such objects without creating convex geometry. Adding material does not give anything.
Full project: jolt_custom_mesh.zip (4.0 MB)
Are these Box shapes?
In most/all physics engines you can’t make a Mesh collider that is dynamic. Mesh colliders aka polygon soups only work as static colliders.
If it is to be dynamic, you have to use convex hulls || box || sphere , or a “composite” object composed of multiple shapes.
Left is BoxShape and custom box, created via MeshShapeSettings. They can collide, but MeshShapeSettings cant collide with other MeshShapeSettings.
Right is MeshShapeSettings and MeshShapeSettings. They cant collide, but can collide with floor which is BoxShape.
Yes. Maybe for raycasting bullet with car need to use MeshShapeSettings, but for collision with world also need add convexhull and then car will be compoundMesh. Car convexmesh can collide good, but cant have holes.
Yeah. I think the optimal setup is to use MeshShape for most static geometry… like buildings, curbs, and structures…
HeightmapShape for the terrain/ground… ( can prevent falling through the terrain more effectively than MeshShape )
and box||sphere||capsule for the dynamic objects like cars/characters.
The reason MeshShape doesn’t work for dynamic objects, is because the most effective search structure for an unstructured mesh is a bvh tree… and bvh trees are most efficient when they are static. If they are used dynamically, they cause a lot of rebalancing/updating of the tree on the fly.