Commit: a18b806004a1543ca68ec11f34ba2e1e79b909ad
Author: Brecht Van Lommel
Date:   Thu Oct 18 12:20:33 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBa18b806004a1543ca68ec11f34ba2e1e79b909ad

Fix use of uninitialized variable in cloth collision.

No apparent difference in a quick simulation, but was clearly wrong.

===================================================================

M       source/blender/blenkernel/intern/collision.c

===================================================================

diff --git a/source/blender/blenkernel/intern/collision.c 
b/source/blender/blenkernel/intern/collision.c
index 12549678939..d868a06d134 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -1360,12 +1360,12 @@ BLI_INLINE bool cloth_point_face_collision_params(const 
float p1[3], const float
        cross_v3_v3v3(r_nor, edge1, edge2);
        normalize_v3(r_nor);
 
+       sub_v3_v3v3(v0p2, p2, v0);
        nor_v0p2 = dot_v3v3(v0p2, r_nor);
        madd_v3_v3v3fl(p2face, p2, r_nor, -nor_v0p2);
        interp_weights_tri_v3(r_w, v0, v1, v2, p2face);
 
        sub_v3_v3v3(p1p2, p2, p1);
-       sub_v3_v3v3(v0p2, p2, v0);
        nor_p1p2 = dot_v3v3(p1p2, r_nor);
        *r_lambda = (nor_p1p2 != 0.0f ? nor_v0p2 / nor_p1p2 : 0.0f);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to