Quaternion.ToAngleAxis Manual     Reference     Scripting  
Scripting > Runtime Classes > Quaternion
Quaternion.ToAngleAxis

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

Description

Converts a rotation to angle-axis representation.

JavaScript
// 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 Example() {
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 Example():
transform.rotation.ToAngleAxis(angle, axis)