Page 1 of 1

[SOLVED] How to know if all constraints are met?

Posted: Sat Jul 04, 2015 10:43 am
by benelot
Hello!

I am writing a 3D creature simulator which evolves creatures over time. The creatures are built from rigidbody shapes and joint constraints. Since the creatures are automatically built from a specification, they usually have minor to major interpenetrations in the shapes. So far so good, because many creatures resolve their problems numerically (by wiggling around a bit and then they are quiet). Is there a simple way for me to know if all the constraints are met or if it is still trying to resolve?

Thanks for your answer!

Re: How to know if all constraints are met?

Posted: Mon Jul 06, 2015 1:44 pm
by benelot
Ok, I found out that it has something to do with:

Code: Select all

joint.getAppliedImpulse()
and the force and torque vectors of

Code: Select all

joint.getJointFeedback()
I am going to investigate if I can differentiate a numerical solving from the general force that is applied to keep the limbs attached.

Re: How to know if all constraints are met?

Posted: Sat Jul 11, 2015 10:01 am
by benelot
Anybody?

Re: How to know if all constraints are met?

Posted: Mon Jul 13, 2015 2:46 am
by Basroil
Not sure what you're trying to solve or how physics plays a role in it.

If you are just asking "when are collision/friction/joint constraints done resolving for a single step", then the answer is easy, the constraints are either violated (solution is outside the viable solution space) or solved (a set of forces within your solution space results in a constraint being possible) by the end of your step.

Re: How to know if all constraints are met?

Posted: Mon Jul 13, 2015 9:54 pm
by benelot
Hi Basroil,

What I am trying to do is basically this. Think of a number of rigid bodies (let us say boxes for simplicity) and a number of generic joint constraints that hold them together. The definitions of the joint constraint rotation limits and the rigid bodies connected via the constraint are randomly chosen. So in some cases, the box and joint constraint system is solvable (and the boxes properly snap together in the physics world), in other situations, the system is ill-defined and the solution is outside the viable solution space and will never be found by the solver.

My question is now if I can determine if the system is ill-defined or not. I expect it to be done by putting the system into the physics world and let is solve and then ask the system, whether all the constraints hold or not. Or how can this be done?

Thanks for your answer!

Re: How to know if all constraints are met?

Posted: Fri Aug 07, 2015 9:22 pm
by benelot
So how can I check if a constraint is violated?

Re: How to know if all constraints are met?

Posted: Tue Aug 18, 2015 1:34 pm
by benelot
I fixed my problem by looking at the penetration depth between all boxes as I described here:

http://www.bulletphysics.org/Bullet/php ... =9&t=10741

By that I could find out if there are still some constraints that are not properly resolved, because the interpenetration is not yet solved.