Quaternion.Inverse 求反

static function Inverse (rotation : Quaternion) : Quaternion

Description描述

Returns the Inverse of rotation.

返回反向的旋转。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Transform target;
	void Update() {
		transform.rotation = Quaternion.Inverse(target.rotation);
	}
}
// Sets this transform to have the opposite rotation of the target
//设置这个变换具有target相反的旋转
var target : Transform;
function Update () {
	transform.rotation = Quaternion.Inverse(target.rotation);
}
Page last updated: 2011-1-16