Infinite loop in debug-drawing of (violated, disabled) constraints

Post Reply
Leith
Posts: 2
Joined: Mon Mar 25, 2019 9:13 am

Infinite loop in debug-drawing of (violated, disabled) constraints

Post by Leith »

Hey guys, I may have stumbled on a small bug in btDiscreteDynamicsWorld::debugDrawWorld()

I have an armature of constrained dynamic rigidbodies, the constraints are disabled. After the physics step, but before debug-drawing, I manually constrain (ie teleport) the bodies to an animated skeleton (yeah I know, I could use kinematic bodies, and no constraints, there's a few reasons I choose to use dynamic bodies...) Now, since I have teleported my bodies, but not informed the constraints (which are disabled), those constraints are highly likely to have been violated - which should not matter, since they are disabled, right? Wrong!

The problem I'm trying to describe, is that btDiscreteDynamicsWorld::debugDrawWorld() does not check if a constraint is enabled, or in a valid state, prior to attempting to draw it - this leads me into an infinite loop with respect to drawing of angular limits of constraints.

I'm using Bullet 2.86.1 (I believe - it's the Urho3D Master branch).

I've managed to work around the issue by disabling rendering of constraint limits, but that's not really a satisfactory solution.
Anyone care to chime in?
Post Reply