From 0e4b1c4d1ef43b3f5c0493204964093c2736327a Mon Sep 17 00:00:00 2001 From: Irlan Date: Fri, 28 Jun 2019 15:19:22 -0300 Subject: [PATCH] Reuse triangle area since we use the triangle plane as the (u, v) plane --- src/bounce/cloth/cloth.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/bounce/cloth/cloth.cpp b/src/bounce/cloth/cloth.cpp index 69a673c..cacc89c 100644 --- a/src/bounce/cloth/cloth.cpp +++ b/src/bounce/cloth/cloth.cpp @@ -190,10 +190,8 @@ b3Cloth::b3Cloth(const b3ClothDef& def) : B3_ASSERT(det != 0.0f); triangle->m_inv_det = 1.0f / det; - // Triangle area - b3Vec3 v1(du1, dv1, 0.0f); - b3Vec3 v2(du2, dv2, 0.0f); - triangle->m_alpha = 0.5f * b3Length(b3Cross(v1, v2)); + // Area + triangle->m_alpha = 0.5f * A2; // Create strech force b3StrechForceDef sfdef;