// Copyright (c) 2024 Codemongous LLC. All Rights Reserved.

#pragma once

#include <cmath>

namespace Sourcify
{
	struct SCW_FVector
	{
		double X;
		double Y;
		double Z;

		SCW_FVector() : X(0.0), Y(0.0), Z(0.0) {}
		SCW_FVector(double InX, double InY, double InZ) : X(InX), Y(InY), Z(InZ) {}

		bool operator==(const SCW_FVector& Other) const
		{
			return X == Other.X && Y == Other.Y && Z == Other.Z;
		}

		bool operator!=(const SCW_FVector& Other) const
		{
			return !(*this == Other);
		}

		bool Equals(const SCW_FVector& Other, double Tolerance = 1.e-4) const
		{
			return std::abs(X - Other.X) <= Tolerance && std::abs(Y - Other.Y) <= Tolerance && std::abs(Z - Other.Z) <= Tolerance;
		}

		static SCW_FVector Zero() { return SCW_FVector{ 0.0, 0.0, 0.0 }; }
		static SCW_FVector One() { return SCW_FVector{ 1.0, 1.0, 1.0 }; }
	};
} // namespace Sourcify