diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 15:05:52 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-05-13 15:05:52 +0400 |
commit | 305d341ec2c2c5c6485ad6cd719e9472e4bb460d (patch) | |
tree | fa4c658ad417869a0ed2e7ef5f37ca94adb2cc3b /source/gameengine/Converter | |
parent | 13bbf1cc7b0a620173475172278d2f8eb9593ccd (diff) |
code cleanup: use vector math function minmax_v3v3_v3() and other minor vector function edits.
Diffstat (limited to 'source/gameengine/Converter')
-rw-r--r-- | source/gameengine/Converter/BL_BlenderDataConversion.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 14362cd8f06..196f032e584 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1375,16 +1375,17 @@ static float my_boundbox_mesh(Mesh *me, float *loc, float *size) if (!size) size= msize; mvert= me->mvert; - for (a=0; a<me->totvert; a++, mvert++) { - co= mvert->co; + for (a = 0; a<me->totvert; a++, mvert++) { + co = mvert->co; /* bounds */ - DO_MINMAX(co, min, max); + minmax_v3v3_v3(min, max, co); /* radius */ - vert_radius= co[0]*co[0] + co[1]*co[1] + co[2]*co[2]; + + vert_radius = len_squared_v3(co); if (vert_radius > radius) - radius= vert_radius; + radius = vert_radius; } if (me->totvert) { @@ -1432,8 +1433,8 @@ static void my_tex_space_mesh(Mesh *me) INIT_MINMAX(min, max); fp= (float *)kb->data; - for (a=0; a<kb->totelem; a++, fp+=3) { - DO_MINMAX(fp, min, max); + for (a=0; a<kb->totelem; a++, fp += 3) { + minmax_v3v3_v3(min, max, fp); } if (kb->totelem) { loc[0]= (min[0]+max[0])/2.0f; loc[1]= (min[1]+max[1])/2.0f; loc[2]= (min[2]+max[2])/2.0f; |