# unexpected reactions in a quiet simple rigidbody physics simulation

Try the following scenario:

scene:
Add a cube; add a UVsphere; move sphere on X axis until less than half sphere intersects the cube. make a duplicate of sphere; apply boolean on cube (difference with sphere); add a plane; move it just a little below of them.

physics:
set rigidbody for all; adjust collision-shape (c.s) for plane=mesh; cutted-cube={chull, mesh) and sphere={sph, chull, mesh}. adjust mass to whatever you like; set in the world setting: check impulse; increase steps 300; iteration 50. play as you can.

Now check the following animations: Unfortunately we couldn't find a setting that makes this very simple physics working properly. The cube and sphere shouldn't react each other horizontally at all, bouncing should stop immediately! our simulations are just disappointing so far, for us :(

• scaling objects even 20 times didn't work but added additional problems.

original sizes

all scaled 20 times

Note: there are some similar posts such as one of ours. here we aimed to go to details with a simplistic model possible. In complex simulations, such odd things are too hard to be seen. We think there should be quiet technical reasons for these unrealistic effects and hopefully a way to solve them.

• To add that we've already considered all the ideas given in previous posts. – Developer Jan 9 '14 at 5:38
• To express how annoying would be the above issue if exists in complex simulation you may try this: >add a plane, scale 5 times;>add a cube, move up to 3>[edit mode]sudivide cube 3 times;[object mode]apply cell fracture on cube{source limit:0, noise:1, margin:0.002}>hide cube>select cube_cell.001,apply rigidbody{active,mesh:margin=0}>select all shards>[rigidbody tools]copy from active>still all selected:Ctrl+Alt+Shift+C.>select plane>rigidbody{passive,box:collision.margin0.04}>rigidbody world{split impulse,steps100}: play: Explosion!!!? – Developer Jan 9 '14 at 9:36

I had no problems with the following settings:

• Split Impulse enabled in Scene > Rigid body world:

• Both the cube and the sphere with Mesh collision shape and Margin set to 0.

It is important in this case to set the Margin to 0 because the collision margin for mesh is not embedded into the object, so it will collide with objects that are near the object's surface but not actually touching it (unless it's set to 0).

It is also important to use the Mesh collision shape in this case, because Convex hull will collide with any objects in a convex part of the mesh.

To visualize this, have a look at the convex hull operator. Try applying it on a Suzanne, the result is roughly what Suzanne's collision shape would be if it was set to convex hull:

Applied to your cube object, you can see why it was causing a collision with the sphere:

Mesh is currently the only collision shape that can handle collisions with concave shapes. There was another shape developed in GSoC 2013 which also could handle concave shapes by breaking them into smaller convex shapes, however this is not yet integrated with blender officially.

The reason why Mesh is necessary for the sphere is because the sphere you are using is not a perfect sphere, while the collision shape is.

Since the concave depression in the cube exactly matches the "facets" of the UV sphere and the Sphere collision shape's radius is equal to the longest dimension of the object's bounding box, the sphere collision shape will intersect the cube slightly and cause a collision.

To visualize this, I have added a highly subdivided sphere to simulate the perfect sphere of the collision shape and scaled it so that it's radius is equal to the dimension of the UV sphere. I then used Clipping border to make only a tiny cross section visible:

As you can see, the "perfect sphere" intersects the cube, causing a collision to be detected:

• The ground cube set to Box collision shape with a .04 margin (the margin is embedded for the box collision shape).

• All objects have scale applied (CtrlA) and origins centered (ShiftCtrlAltC).

Result:

Example blendfile

• Well, we have tried all combinations and are frustrated. Could be it a problem in the software that we have it? We tried both in 32 and 64 the same scene file. The results are disappointing. – Developer Jan 9 '14 at 8:00
• @Developer Here's the file, does it still act up for you? – gandalf3 Jan 9 '14 at 8:03
• We checked your file. It acts almost identical to your animation above. Look we had applied all the lessons we learned from previous post. If you never experienced similar situations as in our animations in the post we may conclude that either there is a bug in physics simulation engine (which is hard to justify due to this sort of problems happens randomly but frequently) or unknown corruption in our installation. When apply similar concept on shards of fractured object it becomes more and more annoying. – Developer Jan 9 '14 at 8:53
• @Developer You're using 2.69? – gandalf3 Jan 9 '14 at 8:58
• If you check stacker's answer and our comment there you may see his/her simulation shows at least one of the problem mentioned in our question, why they move horizontally immediately from the beginning!? – Developer Jan 9 '14 at 8:58

With the default settings only the cube and spheres type set to Active and *Rigid Body Collision** set to Mesh the described behaviour doesn't occur. (Plane set to passive,mesh)

Result:

• Note that there are many issues explained in our post. As in the question we have tried all mesh, etc for collision-shape. Your simulation shows they rest on the plane (which is good) however even in your simulation (which differs from our noticeably and we don't know why) it seems that the sphere runs away from the hole immediate after starting simulation (it should go down together with cube and so with no horizontal move at all). Check that. – Developer Jan 9 '14 at 7:58