//////////////////////////////////////////////////////////////////////////
| 535 | |
| 536 | /////////////////////////////////////////////////////////////////////////////// |
| 537 | bool |
| 538 | Skin::bindToCharacter(Character &character, SampleArray<PxVec4> &positions) |
| 539 | { |
| 540 | // currently we just bind everything to the 'thorax' (between neck and clavicles). |
| 541 | // Modify this if you need to do more elaborate skin binding |
| 542 | |
| 543 | mBindPos.resize(positions.size()); |
| 544 | Acclaim::Bone* bone = getBoneFromName(*character.mASFData, "thorax"); |
| 545 | if (bone == NULL) |
| 546 | return false; |
| 547 | |
| 548 | PxTransform boneTransform = computeBoneTransformRest(*bone); |
| 549 | PxTransform boneTransformInv = boneTransform.getInverse(); |
| 550 | |
| 551 | mBoneID = bone->mID - 1; |
| 552 | |
| 553 | for (PxU32 i = 0; i < positions.size(); i++) |
| 554 | { |
| 555 | mBindPos[i] = boneTransformInv.transform( |
| 556 | reinterpret_cast<const PxVec3&>(positions[i])); |
| 557 | } |
| 558 | |
| 559 | return true; |
| 560 | } |
| 561 | |
| 562 | /////////////////////////////////////////////////////////////////////////////// |
| 563 | bool |
nothing calls this directly
no test coverage detected