summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-04-01 17:01:23 +0800
committerchai <215380520@qq.com>2024-04-01 17:01:23 +0800
commit2a6c98c86164ed54296256f0997391e59996763b (patch)
treeba0434fb22272045c7cd7bdc561a3cc77c288ffe /ActiveRagdoll/Assets/TABG/Scripts
parent6163a48a474d1600442137d776aa56ed7f7d5ec5 (diff)
*misc
Diffstat (limited to 'ActiveRagdoll/Assets/TABG/Scripts')
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs35
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs1
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs20
3 files changed, 52 insertions, 4 deletions
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<Rigidbody>();
+ handRight = player.body.handRight.GetComponent<Rigidbody>();
+ footLeft = player.body.kneeLeft.GetComponent<Rigidbody>();
+ footRight = player.body.kneeRight.GetComponent<Rigidbody>();
+ hip = player.body.hip.GetComponent<Rigidbody>();
+ }
+
+ protected override void OnFixedUpdate()
+ {
}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs
index d52501b..2500de5 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Standing.cs
@@ -7,6 +7,7 @@ using UnityEngine.Windows;
namespace Rigging.Action
{
+ // 动作-保持站立,给head和torso施加力
public class Standing : RiggingActionBase
{
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs b/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs
index b774c1a..8486c16 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Data/Strength.cs
@@ -4,11 +4,29 @@ using UnityEngine;
namespace Rigging.Data
{
-
+ //Player <Strength> 计算一个本角色范围内通行的力量缩放值
public class Strength : RiggingDataBase
{
+ public float strength = 1f;
+
+ public float lookStrenth = 1f;
+
+ //private PlayerDeath death;
+
+ //private RagdollHandler ragdoll;
+
+ private void Start()
+ {
+ //ragdoll = GetComponent<RagdollHandler>();
+ //death = GetComponent<PlayerDeath>();
+ }
+ private void Update()
+ {
+ //strength = ragdoll.notRagdollMultiplier * death.muscleFunction * Mathf.Lerp(base.transform.localScale.x, 1f, 0.4f);
+ //lookStrenth = ragdoll.notRagdollMultiplier * death.muscleFunction;
+ }
}