Skip to content

Commit 68049ac

Browse files
committed
add is_zero
1 parent 249d86e commit 68049ac

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

echo/math/Vector2.hx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ inline function copy_to(a:Vector2, b:Vector2):Vector2 {
280280
return a;
281281
}
282282

283+
inline function is_zero(v:Vector2):Bool {
284+
return v.x == 0 && v.y == 0;
285+
}
286+
283287
inline function negate(v:Vector2)
284288
return v.set(-v.x, -v.y);
285289

0 commit comments

Comments
 (0)