Problems with cone twist constraint motor and capsule shape

Post Reply
Shephf
Posts: 4
Joined: Sat Apr 25, 2020 11:16 am

Problems with cone twist constraint motor and capsule shape

Post by Shephf »

I'm working on a 3D engine and currently integrating bullet physics. I've came across one strange behavior when using cone twist constraint with a motor and a capsule shape. I've made a video for this one:

https://www.youtube.com/watch?v=NDQoNJI2kQM

The setup is: 1 static body and 1 dynamic body attached to it via cone twist constraint. The constraint has a motor enabled with target at 45deg on one axis. When I use btConvexHullShape on a dynamic body everything is ok, even if I change center of mass (and recalculate local inertia via calculatePrincipalAxisTransform of course). But when I use btCapsuleShape I get some jittery behavior, which is strange since capsule is much simpler shape than a convex hull. I played around with center of mass of the capsule and noticed that at some angles it works fine. I've also tried to modify constraint parameters, in particular, lowering the bias factor (setting it to 0.1 for example) makes things a bit better, but still... I would like to understand why this happens.
Post Reply