Math: add Vector2 is_zero method

This commit is contained in:
Randy Mackay 2015-09-15 15:53:44 +09:00
parent 094b9cb35e
commit 39340e70f8
1 changed files with 3 additions and 0 deletions

View File

@ -105,6 +105,9 @@ struct Vector2
// check if any elements are infinity
bool is_inf(void) const;
// check if all elements are zero
bool is_zero(void) const { return (fabsf(x) < FLT_EPSILON) && (fabsf(y) < FLT_EPSILON); }
// zero the vector
void zero()
{