MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / LoadPostInitialize

Method LoadPostInitialize

CryAnimation/CryModel.cpp:91–129  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////// Performs computational tasks once after loading the model - Initializes the bones - Calculates the default pose - Computes the static bounding box

Source from the content-addressed store, hash-verified

89// - Calculates the default pose
90// - Computes the static bounding box
91void 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
131void CryModel::computeBoneBBoxes()
132{

Callers 1

loadAnimationsMethod · 0.80

Calls 10

g_GetLogFunction · 0.85
g_GetCVarsFunction · 0.85
InitBonesMethod · 0.80
DeformFirstMethod · 0.80
GetCryModelSubmeshMethod · 0.80
InitBBoxMethod · 0.80
emptyMethod · 0.45
LengthMethod · 0.45
getSizeMethod · 0.45

Tested by

no test coverage detected