예제 #1
0
        /// <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(); Note: If we don't want to animate ragdoll, we don't need to call this, just use phys simulation..

            RagdollMapper.SetVelocities();

            RagdollMapper.SetLimitedVelocities();

            RagdollMapper.DebugDraw(Character.WorldMatrix);
        }