summaryrefslogtreecommitdiff
path: root/ActiveRagdoll/Assets/TABG/Scripts/Action/Balance.cs
blob: f8257e72188adf16a51940e6b7c53d5e5874f986 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
using Rigging.Debugging;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace Rigging.Action
{
    //动作-控制双脚的位置,让双脚和双脚的中点尽可能和重心在水平的投影重合

    public class Balance : RiggingActionBase
    {

        public Rigidbody handLeft;
        public Rigidbody handRight;
        public Rigidbody footLeft; // kneeLeft
        public Rigidbody footRight; // kneeRight
        public Rigidbody hip;

        private Vector3 centerOfMass; // 5.0759, 0, -7.2038

        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()
        {

        }   

        protected override void OnUpdate()
        {
        }

    }

}