unity lerp 插值上限的设定

   float a=  Mathf.LerpAngle(-100,1000, 0.5f);
       Debug.Log("Mathf.LerpAngle : "+ a);
       a = Mathf.LerpUnclamped(-100, 1000, 1.5f);
       Debug.Log("Mathf.LerpUnclamped : " + a);
       a = Mathf.Lerp(-100, 1000, 1.5f);
       Debug.Log("Mathf.Lerp : " + a);

 

 

 

插值公式:

result = a+(b-a)*t

lerpAngle只要是计算过程中,值大于360 就会取余到360内

lerpUnclamped, 不做限制

 

posted @ 2021-12-16 10:48  sun_dust_shadow  阅读(119)  评论(0编辑  收藏  举报