/// <summary>
        /// Sets the ragdoll pose to bones pose
        /// </summary>
        private void UpdateRagdoll()
        {
            //if (MyFakes.ENABLE_RAGDOLL_DEBUG) Debug.WriteLine("RagdollComponent.UpdateRagdoll");
            if (Character.Physics == null || Character.Physics.Ragdoll == null || RagdollMapper == null)
            {
                return;
            }
            if (!MyPerGameSettings.EnableRagdollModels)
            {
                return;
            }

            if (!RagdollMapper.IsActive || !Character.Physics.IsRagdollModeActive)
            {
                return;
            }

            if (!RagdollMapper.IsKeyFramed && !RagdollMapper.IsPartiallySimulated)
            {
                return;
            }

            RagdollMapper.UpdateRagdollPosition();
            RagdollMapper.UpdateRagdollPose();
            RagdollMapper.SetVelocities();

            RagdollMapper.DebugDraw(Character.WorldMatrix);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the ragdoll pose to bones pose
        /// </summary>
        private void UpdateRagdoll()
        {
            if (Character.Physics == null || Character.Physics.Ragdoll == null || RagdollMapper == null)
            {
                return;
            }
            if (!MyPerGameSettings.EnableRagdollModels)
            {
                return;
            }

            if (!RagdollMapper.IsActive || !Character.Physics.IsRagdollModeActive)
            {
                return;
            }

            if (!RagdollMapper.IsKeyFramed && !RagdollMapper.IsPartiallySimulated)
            {
                return;
            }

            RagdollMapper.UpdateRagdollPosition();
            RagdollMapper.UpdateRagdollPose();
            RagdollMapper.SetVelocities();

            RagdollMapper.DebugDraw(Character.WorldMatrix);
        }
 public void InitDeadBodyPhysics()
 {
     if (MyFakes.ENABLE_RAGDOLL_DEBUG)
     {
         Debug.WriteLine("RagdollComponent.InitDeadBodyPhysics");
     }
     if (Character.Physics.IsRagdollModeActive)
     {
         Character.Physics.CloseRagdollMode();
     }
     if (RagdollMapper.IsActive)
     {
         RagdollMapper.Deactivate();
     }
     Character.Physics.SwitchToRagdollMode();
     RagdollMapper.Activate();
     RagdollMapper.SetRagdollToKeyframed();
     RagdollMapper.UpdateRagdollPose();
     RagdollMapper.SetRagdollToDynamic();
 }
Exemplo n.º 4
0
        public void InitDeadBodyPhysics()
        {
            bool          flag1   = MyFakes.ENABLE_RAGDOLL_DEBUG;
            MyPhysicsBody physics = base.Character.Physics;

            if (physics.IsRagdollModeActive)
            {
                physics.CloseRagdollMode();
            }
            MyRagdollMapper ragdollMapper = this.RagdollMapper;

            if (ragdollMapper.IsActive)
            {
                ragdollMapper.Deactivate();
            }
            physics.SwitchToRagdollMode(true, 1);
            ragdollMapper.Activate();
            ragdollMapper.SetRagdollToKeyframed();
            ragdollMapper.UpdateRagdollPose();
            ragdollMapper.SetRagdollToDynamic();
        }