From 2a6c98c86164ed54296256f0997391e59996763b Mon Sep 17 00:00:00 2001 From: chai <215380520@qq.com> Date: Mon, 1 Apr 2024 17:01:23 +0800 Subject: *misc --- .../Assets/TABG/Scripts/Action/Balance.cs | 35 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs') diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs index 5456faf..ce1018d 100644 --- a/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs +++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs @@ -4,17 +4,46 @@ using UnityEngine; namespace Rigging.Action { + //动作-控制双脚的位置,让双脚和双脚的中点尽可能和重心在水平的投影重合 public class Balance : RiggingActionBase { - public Rigidbody[] rigsToLift; //Head, Torso + public Rigidbody handLeft; + public Rigidbody handRight; + public Rigidbody footLeft; // kneeLeft + public Rigidbody footRight; // kneeRight + public Rigidbody hip; - public float force; + private Vector3 centerOfMass; // 5.0759, 0, -7.2038 - private void FixedUpdate() + private Rigidbody[] allRigs//所有14个parts { + get + { + return player.status.body.allRigs; + } + } + + public float balanceForce; + + public float footCenterForces; + + private float muscleMultiplier; //1 + + private float crouchMultiplier = 1f; //1 + protected override void OnStart() + { + handLeft = player.body.handLeft.GetComponent(); + handRight = player.body.handRight.GetComponent(); + footLeft = player.body.kneeLeft.GetComponent(); + footRight = player.body.kneeRight.GetComponent(); + hip = player.body.hip.GetComponent(); + } + + protected override void OnFixedUpdate() + { } -- cgit v1.1-26-g67d0