mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-05 15:21:06 +00:00
Merge pull request #1428 from erwincoumans/master
fix a bug related to joint reaction forces (clearMultiBodyConstraintF…
This commit is contained in:
commit
6b2bd199b8
@ -1142,6 +1142,7 @@ int TinyRendererVisualShapeConverter::registerTexture(unsigned char* texels, int
|
|||||||
texData.m_width = width;
|
texData.m_width = width;
|
||||||
texData.m_height = height;
|
texData.m_height = height;
|
||||||
texData.textureData1 = texels;
|
texData.textureData1 = texels;
|
||||||
|
texData.m_isCached = false;
|
||||||
m_data->m_textures.push_back(texData);
|
m_data->m_textures.push_back(texData);
|
||||||
return m_data->m_textures.size()-1;
|
return m_data->m_textures.size()-1;
|
||||||
}
|
}
|
||||||
|
@ -136,6 +136,9 @@ btMultiBody::btMultiBody(int n_links,
|
|||||||
|
|
||||||
m_baseForce.setValue(0, 0, 0);
|
m_baseForce.setValue(0, 0, 0);
|
||||||
m_baseTorque.setValue(0, 0, 0);
|
m_baseTorque.setValue(0, 0, 0);
|
||||||
|
|
||||||
|
clearConstraintForces();
|
||||||
|
clearForcesAndTorques();
|
||||||
}
|
}
|
||||||
|
|
||||||
btMultiBody::~btMultiBody()
|
btMultiBody::~btMultiBody()
|
||||||
|
@ -411,6 +411,8 @@ void btMultiBodyDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo)
|
|||||||
|
|
||||||
BT_PROFILE("solveConstraints");
|
BT_PROFILE("solveConstraints");
|
||||||
|
|
||||||
|
clearMultiBodyConstraintForces();
|
||||||
|
|
||||||
m_sortedConstraints.resize( m_constraints.size());
|
m_sortedConstraints.resize( m_constraints.size());
|
||||||
int i;
|
int i;
|
||||||
for (i=0;i<getNumConstraints();i++)
|
for (i=0;i<getNumConstraints();i++)
|
||||||
@ -669,7 +671,7 @@ void btMultiBodyDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
clearMultiBodyConstraintForces();
|
|
||||||
|
|
||||||
m_solverMultiBodyIslandCallback->processConstraints();
|
m_solverMultiBodyIslandCallback->processConstraints();
|
||||||
|
|
||||||
|
@ -182,6 +182,8 @@ btVector3 m_appliedConstraintForce; // In WORLD frame
|
|||||||
m_cachedRVector.setValue(0, 0, 0);
|
m_cachedRVector.setValue(0, 0, 0);
|
||||||
m_appliedForce.setValue( 0, 0, 0);
|
m_appliedForce.setValue( 0, 0, 0);
|
||||||
m_appliedTorque.setValue(0, 0, 0);
|
m_appliedTorque.setValue(0, 0, 0);
|
||||||
|
m_appliedConstraintForce.setValue(0,0,0);
|
||||||
|
m_appliedConstraintTorque.setValue(0,0,0);
|
||||||
//
|
//
|
||||||
m_jointPos[0] = m_jointPos[1] = m_jointPos[2] = m_jointPos[4] = m_jointPos[5] = m_jointPos[6] = 0.f;
|
m_jointPos[0] = m_jointPos[1] = m_jointPos[2] = m_jointPos[4] = m_jointPos[5] = m_jointPos[6] = 0.f;
|
||||||
m_jointPos[3] = 1.f; //"quat.w"
|
m_jointPos[3] = 1.f; //"quat.w"
|
||||||
|
Loading…
Reference in New Issue
Block a user