fixed the wrong dimension used to calculate the inertia tensor in btReducedSoftBodyHelpers

This commit is contained in:
jingyuc
2021-09-03 14:47:31 -04:00
parent e70fc6453b
commit f2e114fc81
20 changed files with 4294 additions and 8 deletions
@@ -138,7 +138,7 @@ void ReducedCollide::initPhysics()
// create volumetric reduced deformable body
{
std::string filepath("../../../examples/SoftDemo/");
std::string filepath("../../../examples/SoftDemo/beam/");
std::string filename = filepath + "mesh.vtk";
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createFromVtkFile(getDeformableDynamicsWorld()->getWorldInfo(), filename.c_str());
@@ -147,9 +147,12 @@ void ReducedCollide::initPhysics()
getDeformableDynamicsWorld()->addSoftBody(rsb);
rsb->getCollisionShape()->setMargin(0.1);
// rsb->scale(btVector3(1, 1, 1));
rsb->rotate(btQuaternion(btVector3(0, 1, 0), SIMD_PI / 2.0));
rsb->translate(btVector3(0, 2, 0)); //TODO: add back translate and scale
btTransform init_transform;
init_transform.setIdentity();
init_transform.setOrigin(btVector3(0, 2, 0));
rsb->transform(init_transform);
rsb->setStiffnessScale(10);
rsb->setDamping(damping_alpha, damping_beta);