A problem with small rigid bodies

Godot Version

4.3 dev and 4.2 stable

Question

I would like to give an example of application: Imagine that you want to build a child’s room, and inside it you want to place a row of domino pieces. The room can be a few meters in size and the pieces can be a few centimeters in size.

MY PROBLEM: Small rigid bodies (whose dimensions are a few centimeters). To properly identify the problem I made a simple test scene. In my scene (root node) I do the following constructions…

I create a “floor”: A StaticBody3D node with position (0,0,0), which has a child MeshInstance3d, wich uses a PlaneMesh resource (by default 2m x 2m). Having chosen the MeshInstance3d node, I click on the Mesh button in the toolbar (above the scene display area) and choose “Create Single Convex Collision Sibling” (it creates a CollisionShape3D)

I create a “Big” block: A RigidBody3D node with position (0.5,0.51,0.5), which has a child MeshInstance3d, and uses a BoxMesh resource (by default 1mx1mx1m). Having chosen the MeshInstance3d node, I click on the Mesh button the toolbar (above the scene display area) and choose “Create Single Convex Collision Sibling” (it creates a CollisionShape3D)

I create a “Small” block: A RigidBody3D node with position (-0.5,0.01,-0.5), which has a child MeshInstance3d, and uses a BoxMesh resource. I make it unique and set its Size property to 0.01 in all three directions. Having chosen the MeshInstance3d node, I click on the Mesh button in the toolbar (above the scene display area) and choose “Create Single Convex Collision Sibling” (it creates a CollisionShape3D)

Additionally I added a camera and light to the scene…

When I play the scene, the Big block rests on the floor as expected. But the small block crosses the floor and falls to the unknow. I have repeated this test placing that block higher but the result is the same. Then I also created a floor using a BoxMesh (that is, it has a certain thickness). But for a thickness of 0.01 the small block also passes through it and for a thickness of 0.02 or greater the small block remains vibrating erratically, partially penetrated into the box (the floor).

Additionally, the orange boxes (I think they are called “bounding boxes”) look too big for small MeshInstance3D nodes. Also when the body is not a cube the orange box of CollisionShape3D nodes can protrude in some direction.

I would like to know if there is a way to make physics work better at the 0.01 size scale or if the only alternative is to make everything larger. I feel that the coexistence of objects with a size ratio of 1 to 100 is perfectly expected, but perhaps I am wrong.

Thank you very much in advance

Maybe if you give the floor more geometry it will work? I know for a fact that thats the case in blender. In the mesh properties you can turn up the subdivide width and depth and then make a collisionshape? If the floor is really big you may have to turn it up a bunch like maybe more than 10.

1 Like

This is a common problem that most engines have. Very small objects and physics always have these issues, probably rounding issues with small numbers.

Just make things bigger in general.

I don’t know, can I do that in GODOT?
Edit: Yes I can… But it doesn’t solve anything

1 Like

I have tried, I performed the same test above making everything 100 times larger (sizes and distances). In that case the rigid bodies work well… but another problem arises, when I want to use a SpotLight3D I also have to multiply the value of the “Range” property by 100 (because everything is 100 times further away). For high values, the light turns off completely or partially (lighting zones generated by blocks).

You can see what I’m saying in this image:

It’s like a kind of short blanket. If I want to cover my head, my feet will uncover…

You probably need to add some directional lighting into the scene then or up it a little so you dont have to rely on point lights so much from the objects.

I understand what you’re saying, maybe combining it with another light can help. But the type of lighting would not be the same.