Quaternion

More information can be found in the Unity API Reference

Constructors

Constructor

Description

Quaternion()

Quaternion(x, y, z, w)

Members

Member

Description

eulerAngles

normalized

w

x

y

z

Methods

Method

Description

GetHashCode()

Normalize()

Set(newX, newY, newZ, newW)

SetFromToRotation(fromDirection, toDirection)

SetLookRotation(view)

SetLookRotation(view, up)

ToAngleAxis(angle, axis)

ToString()

ToString(format)

Static members

Member

Description

identity

kEpsilon

Static methods

Method

Description

Angle(a, b)

AngleAxis(angle, axis)

Dot(a, b)

Euler(euler)

Euler(x, y, z)

FromToRotation(fromDirection, toDirection)

Inverse(rotation)

Lerp(a, b, t)

LerpUnclamped(a, b, t)

LookRotation(forward)

LookRotation(forward, upwards)

Normalize(q)

RotateTowards(from, to, maxDegreesDelta)

Slerp(a, b, t)

SlerpUnclamped(a, b, t)

Operators

Operator

Description

operator !=(lhs, rhs)

operator *(lhs, rhs)

operator *(rotation, point)

operator ==(lhs, rhs)

Details

class Quaternion
Quaternion Quaternion(float x, float y, float z, float w)
Quaternion Quaternion()
Vector3 eulerAngles
const Quaternion normalized
float w
float x
float y
float z
int GetHashCode()
void Normalize()
void Set(float newX, float newY, float newZ, float newW)
void SetFromToRotation(Vector3 fromDirection, Vector3 toDirection)
void SetLookRotation(Vector3 view)
void SetLookRotation(Vector3 view, Vector3 up)
void ToAngleAxis(float angle, Vector3 axis)
string ToString()
string ToString(string format)
static const Quaternion identity
static const float kEpsilon
static float Angle(Quaternion a, Quaternion b)
static Quaternion AngleAxis(float angle, Vector3 axis)
static float Dot(Quaternion a, Quaternion b)
static Quaternion Euler(Vector3 euler)
static Quaternion Euler(float x, float y, float z)
static Quaternion FromToRotation(Vector3 fromDirection, Vector3 toDirection)
static Quaternion Inverse(Quaternion rotation)
static Quaternion Lerp(Quaternion a, Quaternion b, float t)
static Quaternion LerpUnclamped(Quaternion a, Quaternion b, float t)
static Quaternion LookRotation(Vector3 forward)
static Quaternion LookRotation(Vector3 forward, Vector3 upwards)
static Quaternion Normalize(Quaternion q)
static Quaternion RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta)
static Quaternion Slerp(Quaternion a, Quaternion b, float t)
static Quaternion SlerpUnclamped(Quaternion a, Quaternion b, float t)
static bool operator!=(Quaternion lhs, Quaternion rhs)
static Quaternion operator*(Quaternion lhs, Quaternion rhs)
static Vector3 operator*(Quaternion rotation, Vector3 point)
static bool operator==(Quaternion lhs, Quaternion rhs)