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

Method ActivateShell

ogsr_engine/xrGame/CharacterPhysicsSupport.cpp:659–793  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657}
658
659void CCharacterPhysicsSupport::ActivateShell(CObject* who)
660{
661
662 DestroyIKController();
663
664 destroy_animation_collision();
665
666 IKinematics* K = smart_cast<IKinematics*>(m_EntityAlife.Visual());
667
668 // animation movement controller issues
669 bool anim_mov_ctrl = m_EntityAlife.animation_movement_controlled();
670 CBoneInstance& BR = K->LL_GetBoneInstance(K->LL_GetBoneRoot());
671 Fmatrix start_xform;
672 start_xform.identity();
673 CBlend* anim_mov_blend = 0;
674 // float blend_time = 0;
675 if (anim_mov_ctrl)
676 {
677 m_EntityAlife.animation_movement()->ObjStartXform(start_xform);
678 anim_mov_blend = m_EntityAlife.animation_movement()->ControlBlend();
679 /*
680 VERIFY( anim_mov_blend->blend_state() != CBlend::eFREE_SLOT );
681 anim_mov_blend->timeCurrent -= 2 * Device.fTimeDelta * anim_mov_blend->speed;
682 blend_time = anim_mov_blend->timeCurrent;
683 anim_mov_blend->playing = true;
684
685 K->CalculateBones_Invalidate( );
686 K->CalculateBones ();
687 anim_mov_blend->playing = false;
688 */
689 m_EntityAlife.destroy_anim_mov_ctrl();
690 BR.set_callback_overwrite(TRUE);
691 }
692 //
693
694 if (!m_physics_skeleton)
695 CreateSkeleton(m_physics_skeleton);
696
697 if (m_eType == etActor)
698 {
699 CActor* A = smart_cast<CActor*>(&m_EntityAlife);
700 R_ASSERT2(A, "not an actor has actor type");
701 if (A->Holder())
702 return;
703 if (m_eState == esRemoved)
704 return;
705 }
706
707//////////////////////this needs to evaluate object box//////////////////////////////////////////////////////
708 for (u16 I = K->LL_BoneCount(); I > 0;)
709 K->LL_GetBoneInstance(--I).reset_callback();
710
711 if (anim_mov_ctrl) // we do not whant to move by long animation in root
712 BR.set_callback_overwrite(TRUE);
713
714 K->CalculateBones_Invalidate();
715 K->CalculateBones();
716 ////////////////////////////////////////////////////////////////////////////

Callers

nothing calls this directly

Calls 15

VisualMethod · 0.80
LL_GetBoneRootMethod · 0.80
ObjStartXformMethod · 0.80
animation_movementMethod · 0.80
ControlBlendMethod · 0.80
HolderMethod · 0.80
LL_BoneCountMethod · 0.80
GetCharacterVelocityMethod · 0.80
PositionMethod · 0.80
CharacterExistMethod · 0.80

Tested by

no test coverage detected