Include Rayleigh damping. Use struct instead of class. Update PinnedSoftBody test

This commit is contained in:
Irlan
2019-05-24 13:04:42 -03:00
parent 5e044795df
commit b6f504b371
7 changed files with 44 additions and 15 deletions

View File

@ -32,7 +32,7 @@ public:
b3SoftBodyDef def;
def.mesh = &m_mesh;
def.density = 0.2f;
def.E = 100.0f;
def.E = 1000.0f;
def.nu = 0.33f;
def.c_yield = 0.1f;
def.c_creep = 0.5f;
@ -40,6 +40,12 @@ public:
m_body = new b3SoftBody(def);
for (u32 i = 0; i < m_mesh.vertexCount; ++i)
{
b3SoftBodyNode* n = m_body->GetVertexNode(i);
n->SetDamping(0.2f);
}
u32 pinIndex = ~0;
float32 pinDot = -B3_MAX_FLOAT;
for (u32 i = 0; i < m_mesh.vertexCount; ++i)