This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Numerics; | |
using System.Runtime.CompilerServices; | |
public static class Helpers | |
{ | |
private static Matrix4x4 LocalMatrix(Vector3 translation, Quaternion rotation, Vector3 scale) | |
{ | |
// every element in matrix except of translation | |
// ends up being multiplied by 2, so we multiply whole vector by sqrt2 | |
// to skip multiplication at the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
namespace Utilities; | |
public static class SpanExtensions | |
{ | |
public static int Distinct<T>(this Span<T> items) | |
{ | |
EqualityComparer<T> comparer = EqualityComparer<T>.Default; |