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

Method in_UpdateCL

ogsr_engine/xrGame/CharacterPhysicsSupport.cpp:488–560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488void CCharacterPhysicsSupport::in_UpdateCL()
489{
490 if (m_eState == esRemoved)
491 {
492 return;
493 }
494 update_animation_collision();
495 CalculateTimeDelta();
496 if (m_pPhysicsShell)
497 {
498 VERIFY(m_pPhysicsShell->isFullActive());
499 m_pPhysicsShell->SetRagDoll(); //Теперь шела относиться к классу объектов cbClassRagDoll
500
501 if (!is_imotion(m_interactive_motion)) //! m_flags.test(fl_use_death_motion)
502 m_pPhysicsShell->InterpolateGlobalTransform(&mXFORM);
503 else
504 m_interactive_motion->update(m_pPhysicsShell);
505
506 UpdateDeathAnims();
507 UpdateFrictionAndJointResistanse();
508 }
509 else if (!m_EntityAlife.g_Alive() && !m_EntityAlife.use_simplified_visual())
510 {
511 ActivateShell(NULL);
512 m_PhysicMovementControl->DestroyCharacter();
513 }
514 else if (ik_controller())
515 {
516 CFrustum& view_frust = ::Render->ViewBase;
517 vis_data& vis = m_EntityAlife.Visual()->getVisData();
518 Fvector p;
519
520 m_EntityAlife.XFORM().transform_tiny(p, vis.sphere.P);
521
522 float dist = Device.vCameraPosition.distance_to(p);
523
524 if (dist < IK_CALC_DIST)
525 {
526 if (view_frust.testSphere_dirty(p, vis.sphere.R) || dist < IK_ALWAYS_CALC_DIST)
527 {
528 ik_controller()->Update();
529 }
530 }
531 }
532
533#ifdef DEBUG
534 if (Type() == etStalker && ph_dbg_draw_mask1.test(phDbgHitAnims))
535 {
536 Fmatrix m;
537 m_hit_animations.GetBaseMatrix(m, m_EntityAlife);
538 DBG_DrawMatrix(m, 1.5f);
539 /*
540 IKinematicsAnimated *K = smart_cast<IKinematicsAnimated*>(m_EntityAlife.Visual());
541 u16 hb = K->LL_BoneID("bip01_head");
542 u16 pb = K->LL_GetBoneRoot();
543 u16 nb = K->LL_BoneID("bip01_neck");
544 u16 eb = K->LL_BoneID("eye_right");
545 Fmatrix &mh = K->LL_GetTransform(hb);

Callers 3

UpdateCLMethod · 0.80
UpdateCLMethod · 0.80
UpdateCLMethod · 0.80

Calls 15

is_imotionFunction · 0.85
TypeFunction · 0.85
DBG_DrawMatrixFunction · 0.85
SetRagDollMethod · 0.80
g_AliveMethod · 0.80
DestroyCharacterMethod · 0.80
VisualMethod · 0.80
transform_tinyMethod · 0.80
testSphere_dirtyMethod · 0.80
GetBaseMatrixMethod · 0.80
isFullActiveMethod · 0.45

Tested by

no test coverage detected