This commit is contained in:
aozhiwei 2022-08-08 19:30:00 +08:00
parent ab36720b8e
commit ba8d372c73
2 changed files with 7 additions and 0 deletions

View File

@ -118,4 +118,10 @@ namespace a8
{
return fabs(sqrt(x*x + y*y));
}
bool Vec2::IsZero()
{
return fabs(x) < 0.00001f && fabs(y) < 0.00001f;
}
}

View File

@ -26,6 +26,7 @@ namespace a8
Vec2 Perp();
float Dot(const Vec2& v) const;
float Norm() const;
bool IsZero();
static const Vec2 UP;
static const Vec2 DOWN;