Back to floats.

This commit is contained in:
2025-10-10 09:16:08 -05:00
parent c4c43b23ad
commit 349e6e7c94
16 changed files with 164 additions and 220 deletions

View File

@@ -76,4 +76,53 @@ void quadBuffer(
{ u0, v1 }, // UV
{ minX, maxY, z } // Position
};
}
void quadBuffer3D(
meshvertex_t *vertices,
const vec3 min,
const vec3 max,
const color_t color,
const vec2 uvMin,
const vec2 uvMax
) {
assertNotNull(vertices, "Vertices cannot be NULL");
assertNotNull(min, "Min vector cannot be NULL");
assertNotNull(max, "Max vector cannot be NULL");
assertNotNull(uvMin, "UV Min vector cannot be NULL");
assertNotNull(uvMax, "UV Max vector cannot be NULL");
// First triangle
vertices[0] = (meshvertex_t) {
{ color.r, color.g, color.b, color.a }, // Color
{ uvMin[0], uvMin[1] }, // UV
{ min[0], min[1], min[2] } // Position
};
vertices[1] = (meshvertex_t) {
{ color.r, color.g, color.b, color.a }, // Color
{ uvMax[0], uvMin[1] }, // UV
{ max[0], min[1], min[2] } // Position
};
vertices[2] = (meshvertex_t) {
{ color.r, color.g, color.b, color.a }, // Color
{ uvMax[0], uvMax[1] }, // UV
{ max[0], max[1], min[2] } // Position
};
// Second triangle
vertices[3] = (meshvertex_t) {
{ color.r, color.g, color.b, color.a }, // Color
{ uvMin[0], uvMin[1] }, // UV
{ min[0], min[1], min[2] } // Position
};
vertices[4] = (meshvertex_t) {
{ color.r, color.g, color.b, color.a }, // Color
{ uvMax[0], uvMax[1] }, // UV
{ max[0], max[1], min[2] } // Position
};
vertices[5] = (meshvertex_t) {
{ color.r, color.g, color.b, color.a }, // Color
{ uvMin[0], uvMax[1] }, // UV
{ min[0], max[1], min[2] } // Position
};
}