32 lines
763 B
C#
32 lines
763 B
C#
using StgSharp.Controlling;
|
|
using StgSharp.Math;
|
|
|
|
using System;
|
|
using System.Data.Common;
|
|
using System.Numerics;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace StgSharp.Math
|
|
{
|
|
[StructLayout(LayoutKind.Explicit, Size = 16, Pack = 16)]
|
|
public struct Vec4d
|
|
{
|
|
[FieldOffset(0)] internal Vector4 vec;
|
|
[FieldOffset(0)] internal M128 reg;
|
|
|
|
[FieldOffset(0)] public float X;
|
|
[FieldOffset(4)] public float Y;
|
|
[FieldOffset(8)] public float Z;
|
|
[FieldOffset(12)] public float W;
|
|
|
|
public Vec4d(float x, float y, float z, float w)
|
|
{
|
|
vec = new Vector4(x, y, z, w);
|
|
}
|
|
|
|
public static implicit operator M128(Vec4d vec)
|
|
{
|
|
return vec.reg;
|
|
}
|
|
}
|
|
} |