use b3ClothMesh as a constant resource

This commit is contained in:
Irlan
2018-07-22 13:44:34 -03:00
parent 7060f513ad
commit bea108510f
6 changed files with 63 additions and 58 deletions

View File

@ -97,7 +97,7 @@ public:
{
Test::Step();
b3ClothMesh* mesh = m_cloth->GetMesh();
const b3ClothMesh* mesh = m_cloth->GetMesh();
b3StackArray<b3Vec3, 256> tension;
tension.Resize(mesh->vertexCount);
@ -124,9 +124,9 @@ public:
{
b3ClothMeshTriangle* t = m_rectangleClothMesh.triangles + i;
b3Vec3 v1 = mesh->particles[t->v1]->GetPosition();
b3Vec3 v2 = mesh->particles[t->v2]->GetPosition();
b3Vec3 v3 = mesh->particles[t->v3]->GetPosition();
b3Vec3 v1 = m_cloth->GetVertexParticle(t->v1)->GetPosition();
b3Vec3 v2 = m_cloth->GetVertexParticle(t->v2)->GetPosition();
b3Vec3 v3 = m_cloth->GetVertexParticle(t->v3)->GetPosition();
b3Draw_draw->DrawSegment(v1, v2, b3Color_black);
b3Draw_draw->DrawSegment(v2, v3, b3Color_black);