diff options
Diffstat (limited to 'servers/physics_3d/body_pair_3d_sw.cpp')
-rw-r--r-- | servers/physics_3d/body_pair_3d_sw.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/servers/physics_3d/body_pair_3d_sw.cpp b/servers/physics_3d/body_pair_3d_sw.cpp index ef4dca7dcf..28c854466f 100644 --- a/servers/physics_3d/body_pair_3d_sw.cpp +++ b/servers/physics_3d/body_pair_3d_sw.cpp @@ -281,6 +281,8 @@ bool BodyPair3DSW::setup(real_t p_step) { real_t inv_dt = 1.0 / p_step; + bool do_process = false; + for (int i = 0; i < contact_count; i++) { Contact &c = contacts[i]; c.active = false; @@ -323,6 +325,7 @@ bool BodyPair3DSW::setup(real_t p_step) { } c.active = true; + do_process = true; // Precompute normal mass, tangent mass, and bias. Vector3 inertia_A = A->get_inv_inertia_tensor().xform(c.rA.cross(c.normal)); @@ -350,7 +353,7 @@ bool BodyPair3DSW::setup(real_t p_step) { } } - return true; + return do_process; } void BodyPair3DSW::solve(real_t p_step) { @@ -594,6 +597,8 @@ bool BodySoftBodyPair3DSW::setup(real_t p_step) { real_t inv_dt = 1.0 / p_step; + bool do_process = false; + uint32_t contact_count = contacts.size(); for (uint32_t contact_index = 0; contact_index < contact_count; ++contact_index) { Contact &c = contacts[contact_index]; @@ -614,6 +619,7 @@ bool BodySoftBodyPair3DSW::setup(real_t p_step) { } c.active = true; + do_process = true; #ifdef DEBUG_ENABLED @@ -661,7 +667,7 @@ bool BodySoftBodyPair3DSW::setup(real_t p_step) { } } - return true; + return do_process; } void BodySoftBodyPair3DSW::solve(real_t p_step) { |