Skip to content

Commit

Permalink
libcore|Vector: Added a method for calculating area
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 72b4afd commit 0cc1b3e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doomsday/libs/core/include/de/core/vector.h
Expand Up @@ -269,6 +269,9 @@ class Vector2
Vector2 vecAbs = abs();
return vecAbs.x > vecAbs.y? 1 : 0;
}
Type area() const {
return x * y;
}
inline void decompose(Type *array) const {
for (int i = 0; i < 2; ++i) array[i] = (*this)[i];
}
Expand Down

0 comments on commit 0cc1b3e

Please sign in to comment.