Struct Quaternion
Assembly: UnityEngine.dll
Syntax
public struct Quaternion : IEquatable<Quaternion>
Constructors
|
Improve this Doc
View Source
Quaternion(Single, Single, Single, Single)
Declaration
public Quaternion(float x, float y, float z, float w)
Parameters
Fields
|
Improve this Doc
View Source
kEpsilon
Declaration
public const float kEpsilon = 1E-06F
Field Value
|
Improve this Doc
View Source
w
Declaration
Field Value
|
Improve this Doc
View Source
x
Declaration
Field Value
|
Improve this Doc
View Source
y
Declaration
Field Value
|
Improve this Doc
View Source
z
Declaration
Field Value
Properties
|
Improve this Doc
View Source
eulerAngles
Declaration
public Vector3 eulerAngles { get; set; }
Property Value
|
Improve this Doc
View Source
identity
Declaration
public static Quaternion identity { get; }
Property Value
|
Improve this Doc
View Source
Item[Int32]
Declaration
public float this[int index] { get; set; }
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Property Value
|
Improve this Doc
View Source
normalized
Declaration
public Quaternion normalized { get; }
Property Value
Methods
|
Improve this Doc
View Source
Angle(Quaternion, Quaternion)
Declaration
public static float Angle(Quaternion a, Quaternion b)
Parameters
Returns
AngleAxis(Single, Vector3)
Declaration
public static Quaternion AngleAxis(float angle, Vector3 axis)
Parameters
Returns
|
Improve this Doc
View Source
AxisAngle(Vector3, Single)
Declaration
[Obsolete("Use Quaternion.AngleAxis instead. This function was deprecated because it uses radians instead of degrees")]
public static Quaternion AxisAngle(Vector3 axis, float angle)
Parameters
Returns
|
Improve this Doc
View Source
Dot(Quaternion, Quaternion)
Declaration
public static float Dot(Quaternion a, Quaternion b)
Parameters
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
Object |
other |
|
Returns
Overrides
|
Improve this Doc
View Source
Equals(Quaternion)
Declaration
public bool Equals(Quaternion other)
Parameters
Returns
|
Improve this Doc
View Source
Euler(Single, Single, Single)
Declaration
public static Quaternion Euler(float x, float y, float z)
Parameters
Returns
|
Improve this Doc
View Source
Euler(Vector3)
Declaration
public static Quaternion Euler(Vector3 euler)
Parameters
Type |
Name |
Description |
Vector3 |
euler |
|
Returns
|
Improve this Doc
View Source
EulerAngles(Single, Single, Single)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public static Quaternion EulerAngles(float x, float y, float z)
Parameters
Returns
|
Improve this Doc
View Source
EulerAngles(Vector3)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public static Quaternion EulerAngles(Vector3 euler)
Parameters
Type |
Name |
Description |
Vector3 |
euler |
|
Returns
|
Improve this Doc
View Source
EulerRotation(Single, Single, Single)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public static Quaternion EulerRotation(float x, float y, float z)
Parameters
Returns
|
Improve this Doc
View Source
EulerRotation(Vector3)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public static Quaternion EulerRotation(Vector3 euler)
Parameters
Type |
Name |
Description |
Vector3 |
euler |
|
Returns
FromToRotation(Vector3, Vector3)
Declaration
public static Quaternion FromToRotation(Vector3 fromDirection, Vector3 toDirection)
Parameters
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
Inverse(Quaternion)
Declaration
public static Quaternion Inverse(Quaternion rotation)
Parameters
Returns
Lerp(Quaternion, Quaternion, Single)
Declaration
public static Quaternion Lerp(Quaternion a, Quaternion b, float t)
Parameters
Returns
LerpUnclamped(Quaternion, Quaternion, Single)
Declaration
public static Quaternion LerpUnclamped(Quaternion a, Quaternion b, float t)
Parameters
Returns
|
Improve this Doc
View Source
LookRotation(Vector3)
Declaration
[ExcludeFromDocs]
public static Quaternion LookRotation(Vector3 forward)
Parameters
Type |
Name |
Description |
Vector3 |
forward |
|
Returns
LookRotation(Vector3, Vector3)
Declaration
public static Quaternion LookRotation(Vector3 forward, [DefaultValue("Vector3.up")] Vector3 upwards)
Parameters
Returns
|
Improve this Doc
View Source
Normalize()
Declaration
|
Improve this Doc
View Source
Normalize(Quaternion)
Declaration
public static Quaternion Normalize(Quaternion q)
Parameters
Returns
|
Improve this Doc
View Source
RotateTowards(Quaternion, Quaternion, Single)
Declaration
public static Quaternion RotateTowards(Quaternion from, Quaternion to, float maxDegreesDelta)
Parameters
Returns
|
Improve this Doc
View Source
Set(Single, Single, Single, Single)
Declaration
public void Set(float newX, float newY, float newZ, float newW)
Parameters
|
Improve this Doc
View Source
SetAxisAngle(Vector3, Single)
Declaration
[Obsolete("Use Quaternion.AngleAxis instead. This function was deprecated because it uses radians instead of degrees.")]
public void SetAxisAngle(Vector3 axis, float angle)
Parameters
|
Improve this Doc
View Source
SetEulerAngles(Single, Single, Single)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public void SetEulerAngles(float x, float y, float z)
Parameters
|
Improve this Doc
View Source
SetEulerAngles(Vector3)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public void SetEulerAngles(Vector3 euler)
Parameters
Type |
Name |
Description |
Vector3 |
euler |
|
|
Improve this Doc
View Source
SetEulerRotation(Single, Single, Single)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public void SetEulerRotation(float x, float y, float z)
Parameters
|
Improve this Doc
View Source
SetEulerRotation(Vector3)
Declaration
[Obsolete("Use Quaternion.Euler instead. This function was deprecated because it uses radians instead of degrees.")]
public void SetEulerRotation(Vector3 euler)
Parameters
Type |
Name |
Description |
Vector3 |
euler |
|
|
Improve this Doc
View Source
SetFromToRotation(Vector3, Vector3)
Declaration
public void SetFromToRotation(Vector3 fromDirection, Vector3 toDirection)
Parameters
|
Improve this Doc
View Source
SetLookRotation(Vector3)
Declaration
[ExcludeFromDocs]
public void SetLookRotation(Vector3 view)
Parameters
|
Improve this Doc
View Source
SetLookRotation(Vector3, Vector3)
Declaration
public void SetLookRotation(Vector3 view, [DefaultValue("Vector3.up")] Vector3 up)
Parameters
Slerp(Quaternion, Quaternion, Single)
Declaration
public static Quaternion Slerp(Quaternion a, Quaternion b, float t)
Parameters
Returns
SlerpUnclamped(Quaternion, Quaternion, Single)
Declaration
public static Quaternion SlerpUnclamped(Quaternion a, Quaternion b, float t)
Parameters
Returns
|
Improve this Doc
View Source
ToAngleAxis(out Single, out Vector3)
Declaration
public void ToAngleAxis(out float angle, out Vector3 axis)
Parameters
|
Improve this Doc
View Source
ToAxisAngle(out Vector3, out Single)
Declaration
[Obsolete("Use Quaternion.ToAngleAxis instead. This function was deprecated because it uses radians instead of degrees.")]
public void ToAxisAngle(out Vector3 axis, out float angle)
Parameters
|
Improve this Doc
View Source
ToEuler()
Declaration
[Obsolete("Use Quaternion.eulerAngles instead. This function was deprecated because it uses radians instead of degrees.")]
public Vector3 ToEuler()
Returns
|
Improve this Doc
View Source
ToEulerAngles()
Declaration
[Obsolete("Use Quaternion.eulerAngles instead. This function was deprecated because it uses radians instead of degrees.")]
public Vector3 ToEulerAngles()
Returns
|
Improve this Doc
View Source
ToEulerAngles(Quaternion)
Declaration
[Obsolete("Use Quaternion.eulerAngles instead. This function was deprecated because it uses radians instead of degrees.")]
public static Vector3 ToEulerAngles(Quaternion rotation)
Parameters
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
|
Improve this Doc
View Source
ToString(String)
Declaration
public string ToString(string format)
Parameters
Type |
Name |
Description |
String |
format |
|
Returns
Operators
|
Improve this Doc
View Source
Equality(Quaternion, Quaternion)
Declaration
public static bool operator ==(Quaternion lhs, Quaternion rhs)
Parameters
Returns
|
Improve this Doc
View Source
Inequality(Quaternion, Quaternion)
Declaration
public static bool operator !=(Quaternion lhs, Quaternion rhs)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(Quaternion, Quaternion)
Declaration
public static Quaternion operator *(Quaternion lhs, Quaternion rhs)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(Quaternion, Vector3)
Declaration
public static Vector3 operator *(Quaternion rotation, Vector3 point)
Parameters
Returns
Implements
Extension Methods