| 2015 | } |
| 2016 | |
| 2017 | void Tr2GrannyAnimation::AddAnimationLayer( const char* layerName, float layerWeight ) |
| 2018 | { |
| 2019 | if( GetAnimationLayer( layerName ) ) |
| 2020 | { |
| 2021 | return; |
| 2022 | } |
| 2023 | |
| 2024 | Tr2GrannyAnimationLayer layer( 0.f, layerWeight ); |
| 2025 | layer.m_name = layerName; |
| 2026 | m_animationLayers[layerName] = std::move( layer ); |
| 2027 | |
| 2028 | if( !IsInitialized() ) |
| 2029 | { |
| 2030 | return; |
| 2031 | } |
| 2032 | |
| 2033 | if( IsUsingCMF() ) |
| 2034 | { |
| 2035 | if( !m_tmpPose.skeleton ) |
| 2036 | { |
| 2037 | auto& skeleton = GetCMFData()->skeletons[m_modelIndex]; |
| 2038 | cmf::RestPose( m_tmpPose, skeleton ); |
| 2039 | } |
| 2040 | } |
| 2041 | #if WITH_GRANNY |
| 2042 | if( !IsUsingCMF() ) |
| 2043 | { |
| 2044 | if( !m_compositePose ) |
| 2045 | { |
| 2046 | m_compositePose = GrannyNewLocalPose( m_skeleton->BoneCount ); |
| 2047 | } |
| 2048 | } |
| 2049 | |
| 2050 | #endif |
| 2051 | |
| 2052 | GetAnimationLayer( layerName )->InitializeAnimationLayer( this ); |
| 2053 | } |
| 2054 | |
| 2055 | float Tr2GrannyAnimation::GetLayerWeight( const char* layerName ) |
| 2056 | { |
nothing calls this directly
no test coverage detected