Quaternion.ToAngleAxisfunction ToAngleAxis (out angle : float, out axis : Vector3) : voidDescriptionConverts a rotation to angle-axis representation.
JavaScripts
// Extracts the angle - axis rotation from the transform rotation
var angle = 0.0; var axis = Vector3.zero; transform.rotation.ToAngleAxis(angle, axis); using UnityEngine;
using System.Collections; public class example : MonoBehaviour { public float angle = 0.0F; public Vector3 axis = Vector3.zero; void Awake() { transform.rotation.ToAngleAxis(out angle, out axis); } } import UnityEngine
import System.Collections class example(MonoBehaviour): public angle as single = 0.0F public axis as Vector3 = Vector3.zero def Awake(): transform.rotation.ToAngleAxis(angle, axis) |
