diff options
author | Ton Roosendaal <ton@blender.org> | 2004-05-31 16:08:50 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-05-31 16:08:50 +0400 |
commit | 4f457fa277754a0c34f07bfa02acad00bfb50731 (patch) | |
tree | 6d7b2ee97e62271035a422f7b8f05522b9a4d30e /source | |
parent | 2a41593932dfe1954291a72b599756f44fc73b62 (diff) |
Limit for Normalise() call was 0.000000001 or so. This is still far too
big, since a float can go to 10^-37. And, this value is still squared, so
a square root will not frustrate it.
Limit now is 10^-35, fixing disappearing faces in extreme small object
thats extreme close to a camera. (thanks OOPz!)
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/intern/arithb.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c index b3419bd9250..f7c70fe3686 100644 --- a/source/blender/blenlib/intern/arithb.c +++ b/source/blender/blenlib/intern/arithb.c @@ -93,8 +93,8 @@ float Normalise(float *n) float d; d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2]; - /* FLT_EPSILON is too large! A larger value causes normalise errors in a scaled down utah teapot */ - if(d>0.0000000000001) { + /* A larger value causes normalise errors in a scaled down models with camera xtreme close */ + if(d>1.0e-35F) { d= (float)sqrt(d); n[0]/=d; |