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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-04-27 08:57:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-27 08:57:57 +0400
commitee2ddfc58a14bd6680a8bb7e63472d290913d853 (patch)
tree7aa8d49146ed3906c5e5a93dd092f80bc1ef6c15 /source
parent1860c0c56585a132e0e4ee0798158f0f598cf6f8 (diff)
remove normalize call in derived mesh GetNormal, its not done anywhere else.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c1
-rw-r--r--source/blender/blenkernel/intern/cdderivedmesh.c6
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c4
3 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index d6e90ffab14..7d3219d917e 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -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)
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c
index ee9d4963973..24b677cc240 100644
--- a/source/blender/blenkernel/intern/cdderivedmesh.c
+++ b/source/blender/blenkernel/intern/cdderivedmesh.c
@@ -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)
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index 75520bb8ba0..9f6a8afe2d5 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -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);