add c and jai

This commit is contained in:
2026-07-13 13:02:47 -04:00
parent cf8342f8d4
commit c5b14d7c41
33 changed files with 6306 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
get_triangle_centroid :: (t: Triangle) -> Vec2s64 {
return get_triangle_centroid(t.p1, t.p2, t.p3);
}
get_triangle_centroid :: (p1: Vec2s64, p2: Vec2s64, p3: Vec2s64) -> Vec2s64 {
x := (p1.x + p2.x + p3.x) / 3;
y := (p1.y + p2.y + p3.y) / 3;
return .{x, y};
}
make_quad_from_rect :: (p1: Vec2s64, p2: Vec2s64) -> Quad {
return .{
.{ p1.x, p1.y },
.{ p2.x, p1.y },
.{ p2.x, p2.y },
.{ p1.x, p2.y },
};
}