[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [36238] trunk/blender/source/blender/ editors/transform/transform_constraints.c: while looking into [#27057] noticed when the view and the transform center are 0, 0, 0 it gives NAN values.

Campbell Barton ideasman42 at gmail.com
Wed Apr 20 11:46:46 CEST 2011


Revision: 36238
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=36238
Author:   campbellbarton
Date:     2011-04-20 09:46:45 +0000 (Wed, 20 Apr 2011)
Log Message:
-----------
while looking into [#27057] noticed when the view and the transform center are 0,0,0 it gives NAN values.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/transform/transform_constraints.c

Modified: trunk/blender/source/blender/editors/transform/transform_constraints.c
===================================================================
--- trunk/blender/source/blender/editors/transform/transform_constraints.c	2011-04-20 09:41:44 UTC (rev 36237)
+++ trunk/blender/source/blender/editors/transform/transform_constraints.c	2011-04-20 09:46:45 UTC (rev 36238)
@@ -243,7 +243,13 @@
 			
 			sub_v3_v3v3(v, i2, v);
 	
-			sub_v3_v3v3(out, i1, t->con.center);
+			sub_v3_v3v3(out, i1,  t->con.center);
+
+			/* possible some values become nan when
+			 * viewpoint and object are both zero */
+			if(!finite(out[0])) out[0]= 0.0f;
+			if(!finite(out[1])) out[1]= 0.0f;
+			if(!finite(out[2])) out[2]= 0.0f;
 		}
 	}
 }




More information about the Bf-blender-cvs mailing list