//Operator public static Matrix3x3 operator +(Matrix3x3 a, Matrix3x3 b) { #if IMOET_UNSAFE var m = a; UMath.MassAdd(a.Ptr, b.Ptr, m.Ptr, 9); return(m); #else return(UMath.AddMatrix(a, b)); #endif }
public static unsafe Vec2 operator +(Vec2 a, Vec2 b) { #if IMOET_UNSAFE Vec2 res = zero; UMath.MassAdd((float *)&a, (float *)&b, (float *)&res, 2); return(res); #else return(new Vec2(a.x + b.x, a.y + b.y)); #endif }
//Operator public static Matrix4x4 operator +(Matrix4x4 a, Matrix4x4 b) { #if IMOET_UNSAFE Matrix4x4 m = new Matrix4x4(); UMath.MassAdd(a.Ptr, b.Ptr, m.Ptr, 9); return(m); #else return(UMath.AddMatrix(a, b)); #endif }
public static unsafe Vec4 operator -(Vec4 left, Vec4 right) { #if IMOET_UNSAFE var res = default(Vec4); UMath.MassAdd((float *)&left, (float *)&right, (float *)&res, 4); return(res); #else return(new Vec4(left.x - right.x, left.y - right.y, left.z - right.z, left.w - right.z)); #endif }
public static unsafe Vec3 operator +(Vec3 l, Vec3 r) { #if IMOET_UNSAFE Vec3 res = zero; UMath.MassAdd((float *)&l, (float *)&r, (float *)&res, 3); return(res); #else return(new Vec3(l.x + r.x, l.y + r.y, l.z + r.z)); #endif }