[Bf-blender-cvs] [a18b806004a] blender2.8: Fix use of uninitialized variable in cloth collision.

Brecht Van Lommel noreply at git.blender.org
Thu Oct 18 13:36:50 CEST 2018


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);



More information about the Bf-blender-cvs mailing list