| 690 | } |
| 691 | |
| 692 | void TSShape::addMeshToObject(S32 objIndex, S32 meshIndex, TSMesh* mesh) |
| 693 | { |
| 694 | TSShape::Object& obj = objects[objIndex]; |
| 695 | |
| 696 | // Pad with NULLs if required |
| 697 | S32 oldNumMeshes = obj.numMeshes; |
| 698 | if (mesh) |
| 699 | { |
| 700 | for (S32 i = obj.numMeshes; i < meshIndex; i++) |
| 701 | { |
| 702 | meshes.insert(obj.startMeshIndex + i, NULL); |
| 703 | obj.numMeshes++; |
| 704 | } |
| 705 | } |
| 706 | |
| 707 | // Insert the new mesh |
| 708 | meshes.insert(obj.startMeshIndex + meshIndex, mesh); |
| 709 | obj.numMeshes++; |
| 710 | |
| 711 | // Skinned meshes are not attached to any node |
| 712 | if (mesh && (mesh->getMeshType() == TSMesh::SkinMeshType)) |
| 713 | obj.nodeIndex = -1; |
| 714 | |
| 715 | // Fixup mesh indices for other objects |
| 716 | for (S32 i = 0; i < objects.size(); i++) |
| 717 | { |
| 718 | if ((i != objIndex) && (objects[i].startMeshIndex >= obj.startMeshIndex)) |
| 719 | objects[i].startMeshIndex += (obj.numMeshes - oldNumMeshes); |
| 720 | } |
| 721 | } |
| 722 | |
| 723 | void TSShape::removeMeshFromObject(S32 objIndex, S32 meshIndex) |
| 724 | { |
nothing calls this directly
no test coverage detected