From 0da889dff5515ebd2201874c7272398f5dc156b2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 20 Apr 2011 09:46:45 +0000 Subject: while looking into [#27057] noticed when the view and the transform center are 0,0,0 it gives NAN values. --- source/blender/editors/transform/transform_constraints.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 0012334cf92..e5e31a8e319 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -243,7 +243,13 @@ static void axisProjection(TransInfo *t, float axis[3], float in[3], float out[3 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; } } } -- cgit v1.2.3