remove normalize call in derived mesh GetNormal, its not done anywhere else.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 27 Apr 2011 04:57:57 +0000 (04:57 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 27 Apr 2011 04:57:57 +0000 (04:57 +0000)
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenlib/intern/math_vector_inline.c

index d6e90ffab1421c922d39371f1c3c6fbd01ec36ff..7d3219d917e3879019187be57402fc2ea1bad35b 100644 (file)
@@ -2558,7 +2558,6 @@ static void GetNormal(const SMikkTSpaceContext * pContext, float fNorm[], const
        else {
                const short *no= pMesh->mvert[(&pMesh->mface[face_num].v1)[vert_index]].no;
                normal_short_to_float_v3(fNorm, no);
-               normalize_v3(fNorm); /* XXX, is this needed */
        }
 }
 static void SetTSpace(const SMikkTSpaceContext * pContext, const float fvTangent[], const float fSign, const int face_num, const int iVert)
index ee9d49639734f62f1c9fa9c15e9b499edae4b3a4..24b677cc240059259345ca567cf13acefbecf8c3 100644 (file)
@@ -172,11 +172,7 @@ static void cdDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
 static void cdDM_getVertNo(DerivedMesh *dm, int index, float no_r[3])
 {
        CDDerivedMesh *cddm = (CDDerivedMesh*) dm;
-       short *no = cddm->mvert[index].no;
-
-       no_r[0] = no[0]/32767.f;
-       no_r[1] = no[1]/32767.f;
-       no_r[2] = no[2]/32767.f;
+       normal_short_to_float_v3(no_r, cddm->mvert[index].no);
 }
 
 static ListBase *cdDM_getFaceMap(Object *ob, DerivedMesh *dm)
index 75520bb8ba087c9de31090c23df4c55881fb23a2..9f6a8afe2d5792088ac4f7b76178c949de1bb49a 100644 (file)
@@ -424,14 +424,14 @@ MINLINE float normalize_v3(float n[3])
        return normalize_v3_v3(n, n);
 }
 
-MINLINE void normal_short_to_float_v3(float *out, const short *in)
+MINLINE void normal_short_to_float_v3(float out[3], const short in[3])
 {
        out[0] = in[0]*(1.0f/32767.0f);
        out[1] = in[1]*(1.0f/32767.0f);
        out[2] = in[2]*(1.0f/32767.0f);
 }
 
-MINLINE void normal_float_to_short_v3(short *out, const float *in)
+MINLINE void normal_float_to_short_v3(short out[3], const float in[3])
 {
        out[0] = (short)(in[0]*32767.0f);
        out[1] = (short)(in[1]*32767.0f);