MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / in_NetSpawn

Method in_NetSpawn

ogsr_engine/xrGame/CharacterPhysicsSupport.cpp:167–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167void CCharacterPhysicsSupport::in_NetSpawn(CSE_Abstract* e)
168{
169 if (m_EntityAlife.use_simplified_visual())
170 {
171 m_flags.set(fl_death_anim_on, TRUE);
172 IKinematics* ka = smart_cast<IKinematics*>(m_EntityAlife.Visual());
173 VERIFY(ka);
174 ka->CalculateBones_Invalidate();
175 ka->CalculateBones();
176 CollisionCorrectObjPos(m_EntityAlife.Position());
177 m_pPhysicsShell = P_build_Shell(&m_EntityAlife, false);
178 ka->CalculateBones_Invalidate();
179 ka->CalculateBones();
180 return;
181 }
182
183 CPHDestroyable::Init(); // this zerows colbacks !!;
184 IKinematicsAnimated* ka = smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual());
185 m_death_anims.setup(ka, m_EntityAlife.cNameSect().c_str(), pSettings);
186 if (!m_EntityAlife.g_Alive())
187 {
188 if (m_eType == etStalker)
189 ka->PlayCycle("waunded_1_idle_0");
190 else
191 ka->PlayCycle("death_init");
192 }
193 else if (!m_EntityAlife.animation_movement_controlled())
194 {
195 ka->PlayCycle("death_init"); ///непонятно зачем это вообще надо запускать
196 ///этот хак нужен, потому что некоторым монстрам
197 ///анимация после спона, может быть вообще не назначена
198 }
199 ka->dcast_PKinematics()->CalculateBones_Invalidate();
200 ka->dcast_PKinematics()->CalculateBones();
201
202 CPHSkeleton::Spawn(e);
203 movement()->EnableCharacter();
204 movement()->SetPosition(m_EntityAlife.Position());
205 movement()->SetVelocity(0, 0, 0);
206 if (m_eType != etActor)
207 {
208 m_flags.set(fl_specific_bonce_demager, TRUE);
209 m_BonceDamageFactor = 1.f;
210 }
211 if (Type() == etStalker)
212 {
213 m_hit_animations.SetupHitMotions(*smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual()));
214 }
215 anim_mov_state.init();
216
217 anim_mov_state.active = m_EntityAlife.animation_movement_controlled();
218}
219
220void CCharacterPhysicsSupport::CreateCharacter()
221{

Callers 3

net_SpawnMethod · 0.80
net_SpawnMethod · 0.80
net_SpawnMethod · 0.80

Calls 15

P_build_ShellFunction · 0.85
TypeFunction · 0.85
VisualMethod · 0.80
PositionMethod · 0.80
g_AliveMethod · 0.80
PlayCycleMethod · 0.80
EnableCharacterMethod · 0.80
use_simplified_visualMethod · 0.45
setMethod · 0.45
CalculateBonesMethod · 0.45

Tested by

no test coverage detected