4

I am experimenting with rigid body physics using the game engine for a project.

This is the setup:

  • I have 2 long rectangular prisms with hole.
  • The 2 prisms are connected with a cylinder (acting as a dowel).
  • I locked translation and rotation for one of the prism and everything else is free to move and/or rotate.

And here's the problem:

The dowel and the free prism are going through the locked prism. Can someone please tell me what am I doing wrong? Thanks.

Here is the blend file: https://www.dropbox.com/s/o2y0pxk7ijk12bc/untitled.blend

Garrett
  • 6,596
  • 6
  • 47
  • 75
Icarus
  • 43
  • 1
  • 1
  • 4
  • @CoDEmanX Thank you. I should have done that in the very beginning :) – Icarus Feb 07 '14 at 17:39
  • I think its something about the Collision bounds, the rectangular prisms are actually convex, which is not suitable to be set as Box. – Leon Cheung Feb 07 '14 at 17:42
  • @LeonCheung That didn't work. I changed the prisms to convex hull and experimented with the margins but neither solved the issue. The dowel and prism still go through the other prism. – Icarus Feb 07 '14 at 17:56
  • @LeonCheung There isn't a concave setting. All I have is capsule, box, sphere, cylinder, cone, convex hull and triangular mesh. – Icarus Feb 07 '14 at 18:05
  • Sorry for typo, I mean they are CONCAVE. :P You may consider using the compound in Collision setting. Or try Triangle Mesh. And be sure to apply their scale. – Leon Cheung Feb 07 '14 at 18:11
  • I tried everything in collision bounds and nothing worked. same for compound. – Icarus Feb 07 '14 at 18:14
  • I noticed their scale has't been applied yet. Select them, Ctrl-A > Scale (or Rot/Scale). – Leon Cheung Feb 07 '14 at 18:18
  • Just applied scale. Still the same. Is rigid body the right physics type for what I am trying to do? – Icarus Feb 07 '14 at 18:21

1 Answers1

8

There are several problems in this file:

  1. Objects scale hasn't been applied;
  2. Setting Triangle Mesh here is required, since the prisms have holes, which means they are concave objects, so other collision types don't work well with them;
  3. Bound margin should be tweaked carefully, as well. Considering the distance between the surface, try smaller value;
  4. The two prisms stay too close to each other, which will cause "intersection" if bound margin is non-zero.

    Demo file_v3. Just FYI.


Added a demo video for better understanding.

Leon Cheung
  • 27,718
  • 11
  • 89
  • 161
  • That was magic. So the above 4 points you pointed out were the only problems? Or was there other issues? – Icarus Feb 07 '14 at 18:53
  • Basically true. However, as you see in the demo file, I locked some rotation and translation axis for a better result. That's the other nice thing to do in your case, but that's not the key here. – Leon Cheung Feb 08 '14 at 00:05
  • 1
    Ridgid Body simulation has a lot of issues with concave shapes. Sergey Reich works on a special "concave" type, but no schedule unfortunately. – CodeManX Feb 08 '14 at 00:29