<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace RobustEngine.Graphics
{
    public struct Vertex
    {

        public float X, Y, Z;      // Position
        public float R, G, B;      // Color
        public float NX, NY, NZ;   // Normal
        public float Tx, Ty;       // Texture

        #region Readonly 

        public static readonly Vertex Zero  = new Vertex(0, 0);
        public static readonly Vertex UnitX = new Vertex(1, 0);
        public static readonly Vertex UnitY = new Vertex(0, 1);
        public static readonly Vertex One   = new Vertex(1, 1);               
        public static readonly int    Stride  = 44;

        #endregion Readonly
        
        /// <summary>
        /// Create a 2D Vertex with two points. Specify a third float to make a 3d vertex. 
        /// </summary>
        /// <param name="x">Pos X</param>
        /// <param name="y">Pos Y</param>
        /// <param name="z">Pos Z</param>
        public Vertex(float x, float y, float z = 0)
        {
            X = x;
            Y = y;
            Z = z;

            R = 0f;
            G = 0f;
            B = 0f;

            NX = 0f;
            NY = 0f;
            NZ = 1f;

            Tx = 0f;
            Ty = 0f;
        }

        #region OPERATORS OH BOY

        #region VECTOR MATH 
        public static Vertex operator *(Vertex A, Vertex B)
        {
            return new Vertex(A.X * B.X, A.Y * B.Y, A.Z * B.Z);
        }

        public static Vertex operator +(Vertex A, Vertex B)
        {
            return new Vertex(A.X + B.X, A.Y + B.Y, A.Z + B.Z);
        }

        public static Vertex operator -(Vertex A, Vertex B)
        {
            return new Vertex(A.X - B.X, A.Y - B.Y, A.Z - B.Z);
        }

        public static Vertex operator /(Vertex A, Vertex B)
        {
            return new Vertex(A.X / B.X, A.Y / B.Y, A.Z / B.Z);
        }
        #endregion VECTOR MATH 

        #region INT MATH
        public static Vertex operator *(Vertex A, int B)
        {
            return new Vertex(A.X * B, A.Y * B, A.Z * B);
        }

        public static Vertex operator +(Vertex A, int B)
        {
            return new Vertex(A.X + B, A.Y + B, A.Z + B);
        }

        public static Vertex operator -(Vertex A, int B)
        {
            return new Vertex(A.X - B, A.Y - B, A.Z - B);
        }

        public static Vertex operator /(Vertex A, int B)
        {
            return new Vertex(A.X / B, A.Y / B, A.Z / B);
        }
        #endregion INT MATH

        #region FLOAT MATH
        public static Vertex operator *(Vertex A, float B)
        {
            return new Vertex(A.X * B, A.Y * B, A.Z * B);
        }

        public static Vertex operator +(Vertex A, float B)
        {
            return new Vertex(A.X + B, A.Y + B, A.Z + B);
        }

        public static Vertex operator -(Vertex A, float B)
        {
            return new Vertex(A.X - B, A.Y - B, A.Z - B);
        }

        public static Vertex operator /(Vertex A, float B)
        {
            return new Vertex(A.X / B, A.Y / B, A.Z / B);
        }
        #endregion INT MATH

        #endregion


    }
}
<commit_msg>Added Alpha, Vertex Identity<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace RobustEngine.Graphics
{
    public struct Vertex
    {

        public float X, Y, Z;      // Position
        public float R, G, B, A;      // Color
        public float Nx, Ny, Nz;   // Normal
        public float Tx, Ty;       // Texture

        #region Readonly 

        public static readonly Vertex Zero  = new Vertex(0, 0);
        public static readonly Vertex UnitX = new Vertex(1, 0);
        public static readonly Vertex UnitY = new Vertex(0, 1);
        public static readonly Vertex One   = new Vertex(1, 1);               
		public static readonly Vertex[] Identity = 
		{
			Zero,
			UnitX,
			One,
			UnitY
		};

		public static readonly int Stride = 48;

        #endregion Readonly
        
        /// <summary>
        /// Create a 2D Vertex with two points. Specify a third float to make a 3d vertex. 
        /// </summary>
        /// <param name="x">Pos X</param>
        /// <param name="y">Pos Y</param>
        /// <param name="z">Pos Z</param>
        public Vertex(float x, float y, float z = 0)
        {
            X = x;
            Y = y;
            Z = z;

            R = 0f;
            G = 0f;
            B = 0f;
			A = 1f;

            Nx = 0f;
            Ny = 0f;
            Nz = 1f;

            Tx = 0f;
            Ty = 0f;
        }

        #region OPERATORS OH BOY

        #region VECTOR MATH 
        public static Vertex operator *(Vertex A, Vertex B)
        {
            return new Vertex(A.X * B.X, A.Y * B.Y, A.Z * B.Z);
        }

        public static Vertex operator +(Vertex A, Vertex B)
        {
            return new Vertex(A.X + B.X, A.Y + B.Y, A.Z + B.Z);
        }

        public static Vertex operator -(Vertex A, Vertex B)
        {
            return new Vertex(A.X - B.X, A.Y - B.Y, A.Z - B.Z);
        }

        public static Vertex operator /(Vertex A, Vertex B)
        {
            return new Vertex(A.X / B.X, A.Y / B.Y, A.Z / B.Z);
        }
        #endregion VECTOR MATH 

        #region INT MATH
        public static Vertex operator *(Vertex A, int B)
        {
            return new Vertex(A.X * B, A.Y * B, A.Z * B);
        }

        public static Vertex operator +(Vertex A, int B)
        {
            return new Vertex(A.X + B, A.Y + B, A.Z + B);
        }

        public static Vertex operator -(Vertex A, int B)
        {
            return new Vertex(A.X - B, A.Y - B, A.Z - B);
        }

        public static Vertex operator /(Vertex A, int B)
        {
            return new Vertex(A.X / B, A.Y / B, A.Z / B);
        }
        #endregion INT MATH

        #region FLOAT MATH
        public static Vertex operator *(Vertex A, float B)
        {
            return new Vertex(A.X * B, A.Y * B, A.Z * B);
        }

        public static Vertex operator +(Vertex A, float B)
        {
            return new Vertex(A.X + B, A.Y + B, A.Z + B);
        }

        public static Vertex operator -(Vertex A, float B)
        {
            return new Vertex(A.X - B, A.Y - B, A.Z - B);
        }

        public static Vertex operator /(Vertex A, float B)
        {
            return new Vertex(A.X / B, A.Y / B, A.Z / B);
        }
        #endregion INT MATH

        #endregion


    }
}

{'fraction_non_alphanumeric': 0.11194141383948587, 'fraction_numerical': 0.006426543117620685, 'mean_word_length': 1.30202958376333, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6298751', 'n_tokens_mistral': 2251, 'n_tokens_neox': 2147, 'n_words': 723}