Skip to content

Commit 4f768fb

Browse files
committed
karm-math: Added Vec2::abs.
1 parent c4c67b6 commit 4f768fb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/karm-math/vec.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ union Vec2 {
7373
return {Karm::max(x, other.x), Karm::max(y, other.y)};
7474
}
7575

76+
constexpr Vec2 abs() const {
77+
return {Math::abs(x), Math::abs(y)};
78+
}
79+
7680
constexpr T dot(Vec2 other) const {
7781
return x * other.x + y * other.y;
7882
}

0 commit comments

Comments
 (0)