Mercurial > hg > Game > Cerium
changeset 1379:13065ad17328 draft
collada moved but only my mac.
author | e095732 <e095732@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 26 Jan 2012 21:56:32 +0900 |
parents | 38c7e8b47c4b |
children | 3e303369c44b |
files | Renderer/Engine/Collada.cc |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/Renderer/Engine/Collada.cc Thu Jan 26 20:33:22 2012 +0900 +++ b/Renderer/Engine/Collada.cc Thu Jan 26 21:56:32 2012 +0900 @@ -314,7 +314,7 @@ } /* make triangle */ - int k=0,l=0; + int k=0,l=0,size=0; for (int i=0;i<s->vmember;i++) { if (s->vcount[i] == 4) { vertex_table[k++] = s->vertex_float->u.array[vertexp[l]]; @@ -324,10 +324,12 @@ vertex_table[k++] = s->vertex_float->u.array[vertexp[l+2]]; vertex_table[k++] = s->vertex_float->u.array[vertexp[l+3]]; l+=4; + size +=2; } else if (s->vcount[i]==3) { vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]]; vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]]; vertex_table[k++] = s->vertex_float->u.array[vertexp[l++]]; + size++; } } @@ -336,11 +338,14 @@ * pickup_normal,pickup_coordinate,pickup_textureの処理 * vcsumは頂点の数,countは面の数 */ - int count = s->vcsum / 3; + //int count = s->vcsum / 3; + int count = size / 3; //polygonの作成 sg->pp_num = (count + MAX_SIZE_TRIANGLE - 1) / MAX_SIZE_TRIANGLE; sg->pp = new PolygonPack[sg->pp_num]; - + sg->name = s->name; + sg->parent_name = "NULL"; + sg->size = size; for (int i = 0;i < sg->pp_num; i++ ){ PolygonPackPtr pp = sg->pp; TrianglePackPtr tri = pp[i].tri;