From b5edb9b1c7d4358c6550f8e0c61610e56be3e5a5 Mon Sep 17 00:00:00 2001 From: Irlan Date: Sat, 4 May 2019 15:56:47 -0300 Subject: [PATCH] Update soft_body.h --- examples/testbed/tests/soft_body.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/testbed/tests/soft_body.h b/examples/testbed/tests/soft_body.h index 562c894..aae10ce 100644 --- a/examples/testbed/tests/soft_body.h +++ b/examples/testbed/tests/soft_body.h @@ -210,10 +210,14 @@ public: // Pressure force b3Vec3 FP = Pn * A; + const float32 inv3 = 1.0f / 3.0f; + + b3Vec3 f = inv3 * FP; + // Distribute - p1->ApplyForce(FP); - p2->ApplyForce(FP); - p3->ApplyForce(FP); + p1->ApplyForce(f); + p2->ApplyForce(f); + p3->ApplyForce(f); } }