mirror of
https://github.com/aharabada/glitchy-engine-beef.git
synced 2026-09-05 13:01:52 +00:00
Made Vectors CRepr
This commit is contained in:
@@ -4,8 +4,7 @@ using System;
|
||||
namespace GlitchyEngine.Math
|
||||
{
|
||||
/// Represents a four component color with 8 bit per channel
|
||||
[CRepr]
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
public struct Color
|
||||
{
|
||||
// from DirectXColors.h
|
||||
|
||||
@@ -6,8 +6,7 @@ using internal GlitchyEngine.Math;
|
||||
namespace GlitchyEngine.Math
|
||||
{
|
||||
/// Represents an RGB color.
|
||||
[CRepr]
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
public struct ColorRGB
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -14,8 +14,7 @@ namespace GlitchyEngine.Math
|
||||
/**
|
||||
Represents a four component floating point color
|
||||
*/
|
||||
[BonTarget]
|
||||
[CRepr]
|
||||
[BonTarget, CRepr]
|
||||
struct ColorRGBA
|
||||
{
|
||||
// from DirectXColors.h
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace GlitchyEngine.Math
|
||||
{
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
public struct Quaternion
|
||||
{
|
||||
public const Quaternion Zero = .();
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
using Bon;
|
||||
using System;
|
||||
|
||||
namespace GlitchyEngine.Math;
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<bool, 2>]
|
||||
[SwizzleVector(2, "GlitchyEngine.Math.bool")]
|
||||
struct bool2
|
||||
@@ -10,7 +11,7 @@ struct bool2
|
||||
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<bool, 3>]
|
||||
[SwizzleVector(3, "GlitchyEngine.Math.bool")]
|
||||
struct bool3
|
||||
@@ -18,7 +19,7 @@ struct bool3
|
||||
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<bool, 4>]
|
||||
[SwizzleVector(4, "GlitchyEngine.Math.bool")]
|
||||
struct bool4
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace GlitchyEngine.Math;
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<double, 2>]
|
||||
[ComparableVector<double, 2>]
|
||||
[VectorMath<double, 2>]
|
||||
@@ -36,7 +36,7 @@ public struct double2
|
||||
}
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<double, 3>]
|
||||
[ComparableVector<double, 3>]
|
||||
[VectorMath<double, 3>]
|
||||
@@ -77,7 +77,7 @@ public struct double3
|
||||
}
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<double, 4>]
|
||||
[ComparableVector<double, 4>]
|
||||
[VectorMath<double, 4>]
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace GlitchyEngine.Math;
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<float, 2>]
|
||||
[ComparableVector<float, 2>]
|
||||
[VectorMath<float, 2>]
|
||||
@@ -34,7 +34,7 @@ public struct float2
|
||||
public static implicit operator Self(in Box2D.b2Vec2 value) => *(Self*)&value;
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<float, 3>]
|
||||
[ComparableVector<float, 3>]
|
||||
[VectorMath<float, 3>]
|
||||
@@ -65,7 +65,7 @@ public struct float3
|
||||
}
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<float, 4>]
|
||||
[ComparableVector<float, 4>]
|
||||
[VectorMath<float, 4>]
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace GlitchyEngine.Math;
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<half, 2>]
|
||||
[ComparableVector<half, 2>]
|
||||
[VectorMath<half, 2>]
|
||||
@@ -16,7 +16,7 @@ public struct half2
|
||||
}
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<half, 3>]
|
||||
[ComparableVector<half, 3>]
|
||||
[VectorMath<half, 3>]
|
||||
@@ -29,7 +29,7 @@ public struct half3
|
||||
}
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<half, 4>]
|
||||
[ComparableVector<half, 4>]
|
||||
[VectorMath<half, 4>]
|
||||
|
||||
@@ -3,7 +3,7 @@ using System;
|
||||
|
||||
namespace GlitchyEngine.Math;
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<int32, 2>]
|
||||
[ComparableVector<int32, 2>]
|
||||
[VectorMath<int32, 2>]
|
||||
@@ -26,7 +26,7 @@ public struct int2
|
||||
}
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<int32, 3>]
|
||||
[ComparableVector<int32, 3>]
|
||||
[VectorMath<int32, 3>]
|
||||
@@ -50,7 +50,7 @@ public struct int3
|
||||
}
|
||||
}
|
||||
|
||||
[BonTarget]
|
||||
[BonTarget, CRepr]
|
||||
[Vector<int32, 4>]
|
||||
[ComparableVector<int32, 4>]
|
||||
[VectorMath<int32, 4>]
|
||||
@@ -80,6 +80,7 @@ public struct int4
|
||||
[ComparableVector<uint32, 2>]
|
||||
//[VectorMath<uint32, 2>]
|
||||
[SwizzleVector(2, "GlitchyEngine.Math.uint")]
|
||||
[CRepr]
|
||||
public struct uint2
|
||||
{
|
||||
public const uint2 Zero = .(0, 0);
|
||||
@@ -103,6 +104,7 @@ public struct uint2
|
||||
[ComparableVector<uint32, 3>]
|
||||
//[VectorMath<uint32, 3>]
|
||||
[SwizzleVector(3, "GlitchyEngine.Math.uint")]
|
||||
[CRepr]
|
||||
public struct uint3
|
||||
{
|
||||
public const uint3 Zero = .(0, 0, 0);
|
||||
@@ -127,6 +129,7 @@ public struct uint3
|
||||
[ComparableVector<uint32, 4>]
|
||||
//[VectorMath<uint32, 4>]
|
||||
[SwizzleVector(4, "GlitchyEngine.Math.uint")]
|
||||
[CRepr]
|
||||
public struct uint4
|
||||
{
|
||||
public const uint4 Zero = .(0, 0, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user