| 125 | } |
| 126 | |
| 127 | TSMesh* AppMesh::constructTSMesh() |
| 128 | { |
| 129 | TSMesh* tsmesh; |
| 130 | if (isSkin()) |
| 131 | { |
| 132 | TSSkinMesh* tsskin = new TSSkinMesh(); |
| 133 | tsmesh = tsskin; |
| 134 | |
| 135 | // Copy skin elements |
| 136 | tsskin->weight = weight; |
| 137 | tsskin->boneIndex = boneIndex; |
| 138 | tsskin->vertexIndex = vertexIndex; |
| 139 | tsskin->batchData.nodeIndex = nodeIndex; |
| 140 | tsskin->batchData.initialTransforms = initialTransforms; |
| 141 | tsskin->batchData.initialVerts = initialVerts; |
| 142 | tsskin->batchData.initialNorms = initialNorms; |
| 143 | } |
| 144 | else |
| 145 | { |
| 146 | tsmesh = new TSMesh(); |
| 147 | } |
| 148 | |
| 149 | // Copy mesh elements |
| 150 | tsmesh->verts = points; |
| 151 | tsmesh->norms = normals; |
| 152 | tsmesh->tverts = uvs; |
| 153 | tsmesh->primitives = primitives; |
| 154 | tsmesh->indices = indices; |
| 155 | tsmesh->colors = colors; |
| 156 | tsmesh->tverts2 = uv2s; |
| 157 | |
| 158 | // Finish initializing the shape |
| 159 | tsmesh->setFlags(flags); |
| 160 | tsmesh->updateMeshFlags(); |
| 161 | tsmesh->computeBounds(); |
| 162 | tsmesh->numFrames = numFrames; |
| 163 | tsmesh->numMatFrames = numMatFrames; |
| 164 | tsmesh->vertsPerFrame = vertsPerFrame; |
| 165 | tsmesh->createTangents(tsmesh->verts, tsmesh->norms); |
| 166 | tsmesh->encodedNorms.set(NULL,0); |
| 167 | |
| 168 | return tsmesh; |
| 169 | } |
| 170 | |
| 171 | bool AppMesh::isBillboard() |
| 172 | { |
no test coverage detected