summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchai <215380520@qq.com>2024-04-17 12:33:15 +0800
committerchai <215380520@qq.com>2024-04-17 12:33:15 +0800
commit54e5fb10d58eb21a49780c3e4183afd00e485fc5 (patch)
tree8169e42666bc852c28182bf385a68f10bc001d53
parent1353154c534c9d5cfd83f6221d55283d8f2d8d41 (diff)
*toque
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs6
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs25
-rw-r--r--ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs.meta11
-rw-r--r--ActiveRagdoll/Assets/TABG/Test.unity185
-rw-r--r--Docs/资料.xlsxbin7247374 -> 7560251 bytes
5 files changed, 224 insertions, 3 deletions
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs b/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs
index 67e9a05..dcd96a0 100644
--- a/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Action/Movement.cs
@@ -17,7 +17,7 @@ namespace Rigging.Action
public Vector3 movementVector;
- public AnimationParam<float> animationForceAmounts;
+ public AnimationParam<float> forceAmounts;
private RigidbodyHolder allRigs;
@@ -34,7 +34,7 @@ namespace Rigging.Action
protected override void OnStart()
{
- animationForceAmounts.SetPlayer(player);
+ forceAmounts.SetPlayer(player);
standingData = player.status.standingData;
inputHandler = player.input;
allRigs = player.status.body;
@@ -44,7 +44,7 @@ namespace Rigging.Action
private void FixedUpdate()
{
data.sinceJump += Time.fixedDeltaTime;
- movementVector += inputHandler.inputMovementDirection * animationForceAmounts.current;
+ movementVector += inputHandler.inputMovementDirection * forceAmounts.current;
movementVector *= friction;
allRigs.AddForceToAll(movementVector * multiplier, ForceMode.Acceleration);
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs b/ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs
new file mode 100644
index 0000000..3905920
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs
@@ -0,0 +1,25 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public class AddTorque : MonoBehaviour
+{
+ public Vector3 torque;
+
+ public Rigidbody rigid;
+
+ public Transform hip;
+
+ // Start is called before the first frame update
+ void Start()
+ {
+ rigid = GetComponent<Rigidbody>();
+ }
+
+ // Update is called once per frame
+ void FixedUpdate()
+ {
+ Vector3 t = hip.TransformDirection(torque);
+ rigid.AddTorque(t, ForceMode.Acceleration);
+ }
+}
diff --git a/ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs.meta b/ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs.meta
new file mode 100644
index 0000000..05c8d47
--- /dev/null
+++ b/ActiveRagdoll/Assets/TABG/Scripts/Debug/AddTorque.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 8e9bcfd8858bb43488466ff92689ce32
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/ActiveRagdoll/Assets/TABG/Test.unity b/ActiveRagdoll/Assets/TABG/Test.unity
index 3bd2ab9..7f782ba 100644
--- a/ActiveRagdoll/Assets/TABG/Test.unity
+++ b/ActiveRagdoll/Assets/TABG/Test.unity
@@ -230,6 +230,18 @@ LightingSettings:
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_PVRTiledBaking: 0
+--- !u!1 &516999767 stripped
+GameObject:
+ m_CorrespondingSourceObject: {fileID: 7307037826757058977, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ m_PrefabInstance: {fileID: 8128778564773403800}
+ m_PrefabAsset: {fileID: 0}
+--- !u!1 &599151118 stripped
+GameObject:
+ m_CorrespondingSourceObject: {fileID: 1198478719857577481, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ m_PrefabInstance: {fileID: 8128778564773403800}
+ m_PrefabAsset: {fileID: 0}
--- !u!1 &705426289
GameObject:
m_ObjectHideFlags: 0
@@ -673,6 +685,12 @@ Transform:
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &1255693595 stripped
+GameObject:
+ m_CorrespondingSourceObject: {fileID: 2411311702239281492, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ m_PrefabInstance: {fileID: 8128778564773403800}
+ m_PrefabAsset: {fileID: 0}
--- !u!1 &1871198445
GameObject:
m_ObjectHideFlags: 0
@@ -825,6 +843,21 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 8128778564773403800}
m_PrefabAsset: {fileID: 0}
+--- !u!114 &2037636450122013956
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 516999767}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 8e9bcfd8858bb43488466ff92689ce32, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ torque: {x: 0, y: 0, z: 0}
+ rigid: {fileID: 0}
+ hip: {fileID: 6887620786272290103}
--- !u!4 &2783424386060882342 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 6228351505900064062, guid: fce18bbf37be1384eb1a089a94aac81d,
@@ -864,12 +897,84 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 8128778564773403800}
m_PrefabAsset: {fileID: 0}
+--- !u!114 &4878685260469331854
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 599151118}
+ m_Enabled: 0
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1f7b7bd465add9742bc770683eb2f98f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ animations:
+ values:
+ - forwardTorque: {x: 0, y: 0, z: 0}
+ backwardsTorque: {x: 0, y: 0, z: 0}
+ torqueSpace: 0
+ forwardForce: {x: 0, y: 0, z: 0}
+ backwardsForce: {x: 0, y: 0, z: 0}
+ forceSpace: 0
+ - forwardTorque: {x: 0, y: 0, z: 0}
+ backwardsTorque: {x: 0, y: 0, z: 0}
+ torqueSpace: 0
+ forwardForce: {x: 0, y: 50, z: 0}
+ backwardsForce: {x: 0, y: -50, z: 0}
+ forceSpace: 0
+ smoothing: 0
+ multiplier: 1
+ isLeft: 0
+ switchToForwardEvent:
+ m_PersistentCalls:
+ m_Calls: []
+ switchToBackwardsEvent:
+ m_PersistentCalls:
+ m_Calls: []
+ dontAnimateIfHoldingSomething: 0
--- !u!4 &5216378010582810220 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4083486271296676596, guid: fce18bbf37be1384eb1a089a94aac81d,
type: 3}
m_PrefabInstance: {fileID: 8128778564773403800}
m_PrefabAsset: {fileID: 0}
+--- !u!114 &5216378010582810227
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 1255693595}
+ m_Enabled: 0
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 1f7b7bd465add9742bc770683eb2f98f, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ animations:
+ values:
+ - forwardTorque: {x: 0, y: 0, z: 0}
+ backwardsTorque: {x: 0, y: 0, z: 0}
+ torqueSpace: 0
+ forwardForce: {x: 0, y: 0, z: 0}
+ backwardsForce: {x: 0, y: 0, z: 0}
+ forceSpace: 0
+ - forwardTorque: {x: 0, y: 0, z: 0}
+ backwardsTorque: {x: 0, y: 0, z: 0}
+ torqueSpace: 0
+ forwardForce: {x: 0, y: 50, z: 0}
+ backwardsForce: {x: 0, y: -50, z: 0}
+ forceSpace: 0
+ smoothing: 0
+ multiplier: 1
+ isLeft: 1
+ switchToForwardEvent:
+ m_PersistentCalls:
+ m_Calls: []
+ switchToBackwardsEvent:
+ m_PersistentCalls:
+ m_Calls: []
+ dontAnimateIfHoldingSomething: 0
--- !u!4 &5240332616388624504 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 4068544631671626976, guid: fce18bbf37be1384eb1a089a94aac81d,
@@ -1041,11 +1146,91 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
+ - target: {fileID: 2037636450122013953, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: isLeft
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2037636450122013953, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: m_Enabled
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2037636450122013953, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.size
+ value: 2
+ objectReference: {fileID: 0}
+ - target: {fileID: 2037636450122013953, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].forwardTorque.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2037636450122013953, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].forwardTorque.y
+ value: -2000
+ objectReference: {fileID: 0}
+ - target: {fileID: 2037636450122013953, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].backwardsTorque.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 2037636450122013953, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].backwardsTorque.y
+ value: 2000
+ objectReference: {fileID: 0}
- target: {fileID: 2047971321291531494, guid: fce18bbf37be1384eb1a089a94aac81d,
type: 3}
propertyPath: m_Name
value: human_rigging
objectReference: {fileID: 0}
+ - target: {fileID: 3526346404085441778, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: isLeft
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 3526346404085441778, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: m_Enabled
+ value: 1
+ objectReference: {fileID: 0}
+ - target: {fileID: 3526346404085441778, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.size
+ value: 2
+ objectReference: {fileID: 0}
+ - target: {fileID: 3526346404085441778, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].forwardTorque.x
+ value: 0
+ objectReference: {fileID: 0}
+ - target: {fileID: 3526346404085441778, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].forwardTorque.y
+ value: -2000
+ objectReference: {fileID: 0}
+ - target: {fileID: 3526346404085441778, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].backwardsTorque.x
+ value: 1000
+ objectReference: {fileID: 0}
+ - target: {fileID: 3526346404085441778, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: animations.values.Array.data[1].backwardsTorque.y
+ value: 2000
+ objectReference: {fileID: 0}
+ - target: {fileID: 3805300644640191623, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: forceAmounts.values.Array.size
+ value: 2
+ objectReference: {fileID: 0}
+ - target: {fileID: 3805300644640191623, guid: fce18bbf37be1384eb1a089a94aac81d,
+ type: 3}
+ propertyPath: forceAmounts.values.Array.data[1]
+ value: 7
+ objectReference: {fileID: 0}
- target: {fileID: 4321150989774212269, guid: fce18bbf37be1384eb1a089a94aac81d,
type: 3}
propertyPath: animations.values.Array.data[1].forwardTorque.x
diff --git a/Docs/资料.xlsx b/Docs/资料.xlsx
index 014e40a..305db4d 100644
--- a/Docs/资料.xlsx
+++ b/Docs/资料.xlsx
Binary files differ