/// <summary> /// Gets an interpolated Scale 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> /// <returns>the interpolated value</returns> public override Vector3 InterpolateScale(float tf) { float localTF; CurvySpline spl = TFToSpline(tf, out localTF); return(spl.InterpolateScale(localTF)); }
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); } }