MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / reSkin

Method reSkin

Engine/source/T3D/tsStatic.cpp:643–681  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643void TSStatic::reSkin()
644{
645 if (isGhost() && mShapeInstance)
646 {
647 if (mSkinNameHandle.isValidString())
648 {
649 mShapeInstance->resetMaterialList();
650 Vector<String> skins;
651 String(mSkinNameHandle.getString()).split(";", skins);
652
653 for (S32 i = 0; i < skins.size(); i++)
654 {
655 String oldSkin(mAppliedSkinName.c_str());
656 String newSkin(skins[i]);
657
658 // Check if the skin handle contains an explicit "old" base string. This
659 // allows all models to support skinning, even if they don't follow the
660 // "base_xxx" material naming convention.
661 S32 split = newSkin.find('='); // "old=new" format skin?
662 if (split != String::NPos)
663 {
664 oldSkin = newSkin.substr(0, split);
665 newSkin = newSkin.erase(0, split + 1);
666 }
667 else
668 {
669 oldSkin = "";
670 }
671 mShapeInstance->reSkin(newSkin, oldSkin);
672 mAppliedSkinName = newSkin;
673 }
674 }
675 else
676 {
677 mShapeInstance->reSkin("", mAppliedSkinName);
678 mAppliedSkinName = "";
679 }
680 }
681}
682
683void TSStatic::processTick(const Move* move)
684{

Callers

nothing calls this directly

Calls 10

isValidStringMethod · 0.80
resetMaterialListMethod · 0.80
splitMethod · 0.80
substrMethod · 0.80
StringClass · 0.50
getStringMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45
findMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected