This commit is contained in:
aozhiwei 2022-08-10 10:12:20 +08:00
parent ba8d372c73
commit 11776870c4
2 changed files with 2 additions and 2 deletions

View File

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

View File

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