Quaternion.Angle 角
static function Angle (a : Quaternion, b : Quaternion) : float
Description描述
Returns the angle in degrees between two rotations a and b.
返回a和b两者之间的角度。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
public Transform target;
void Update() {
float angle = Quaternion.Angle(transform.rotation, target.rotation);
}
}
// Calculates the angle (degrees) between
// the rotation of this transform and target.
//计算transform和target之间的旋转角度
var target : Transform;
function Update () {
var angle : float = Quaternion.Angle(transform.rotation, target.rotation);
}
最后修改:2011年1月16日 Sunday 17:28