clean up the damping codes

This commit is contained in:
jingyuc
2021-10-13 23:39:36 -04:00
parent bd6e49bcc1
commit d945e48af2
9 changed files with 45 additions and 41 deletions

View File

@@ -30,7 +30,7 @@
// static btScalar E = 50;
// static btScalar nu = 0.3;
static btScalar damping_alpha = 0.0;
static btScalar damping_beta = 0.0;
static btScalar damping_beta = 0.001;
static btScalar COLLIDING_VELOCITY = 4;
static int start_mode = 6;
static int num_modes = 20;
@@ -75,10 +75,11 @@ public:
void Ctor_RbUpStack()
{
float mass = 28;
// float mass = 8;
// float mass = 28;
float mass = 8;
btCollisionShape* shape = new btBoxShape(btVector3(0.5, 0.5, 0.5));
// btCollisionShape* shape = new btBoxShape(btVector3(0.5, 0.5, 0.5));
btCollisionShape* shape = new btBoxShape(btVector3(1, 1, 1));
btVector3 localInertia(0, 0, 0);
if (mass != 0.f)
shape->calculateLocalInertia(mass, localInertia);
@@ -205,7 +206,7 @@ void ReducedCollide::initPhysics()
// create volumetric reduced deformable body
{
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createReducedCube(getDeformableDynamicsWorld()->getWorldInfo(), start_mode, num_modes);
btReducedSoftBody* rsb = btReducedSoftBodyHelpers::createReducedBeam(getDeformableDynamicsWorld()->getWorldInfo(), start_mode, num_modes);
getDeformableDynamicsWorld()->addSoftBody(rsb);
rsb->getCollisionShape()->setMargin(0.1);