aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Audio/Renderer/Utils/Math/Vector6.cs
blob: b2cd481b6d1c8f40c957ad493d8e54d1a1c83aa7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System.Runtime.CompilerServices;

namespace Ryujinx.Audio.Renderer.Utils.Math
{
    record struct Vector6
    {
        public float X;
        public float Y;
        public float Z;
        public float W;
        public float V;
        public float U;

        public Vector6(float value) : this(value, value, value, value, value, value)
        {
        }

        public Vector6(float x, float y, float z, float w, float v, float u)
        {
            X = x;
            Y = y;
            Z = z;
            W = w;
            V = v;
            U = u;
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static Vector6 operator +(Vector6 left, Vector6 right)
        {
            return new Vector6(left.X + right.X,
                               left.Y + right.Y,
                               left.Z + right.Z,
                               left.W + right.W,
                               left.V + right.V,
                               left.U + right.U);
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static Vector6 operator *(Vector6 left, Vector6 right)
        {
            return new Vector6(left.X * right.X,
                               left.Y * right.Y,
                               left.Z * right.Z,
                               left.W * right.W,
                               left.V * right.V,
                               left.U * right.U);
        }

        [MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static Vector6 operator *(Vector6 left, float right)
        {
            return left * new Vector6(right);
        }
    }
}