| 763 | } |
| 764 | |
| 765 | void NvFlexExtUpdateInstances(NvFlexExtContainer* c) |
| 766 | { |
| 767 | c->mShapeTranslations.map(); |
| 768 | c->mShapeRotations.map(); |
| 769 | |
| 770 | for (int i=0; i < int(c->mInstances.size()); ++i) |
| 771 | { |
| 772 | NvFlexExtInstance* inst = c->mInstances[i]; |
| 773 | |
| 774 | // copy data back to per-instance memory from the container's memory |
| 775 | const int numShapes = inst->asset->numShapes; |
| 776 | const int shapeStart = inst->shapeIndex; |
| 777 | |
| 778 | if (shapeStart == -1) |
| 779 | continue; |
| 780 | |
| 781 | for (int s=0; s < numShapes; ++s) |
| 782 | { |
| 783 | ((Vec3*)inst->shapeTranslations)[s] = c->mShapeTranslations[shapeStart + s]; |
| 784 | ((Quat*)inst->shapeRotations)[s] = c->mShapeRotations[shapeStart + s]; |
| 785 | } |
| 786 | } |
| 787 | |
| 788 | c->mShapeTranslations.unmap(); |
| 789 | c->mShapeRotations.unmap(); |
| 790 | } |
| 791 | |
| 792 | void NvFlexExtDestroyAsset(NvFlexExtAsset* asset) |
| 793 | { |