So, a couple comments on this. First, I don't really know why updateConstants() is being called at the end of every transform call (and scale call). It isn't 100% clear to me what all parts of the function are doing, but I don't think it's necessary, and I might suggest removing the call from transform(...) and scale(...). Second, I have also previously been making a direct manual call to updateConstants() whenever I change the value of m_cfg.kLST for the soft body. I was doing this because the only place where kLST appears to be used anywhere is one line of calculation in updateConstants(). But with the realization that updateConstants() is messing with the "natural" state of the soft body, I wouldn't want to be making this call anymore. But if I don't, the new kLST will not take effect, unless I manually do the kLST-relevant adjustments that updateConstants() was doing...
This problem is most noticeable when translating/scaling a soft body that is currently "bent out of shape" already, such as one under pressure. A reproducible case can be shown in the 2.77 release softdemo.cpp by adding the indicated line at the bottom of the for loop below to SoftDemo::renderme() and then running the SoftBody "Pressure" demo:
Code: Select all
void SoftDemo::renderme()
{
btIDebugDraw* idraw=m_dynamicsWorld->getDebugDrawer();
glDisable(GL_TEXTURE_2D);
m_dynamicsWorld->debugDrawWorld();
/* Bodies */
btVector3 ps(0,0,0);
int nps=0;
btSoftBodyArray& sbs=getSoftDynamicsWorld()->getSoftBodyArray();
for(int ib=0;ib<sbs.size();++ib)
{
btSoftBody* psb=sbs[ib];
nps+=psb->m_nodes.size();
for(int i=0;i<psb->m_nodes.size();++i)
{
ps+=psb->m_nodes[i].m_x;
}
psb->translate(btVector3(0, 0.1, 0)); // *** ADD THIS LINE ***
}
...
...
...
Comments? Erwin, I can file a bug report if needed...