og-northstar-launcher/primedev/core/math/vector.h
Jack f5ab6fb5e8
Folder restructuring from primedev (#624)
Copies of over the primedev folder structure for easier cherry-picking of further changes

Co-authored-by: F1F7Y <filip.bartos07@proton.me>
2023-12-27 01:32:01 +01:00

47 lines
571 B
C++

#include <cmath>
#pragma once
union Vector3
{
struct
{
float x;
float y;
float z;
};
float raw[3];
void MakeValid()
{
for (auto& fl : raw)
if (std::isnan(fl))
fl = 0;
}
// todo: more operators maybe
bool operator==(const Vector3& other)
{
return x == other.x && y == other.y && z == other.z;
}
};
union QAngle
{
struct
{
float x;
float y;
float z;
float w;
};
float raw[4];
// todo: more operators maybe
bool operator==(const QAngle& other)
{
return x == other.x && y == other.y && z == other.z && w == other.w;
}
};