Beispiel #1
0
    /// <summary>
    /// Gets an interpolated User Value for a certain group TF
    /// </summary>
    /// <remarks>TF (Total Fragment) relates to the total length of the group</remarks>
    /// <param name="tf">TF value reflecting position in the group (0..1)</param>
    /// <param name="index">the UserValue array index</param>
    /// <returns>the interpolated value</returns>
    public override Vector3 InterpolateUserValue(float tf, int index)
    {
        float       localTF;
        CurvySpline spl = TFToSpline(tf, out localTF);

        return(spl.InterpolateUserValue(localTF, index));
    }
Beispiel #2
0
    Vector3 getScale(float tf)
    {
        switch (ScaleModifier)
        {
        case MeshScaleModifier.ControlPoint:
            return(Spline.InterpolateScale(tf));

        case MeshScaleModifier.UserValue:
            return(Spline.InterpolateUserValue(tf, ScaleModifierUserValueSlot));

        case MeshScaleModifier.Delegate:
            return((OnGetScale != null) ? OnGetScale(this, tf) : Vector3.one);

        case MeshScaleModifier.AnimationCurve:
            Vector3 v = Vector3.one;
            if (ScaleModifierCurve != null)
            {
                return(v * ScaleModifierCurve.Evaluate(tf));
            }
            else
            {
                return(v);
            }

        default:
            return(Vector3.one);
        }
    }