예제 #1
0
        /*
         *      Set the bone decay for the bone (in the range 0...1)
         *      0 = follow animation normally
         *      1 = dont follow animation at all
         */
        public void SetBoneDecay(HumanBodyBones bones, float decayValue, float neighborMultiplier)
        {
            if (!boneDecays.ContainsKey(bones))
            {
                Debug.LogError(bones + " is not a physics bone, cant set bone decay");
                return;
            }

            // making additive, so in case we hit a bone twice in a ragdoll session
            // it doesnt reset with a lower value

            float origDecay = boneDecays[bones];

            origDecay += decayValue;

            if (origDecay > 1)
            {
                origDecay = 1;
            }

            boneDecays[bones] = origDecay;

            if (neighborMultiplier > 0)
            {
                foreach (var n in profile.bones[Ragdoll.Bone2Index(bones)].neighbors)
                {
                    SetBoneDecay(n, decayValue * neighborMultiplier, 0);
                }
            }
        }
예제 #2
0
 public DATATYPE this[HumanBodyBones bone] {
     get { return(boneDatas[Ragdoll.Bone2Index(bone)].boneData); }
 }