Documentation

Unity Engine

Download Unity

Unity Engine

axis(quaternion)

Returns the axis that a unit quaternion rotates around.
Read time 1 minuteLast updated 5 days ago

Definition

public static float3 axis(quaternion q)

Parameters

The unit quaternion.

Returns

Type

Description

float3The unit rotation axis of the input quaternion, or the x-axis if the quaternion is the identity.

Remarks

The result is the unit axis of the axis-angle representation of q. If q doesn't rotate, the axis is arbitrary and this function returns the x-axis. Use math.angle to get the corresponding rotation angle.