Simple problem. Have a rag-doll with 6-Dof constraints. Let's say a typical human body. Grabbing the head and moving it around feels like if the neck is made out of a rubber band as it stretches up to 3 times the length. This is really a nuisance as I know of no skeleton where bones stretch to 3 times their length.
I tried messing with the constraint parameters:
Code: Select all
int l;
for( l=0; l<3; l++ ){ // linear limits
generic6Dof->setParam( BT_CONSTRAINT_CFM, 0.0f, l ); // default 0.0f
generic6Dof->setParam( BT_CONSTRAINT_STOP_CFM, 0.0f, l ); // default 0.0f
generic6Dof->setParam( BT_CONSTRAINT_STOP_ERP, 0.2f, l ); // default 0.2f
}
btTranslationalLimitMotor &motorLinear = *generic6Dof->getTranslationalLimitMotor();
motorLinear.m_damping = 1.0f; // Damping for linear limit: default 1.0
motorLinear.m_limitSoftness = 0.7f; // Softness for linear limit: default 0.7
motorLinear.m_restitution = 0.5f; // Bounce parameter for linear limit: default 0.5
for( l=0; l<3; l++ ){ // angular limits
generic6Dof->setParam( BT_CONSTRAINT_CFM, 0.0f, 3 + l ); // Constraint force mixing factor: default 0.0
generic6Dof->setParam( BT_CONSTRAINT_STOP_ERP, 0.2f, 3 + l ); // Error tolerance factor when joint is at limit: default 0.2
generic6Dof->setParam( BT_CONSTRAINT_STOP_CFM, 0.0f, 3 + l ); // Constraint force mixing factor when joint is at limit: default 0.0
btRotationalLimitMotor &motorAngular = *generic6Dof->getRotationalLimitMotor( l );
motorAngular.m_damping = 1.0f; // Damping: default 1.0
motorAngular.m_limitSoftness = 0.5f; // Relaxation factor: default 0.5
motorAngular.m_bounce = 0.0f; // restitution factor: default 0.0
}
How can I disable this rubber-band effect?
If not where is the solving implemented (actually not in solve* in *LimitMotor as one expects) so I can hack it over to not be rubber-banding?