[Bf-blender-cvs] [6efacde] fracture_modifier: fix for possible rotation glitch when converting back to objects

Martin Felke noreply at git.blender.org
Sun Jan 24 17:48:33 CET 2016


Commit: 6efacde5c05530e18dfd967d5d8dec1b612aebea
Author: Martin Felke
Date:   Sun Jan 24 17:46:35 2016 +0100
Branches: fracture_modifier
https://developer.blender.org/rB6efacde5c05530e18dfd967d5d8dec1b612aebea

fix for possible rotation glitch when converting back to objects

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

M	source/blender/editors/object/object_modifier.c

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

diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index ff83d4b..098bd42 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -2868,9 +2868,14 @@ static Object* do_convert_constraints(FractureModifierData *fmd, RigidBodyShardC
 	{
 		/*TODO XXX, take own transform into account too*/
 		float loc[3], rot[4], mat[4][4], size[3] = {1.0f, 1.0f, 1.0f};
-
-		copy_v3_v3(rbcon->loc, con->pos);
-		copy_qt_qt(rbcon->quat, con->orn);
+		mat4_to_quat(rot, ob->obmat);
+		mul_v3_m4v3(loc, ob->obmat, con->pos);
+		mul_qt_qtqt(rot, rot, con->orn);
+
+		copy_v3_v3(rbcon->loc, loc);
+		copy_qt_qt(rbcon->quat, rot);
+		quat_to_eul(rbcon->rot, rot);
+		quat_to_axis_angle(rbcon->rotAxis, &rbcon->rotAngle, rot);
 
 		loc_quat_size_to_mat4(mat, loc, rot, size);
 		copy_m4_m4(rbcon->obmat, mat);




More information about the Bf-blender-cvs mailing list