setStiffness don't work?

maxwave

28-06-2006 20:58:35

If I correctly have understood, the stiffness determine friction of joint - the "force", which want to stop rotate of joint, or no? If I am not right, please tell me, what stiffness determine?
My hinge "play" very long and I want, that it's "playing" stop fastest.
I use string:

joint->setStiffness (1);

but behavior of joint don't changed.

maxwave

03-07-2006 20:07:35

Anybody look at this problem?

abecam

04-07-2006 11:05:31

If I understand well, it is more the rigidity of the joint: 1 mean it's almost solid, so it will have a very short play, but might become instable, 0 mean it's a lot elastic. So setting 1 is ok in theory, but it might be too much too, have you tried something like 0.9 ?

maxwave

04-07-2006 13:26:31

Yes, I set various Stiffness, and??? The behavior of joint is not change. I want, that my joint stop more fast. If stiffness is not correct for it, how I can set "damping" (friction) of joint? This parameter set only in callbacks of joints???

maxwave

04-07-2006 14:22:58

I was look on friction functions in customJoint class, but this functions are absent in a BasicJoints class. For example, how to set friction in Hinge joint?

abecam

04-07-2006 14:59:01

Well, you reach my limits :D So I hope someone more advanced can answer you. Though, for the friction, I think you have to define a behaviour in the callback, for instance you can apply an opposite force (this is friction, then how to find the right vector to apply it?), or stop the rotation (maybe a little bit tough)... But I haven't used that myself.

maxwave

04-07-2006 15:51:43

to All

Why I can set friction only in callbacks? Can I set friction directly, when I create joint? In customJoint I can set friction, but I hinge or slider no (only in callbacks) :(

walaber

04-07-2006 19:40:59

that's the way the original joints were designed. if you want to implement limits, or friction, you must do it in the joint callback. with Custom Joints, you also have to implement friction inside the submitConstraint() function, which is basically a callback anyway.

maxwave

05-07-2006 11:32:04

Thanks! :D

maxwave

05-07-2006 11:43:26

Then I must use userData of Joints, becuse my program import many joints with different settings. Can I put structure (which store settings) in userData and then push it in joints callbacks?

walaber

05-07-2006 19:34:12

just use a pointer to the data you need, and cast back to a pointer inside the callback.