diff --git a/engine/include/nova/math/vec2.h b/engine/include/nova/math/vec2.h new file mode 100644 index 0000000..c507012 --- /dev/null +++ b/engine/include/nova/math/vec2.h @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2025, Jayden Grubb + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#pragma once + +#include +#include + +namespace Nova { + NOVA_BEGIN_ALLOW_ANONYMOUS_TYPES + + template + struct Vec2 { + union { + struct { + T x, y; + }; + struct { + T u, v; + }; + struct { + T width, height; + }; + T data[2]; + }; + }; + + using iVec2 = Vec2; + using uVec2 = Vec2; + + NOVA_END_ALLOW_ANONYMOUS_TYPES +} // namespace Nova diff --git a/engine/include/nova/math/vec3.h b/engine/include/nova/math/vec3.h new file mode 100644 index 0000000..7211f51 --- /dev/null +++ b/engine/include/nova/math/vec3.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2025, Jayden Grubb + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#pragma once + +#include +#include + +namespace Nova { + NOVA_BEGIN_ALLOW_ANONYMOUS_TYPES + + template + struct Vec3 { + union { + struct { + T x, y, z; + }; + struct { + T r, g, b; + }; + T data[3]; + }; + }; + + using iVec3 = Vec3; + using uVec3 = Vec3; + + NOVA_END_ALLOW_ANONYMOUS_TYPES +} // namespace Nova diff --git a/engine/include/nova/math/vec4.h b/engine/include/nova/math/vec4.h new file mode 100644 index 0000000..22afb73 --- /dev/null +++ b/engine/include/nova/math/vec4.h @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2025, Jayden Grubb + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#pragma once + +#include +#include + +namespace Nova { + NOVA_BEGIN_ALLOW_ANONYMOUS_TYPES + + template + struct Vec4 { + union { + struct { + T x, y, z, w; + }; + struct { + T r, g, b, a; + }; + T data[4]; + }; + }; + + using iVec4 = Vec4; + using uVec4 = Vec4; + + NOVA_END_ALLOW_ANONYMOUS_TYPES +} // namespace Nova