Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-25 20:51:16 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-11-25 20:51:16 +0300
commit55d2a56d6020a5d286d5d44f7d2d8a8d0bc9bf58 (patch)
tree959cb7abcf1ab92caa28fa5a5156520f08f9936d /source/blender/blenkernel/intern/CCGSubSurf.c
parent077edbb384e3845f27cc06618046a08c7101cc4c (diff)
parentf1fa79a59554cb36ebee0a569a7b0f442fef6646 (diff)
Sculpt:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r24483:24889
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf.c')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c
index 86595dea8fb..7c2c6d4d99e 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf.c
@@ -3,12 +3,15 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#include <float.h>
#include "CCGSubSurf.h"
#include "BLO_sys_types.h" // for intptr_t support
+/* used for normalize_v3 in BLI_math_vector
+ * float.h's FLT_EPSILON causes trouble with subsurf normals - campbell */
+#define EPSILON (1.0e-35f)
+
/***/
typedef unsigned char byte;
@@ -593,7 +596,7 @@ void _face_calcIFNo(CCGFace *f, int lvl, int S, int x, int y, float *no, int lev
length = sqrt(no[0]*no[0] + no[1]*no[1] + no[2]*no[2]);
- if (length>FLT_EPSILON) {
+ if (length>EPSILON) {
float invLength = 1.f/length;
no[0] *= invLength;
@@ -1232,7 +1235,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
length = sqrt(no[0]*no[0] + no[1]*no[1] + no[2]*no[2]);
- if (length>FLT_EPSILON) {
+ if (length>EPSILON) {
float invLength = 1.0f/length;
no[0] *= invLength;
no[1] *= invLength;
@@ -1291,7 +1294,7 @@ static void ccgSubSurf__calcVertNormals(CCGSubSurf *ss,
float *no = FACE_getIFNo(f, lvl, S, x, y);
float length = sqrt(no[0]*no[0] + no[1]*no[1] + no[2]*no[2]);
- if (length>FLT_EPSILON) {
+ if (length>EPSILON) {
float invLength = 1.0f/length;
no[0] *= invLength;
no[1] *= invLength;