feat: added IEquatable interfaces to primitives
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using System;
|
||||
|
||||
namespace Engine.Core;
|
||||
|
||||
/// <summary>
|
||||
@@ -11,7 +13,7 @@ namespace Engine.Core;
|
||||
/// Initializes a new instance of the <see cref="Quaternion"/> struct with the specified positions.
|
||||
/// </remarks>
|
||||
[System.Diagnostics.DebuggerDisplay("{ToString(),nq}, Length: {Magnitude}, LengthSquared: {MagnitudeSquared}, Normalized: {Normalized.ToString(),nq}")]
|
||||
public readonly struct Quaternion(float x, float y, float z, float w)
|
||||
public readonly struct Quaternion(float x, float y, float z, float w) : IEquatable<Quaternion>
|
||||
{
|
||||
/// <summary>
|
||||
/// The X(i) imaginary of the <see cref="Quaternion"/>.
|
||||
@@ -288,6 +290,7 @@ public readonly struct Quaternion(float x, float y, float z, float w)
|
||||
/// <param name="obj">The object to compare with the current <see cref="Quaternion"/>.</param>
|
||||
/// <returns><see cref="true"/> if the specified object is equal to the current <see cref="Quaternion"/>; otherwise, <see cref="false"/>.</returns>
|
||||
public override bool Equals(object? obj) => obj is Quaternion quaternion && this == quaternion;
|
||||
public bool Equals(Quaternion other) => this == other;
|
||||
|
||||
/// <summary>
|
||||
/// Generates a hash code for the <see cref="Quaternion"/>.
|
||||
|
Reference in New Issue
Block a user