mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-10-31 13:05:35 +00:00
fixed the wrong dimension used to calculate the inertia tensor in btReducedSoftBodyHelpers
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user