Files
Project-Reboot-3.0/Project Reboot 3.0/Vector.h
Milxnor 9be64d79ca Revert "alright im not so happy"
This reverts commit bd87832147.
2023-05-12 17:51:29 -04:00

52 lines
868 B
C++

#pragma once
struct FVector
{
public:
float X;
float Y;
float Z;
FVector() : X(0), Y(0), Z(0) {}
FVector(float x, float y, float z) : X(x), Y(y), Z(z) {}
FVector operator+(const FVector& A)
{
return FVector{ this->X + A.X, this->Y + A.Y, this->Z + A.Z };
}
FVector operator-(const FVector& A)
{
return FVector{ this->X - A.X, this->Y - A.Y, this->Z - A.Z };
}
FORCEINLINE float SizeSquared() const
{
return X * X + Y * Y + Z * Z;
}
FORCEINLINE float operator|(const FVector& V) const
{
return X * V.X + Y * V.Y + Z * V.Z;
}
FVector operator*(const float A)
{
return FVector{ this->X * A, this->Y * A, this->Z * A };
}
bool operator==(const FVector& A)
{
return X == A.X && Y == A.Y && Z == A.Z;
}
void operator+=(const FVector& A)
{
*this = *this + A;
}
void operator-=(const FVector& A)
{
*this = *this - A;
}
};