while looking into [#27057] noticed when the view and the transform center are 0,0,0 it gives NAN values.

This commit is contained in:
Campbell Barton 2011-04-20 09:46:45 +00:00
parent e0a81dd1a8
commit 0da889dff5

@ -244,6 +244,12 @@ 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);
/* 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;
}
}
}