2014-11-05 63 views
0

Quaternion.Lerp

靜態四元數線性插值(四元數從,四元數到,浮動噸);Unity3D四元數libGDX等效

描述: 從和之間插入t,然後對結果進行歸一化。 這比斯勒普要快,但如果旋轉很遠,看起來更糟糕。

using UnityEngine; 
using System.Collections; 

public class ExampleClass : MonoBehaviour { 
    public Transform from; 
    public Transform to; 
    public float speed = 0.1F; 
    void Update() { 
     transform.rotation = Quaternion.Lerp(from.rotation, to.rotation, Time.time * speed); 
    } 
} 

請問您是否可以在libGDX中寫下一個相等數?我試圖做很長時間,沒有成功。

+0

從描述中,聽起來像nlerp。爲了得到它,線性插值四元數的每個分量,然後對其進行歸一化。 – Tenfour04 2014-11-05 21:21:42

回答