Struct Quaternion
- Namespace
- Cobilas.GodotEngine.Utility.Numerics
- Assembly
- com.cobilas.godot.utility.dll
[Serializable]
public struct Quaternion : IEquatable<Quaternion>, IFormattable
- Implements
- Inherited Members
Constructors
Quaternion(Quaternion)
public Quaternion(Quaternion vector)
Parameters
vector
Quaternion
Quaternion(Vector4D)
public Quaternion(Vector4D vector)
Parameters
vector
Vector4D
Quaternion(float, float)
public Quaternion(float x, float y)
Parameters
Quaternion(float, float, float)
public Quaternion(float x, float y, float z)
Parameters
Quaternion(float, float, float, float)
public Quaternion(float x, float y, float z, float w)
Parameters
Fields
Deg2Rad
public const double Deg2Rad = 0.017453292519943295
Field Value
KEpsilon
public const float KEpsilon = 1E-06
Field Value
Rad2Deg
public const double Rad2Deg = 57.29577951308232
Field Value
w
public float w
Field Value
x
public float x
Field Value
y
public float y
Field Value
z
public float z
Field Value
Properties
Euler
public readonly Vector3D Euler { get; }
Property Value
Identity
public static Quaternion Identity { get; }
Property Value
Normalized
public readonly Quaternion Normalized { get; }
Property Value
Methods
Angle(Quaternion, Quaternion)
public static float Angle(Quaternion a, Quaternion b)
Parameters
a
Quaternionb
Quaternion
Returns
Dot(Quaternion, Quaternion)
public static float Dot(Quaternion a, Quaternion b)
Parameters
a
Quaternionb
Quaternion
Returns
Equals(Quaternion)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(Quaternion other)
Parameters
other
QuaternionAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override readonly bool Equals(object obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override readonly int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Normalize(Quaternion)
public static Quaternion Normalize(Quaternion q)
Parameters
Returns
ToEuler(Quaternion)
public static Vector3D ToEuler(Quaternion quaternion)
Parameters
quaternion
Quaternion
Returns
ToQuaternion(Vector3D)
public static Quaternion ToQuaternion(Vector3D vector)
Parameters
vector
Vector3D
Returns
ToString()
Returns the fully qualified type name of this instance.
public override readonly string ToString()
Returns
- string
The fully qualified type name.
ToString(string)
public readonly string ToString(string format)
Parameters
format
string
Returns
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
public readonly string ToString(string format, IFormatProvider formatProvider)
Parameters
format
stringThe format to use.-or- A null reference (
Nothing
in Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProvider
IFormatProviderThe provider to use to format the value.-or- A null reference (
Nothing
in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.
Operators
operator ==(Quaternion, Quaternion)
public static bool operator ==(Quaternion lhs, Quaternion rhs)
Parameters
lhs
Quaternionrhs
Quaternion
Returns
operator !=(Quaternion, Quaternion)
public static bool operator !=(Quaternion lhs, Quaternion rhs)
Parameters
lhs
Quaternionrhs
Quaternion
Returns
operator *(Quaternion, Quaternion)
public static Quaternion operator *(Quaternion lhs, Quaternion rhs)
Parameters
lhs
Quaternionrhs
Quaternion
Returns
operator *(Quaternion, Vector3D)
public static Vector3D operator *(Quaternion rotation, Vector3D point)
Parameters
rotation
Quaternionpoint
Vector3D