Example #1
0
        // Gets the value of a weight curve/multiplier
        public float GetValue(WeightCurve.Type weightCurveType, InteractionTarget target, float timer)
        {
            int index = GetWeightCurveIndex(weightCurveType);

            if (index != -1)
            {
                float mlp = target == null? 1f: target.GetValue(weightCurveType);

                return(weightCurves[index].GetValue(timer) * mlp);
            }

            for (int i = 0; i < multipliers.Length; i++)
            {
                if (multipliers[i].result == weightCurveType)
                {
                    int wIndex = GetWeightCurveIndex(multipliers[i].curve);
                    if (wIndex != -1)
                    {
                        float mlp = target == null? 1f: target.GetValue(multipliers[i].result);

                        return(multipliers[i].GetValue(weightCurves[wIndex], timer) * mlp);
                    }
                }
            }

            return(0f);
        }
Example #2
0
 private int GetMultiplierIndex(WeightCurve.Type weightCurveType)
 {
     for (int i = 0; i < multipliers.Length; i++)
     {
         if (multipliers[i].result == weightCurveType)
         {
             return(i);
         }
     }
     return(-1);
 }
Example #3
0
 private int GetWeightCurveIndex(WeightCurve.Type weightCurveType)
 {
     for (int i = 0; i < weightCurves.Length; i++)
     {
         if (weightCurves[i].type == weightCurveType)
         {
             return(i);
         }
     }
     return(-1);
 }
Example #4
0
 // Returns true if the specified WeightCurve.Type is used by this InteractionObject
 public bool CurveUsed(WeightCurve.Type type)
 {
     foreach (WeightCurve curve in weightCurves)
     {
         if (curve.type == type)
         {
             return(true);
         }
     }
     foreach (Multiplier multiplier in multipliers)
     {
         if (multiplier.result == type)
         {
             return(true);
         }
     }
     return(false);
 }
Example #5
0
        // Apply the curve to the specified solver, effector, with the value and weight.
        private void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, WeightCurve.Type type, float value, float weight)
        {
            switch (type)
            {
            case WeightCurve.Type.PositionWeight:
                solver.GetEffector(effector).positionWeight = Mathf.Lerp(solver.GetEffector(effector).positionWeight, value, weight);
                return;

            case WeightCurve.Type.RotationWeight:
                solver.GetEffector(effector).rotationWeight = Mathf.Lerp(solver.GetEffector(effector).rotationWeight, value, weight);
                return;

            case WeightCurve.Type.PositionOffsetX:
                solver.GetEffector(effector).position += solver.GetRoot().rotation *Vector3.right *value *weight;
                return;

            case WeightCurve.Type.PositionOffsetY:
                solver.GetEffector(effector).position += solver.GetRoot().rotation *Vector3.up *value *weight;
                return;

            case WeightCurve.Type.PositionOffsetZ:
                solver.GetEffector(effector).position += solver.GetRoot().rotation *Vector3.forward *value *weight;
                return;

            case WeightCurve.Type.Pull:
                solver.GetChain(effector).pull = Mathf.Lerp(solver.GetChain(effector).pull, value, weight);
                return;

            case WeightCurve.Type.Reach:
                solver.GetChain(effector).reach = Mathf.Lerp(solver.GetChain(effector).reach, value, weight);
                return;
            }
        }
Example #6
0
        // Apply the curve to the specified solver, effector, with the value and weight.
        private void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, WeightCurve.Type type, float value, float weight)
        {
            switch (type)
            {
            case WeightCurve.Type.PositionWeight:
                solver.GetEffector(effector).positionWeight = Mathf.Lerp(solver.GetEffector(effector).positionWeight, value, weight);
                return;

            case WeightCurve.Type.RotationWeight:
                solver.GetEffector(effector).rotationWeight = Mathf.Lerp(solver.GetEffector(effector).rotationWeight, value, weight);
                return;

            case WeightCurve.Type.PositionOffsetX:
                solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.right * value * weight;
                return;

            case WeightCurve.Type.PositionOffsetY:
                solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.up * value * weight;
                return;

            case WeightCurve.Type.PositionOffsetZ:
                solver.GetEffector(effector).position += (positionOffsetSpace != null? positionOffsetSpace.rotation: solver.GetRoot().rotation) * Vector3.forward * value * weight;
                return;

            case WeightCurve.Type.Pull:
                solver.GetChain(effector).pull = Mathf.Lerp(solver.GetChain(effector).pull, value, weight);
                return;

            case WeightCurve.Type.Reach:
                solver.GetChain(effector).reach = Mathf.Lerp(solver.GetChain(effector).reach, value, weight);
                return;

            case WeightCurve.Type.Push:
                solver.GetChain(effector).push = Mathf.Lerp(solver.GetChain(effector).push, value, weight);
                return;

            case WeightCurve.Type.PushParent:
                solver.GetChain(effector).pushParent = Mathf.Lerp(solver.GetChain(effector).pushParent, value, weight);
                return;

            case WeightCurve.Type.BendGoalWeight:
                solver.GetChain(effector).bendConstraint.weight = Mathf.Lerp(solver.GetChain(effector).bendConstraint.weight, value, weight);
                return;
            }
        }
 private int GetWeightCurveIndex(WeightCurve.Type weightCurveType) => default;       // 0x00000001807DFF60-0x00000001807DFFD0
 private int GetMultiplierIndex(WeightCurve.Type weightCurveType) => default;        // 0x00000001807DF820-0x00000001807DF890
 private Transform GetTarget(FullBodyBipedEffector effectorType) => default;         // 0x00000001807DFBD0-0x00000001807DFC60
 private int GetWeightCurveIndex(WeightCurve.Type weightCurveType) => default;       // 0x00000001807DFF60-0x00000001807DFFD0
        }                               // 0x00000001807DF750-0x00000001807DF760

        private void Apply(IKSolverFullBodyBiped solver, FullBodyBipedEffector effector, WeightCurve.Type type, float value, float weight)
        {
        }                                                                                   // 0x00000001807DEAE0-0x00000001807DF1C0
        }                                                                                                                  // 0x00000001807DF1C0-0x00000001807DF750

        public float GetValue(WeightCurve.Type weightCurveType, InteractionTarget target, float timer) => default;         // 0x00000001807DFC60-0x00000001807DFF60
 public InteractionTarget GetTarget(FullBodyBipedEffector effectorType, InteractionSystem interactionSystem) => default; // 0x00000001807DFA50-0x00000001807DFBD0
 public bool CurveUsed(WeightCurve.Type type) => default;                                                                // 0x00000001807DF760-0x00000001807DF820