now b3World is responsable for creating or destroying b3Cloth; clean up; update tests

This commit is contained in:
Irlan
2018-05-26 00:41:41 -03:00
parent 8d2affb0b2
commit 43013ad80b
13 changed files with 218 additions and 204 deletions

View File

@ -49,18 +49,18 @@ public:
def.kd = 0.0f;
def.r = 0.05f;
m_cloth.Initialize(def);
m_cloth = m_world.CreateCloth(def);
b3AABB3 aabb;
aabb.m_lower.Set(-5.0f, -1.0f, -6.0f);
aabb.m_upper.Set(5.0f, 1.0f, -4.0f);
for (u32 i = 0; i < m_cloth.GetParticleCount(); ++i)
for (u32 i = 0; i < m_cloth->GetParticleCount(); ++i)
{
b3Particle* p = m_cloth.GetParticle(i);
b3Particle* p = m_cloth->GetParticle(i);
if (aabb.Contains(p->position))
{
m_cloth.SetType(p, e_staticParticle);
m_cloth->SetType(p, e_staticParticle);
}
}
}