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

Method reSkin

Engine/source/T3D/player.cpp:1932–1966  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1930//----------------------------------------------------------------------------
1931
1932void Player::reSkin()
1933{
1934 if ( isGhost() && mShapeInstance && mSkinNameHandle.isValidString() )
1935 {
1936 mShapeInstance->resetMaterialList();
1937 Vector<String> skins;
1938 String(mSkinNameHandle.getString()).split( ";", skins );
1939
1940 for ( S32 i = 0; i < skins.size(); i++ )
1941 {
1942 String oldSkin( mAppliedSkinName.c_str() );
1943 String newSkin( skins[i] );
1944
1945 // Check if the skin handle contains an explicit "old" base string. This
1946 // allows all models to support skinning, even if they don't follow the
1947 // "base_xxx" material naming convention.
1948 S32 split = newSkin.find( '=' ); // "old=new" format skin?
1949 if ( split != String::NPos )
1950 {
1951 oldSkin = newSkin.substr( 0, split );
1952 newSkin = newSkin.erase( 0, split+1 );
1953 }
1954
1955 // Apply skin to both 3rd person and 1st person shape instances
1956 mShapeInstance->reSkin( newSkin, oldSkin );
1957 for ( S32 j = 0; j < ShapeBase::MaxMountedImages; j++ )
1958 {
1959 if (mShapeFPInstance[j])
1960 mShapeFPInstance[j]->reSkin( newSkin, oldSkin );
1961 }
1962
1963 mAppliedSkinName = newSkin;
1964 }
1965 }
1966}
1967
1968//----------------------------------------------------------------------------
1969

Callers 6

setObjectModelMethod · 0.45
setSkinMethod · 0.45
setMountSkinMethod · 0.45
setMountedObjectMethod · 0.45
setImageMethod · 0.45

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