Quaternion.ToAngleAxis 转换为角轴

function ToAngleAxis (out angle : float, out axis : Vector3) : void

Description描述

Converts a rotation to angle-axis representation.

转换一个旋转用“角-轴”表示。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public float angle = 0.0F;
	public Vector3 axis = Vector3.zero;
	public void Awake() {
		transform.rotation.ToAngleAxis(ref angle, ref axis);
	}
}
// Extracts the angle - axis rotation from the transform rotation
//从变换的旋转角度转换为"角-轴"表示

var angle = 0.0;
var axis = Vector3.zero;
transform.rotation.ToAngleAxis(angle, axis);
Page last updated: 2011-1-16