BGE Collision detection for very close objects


I’m playing around with BGE and I’ve set up a couple of gears, one with a fixed angular velocity, the other intended to freely spin. both are constrained to static axles with rigid body joint modifiers, and both have convex hull collision detection enabled (margins set to zero). Even though they only rotate (and on the same axis), I find I cannot constrain translation, or the collision detection fails. However, when I leave it unchecked, the gears begin spinning very quickly (it seems as though they’re speeding each other up).

I solved that by setting the mass of the driving gear very high, however, the free spinning gear now “jumps” off it’s axle a bit when the engine starts and the gears sort of lock up.

Anyway, I imagine I’m trying to simulate something with tolerances that are just too tight for BGE’s collision detection to handle. Still, I was wondering if anyone had opinions on what I might be able to do to work past that.

I’m using Blender 2.70, BTW.


You set convex hull on a gear, that intersects with another gear?

Use the triangle mesh option for precision collision detection.

Perfect! Should have been obvious that a gear doesn’t exactly make a convex hull. I was so focused on modifiers and constraints, I didn’t think to RTFM about collision meshes… Once I did that and scaled the teeth back a bit it, it worked perfectly.

There is, however, one other little issue that I’m not sure where the error lies… I built a much larger gear and set it adjacent to one of the two gears I’d created. When I run it, the larger gear does not move, though it’s set to rigid body. I have it set up identically to the other two gears, so I’m not sure what could cause it to fail to detect the collision.

I’m wondering if perhaps it has to do with the size of the gear? If I release the rigid joint translation locks, the large gear goes spinning and flying off the axle. It just won’t rotate…

Any thoughts? Perhaps I need to use a custom collision mesh instead of triangle?