///////////////////////////////////////////////////////////////////// Performs computational tasks once after loading the model - Initializes the bones - Calculates the default pose - Computes the static bounding box
| 89 | // - Calculates the default pose |
| 90 | // - Computes the static bounding box |
| 91 | void CryModel::LoadPostInitialize (bool bBoneInfoDefPoseNeedInitialization) |
| 92 | { |
| 93 | //m_pControllerManager->OptimizeKeys(m_pSystem); |
| 94 | AUTO_PROFILE_SECTION(g_dTimeGeomPostInit); |
| 95 | if (getBoneInfos()) |
| 96 | { |
| 97 | m_pDefaultModelState->InitBones(bBoneInfoDefPoseNeedInitialization); |
| 98 | |
| 99 | // Calculate normals for the first frame. TODO: move into DeformFirst |
| 100 | if(m_pDefaultModelState->getRootBone()) |
| 101 | { |
| 102 | for (unsigned nLodLevel = 0; nLodLevel < numLODs() && !getGeometryInfo (nLodLevel)->empty(); ++nLodLevel) |
| 103 | { |
| 104 | m_pDefaultModelState->m_nLodLevel=nLodLevel; |
| 105 | m_pDefaultModelState->GetCryModelSubmesh(0)->DeformFirst(); |
| 106 | } |
| 107 | } |
| 108 | } |
| 109 | m_pDefaultModelState->m_nLodLevel=0; |
| 110 | |
| 111 | g_GetLog()->UpdateLoadingScreenPlus ("\003."); |
| 112 | buildGeomSkins(); |
| 113 | g_GetLog()->UpdateLoadingScreenPlus ("\003."); |
| 114 | buildMorphSkins (); |
| 115 | g_GetLog()->UpdateLoadingScreenPlus ("\003."); |
| 116 | |
| 117 | if (g_GetCVars()->ca_PrebuildShadowConnectivity()) |
| 118 | { |
| 119 | buildStencilShadowInfos(); |
| 120 | g_GetLog()->UpdateLoadingScreenPlus ("\003."); |
| 121 | } |
| 122 | |
| 123 | computeBoneBBoxes(); |
| 124 | m_pDefaultModelState->InitBBox(); |
| 125 | |
| 126 | // calculate the rough bounding sphere radius |
| 127 | |
| 128 | m_fStaticBSphereRadius = m_pDefaultModelState->getBBox().getSize().Length()*0.5f; |
| 129 | } |
| 130 | |
| 131 | void CryModel::computeBoneBBoxes() |
| 132 | { |
no test coverage detected