Replace glm with vec.h

Vec2, IVec2, Vec3, Vec4, IVec4 and a column-major Mat4, with glm's formulas, in one header.
Free functions are vec_ and mat4_ prefixed. The leaked using namespace glm is gone.
Render goldens still match.
This commit is contained in:
shweet committed 2026-11-22 18:15:02 -05:00
1 parent c38a3a9890
commit 03bbb93ba6
79 files changed
+1232 -810

No files matched your search

+5 -7
View File
@@ -1,7 +1,7 @@
#pragma once
#include <array>
#include <glm/glm/mat4x4.hpp>
#include "vec.h"
template <typename T> constexpr T percent_to_unit(T value)
{
@@ -23,7 +23,7 @@ constexpr int float_to_uint8(float value)
return (int)(value * 255);
}
constexpr std::array<float, 16> uv_vertices_get(glm::vec2 uvMin, glm::vec2 uvMax)
constexpr std::array<float, 16> uv_vertices_get(Vec2 uvMin, Vec2 uvMax)
{
return {0.0f, 0.0f, uvMin.x, uvMin.y, 1.0f, 0.0f, uvMax.x, uvMin.y,
1.0f, 1.0f, uvMax.x, uvMax.y, 0.0f, 1.0f, uvMin.x, uvMax.y};
@@ -33,12 +33,10 @@ int float_decimals_needed(float);
const char* float_format_get(float);
const char* vec2_format_get(const glm::vec2&);
const char* vec2_format_get(const Vec2&);
glm::mat4 quad_model_get(glm::vec2 = {}, glm::vec2 = {}, glm::vec2 = {}, glm::vec2 = glm::vec2(1.0f), float = {},
glm::vec2 = {});
glm::mat4 quad_model_parent_get(glm::vec2 = {}, glm::vec2 = {}, glm::vec2 = glm::vec2(1.0f), float = {},
glm::vec2 = {});
Mat4 quad_model_get(Vec2 = {}, Vec2 = {}, Vec2 = {}, Vec2 = Vec2(1.0f), float = {}, Vec2 = {});
Mat4 quad_model_parent_get(Vec2 = {}, Vec2 = {}, Vec2 = Vec2(1.0f), float = {}, Vec2 = {});
float random_unit_get();
float random_in_range(float min, float max);