vec2AlmostEq()

This commit is contained in:
Tenari
2026-08-29 17:27:59 -05:00
parent 756b83aeee
commit 8aab91479a
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -77,6 +77,11 @@ fn bool vec2Eq(Vec2 a, Vec2 b) {
return a.x == b.x && a.y == b.y;
}
fn bool vec2AlmostEq(Vec2 a, Vec2 b, Vec2 epsilon) {
return Abs(a.x - b.x) <= epsilon.x
&& Abs(a.y - b.y) <= epsilon.y;
}
fn Vec2f32 vec2Add(Vec2 a, Vec2 b) {
Vec2f32 result = a;
result.x += b.x;