Added min(vector, vector) and max(vector,vector) functions
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
//
|
||||
|
||||
#include "../include/kraken-math.h"
|
||||
#include "krhelpers.h"
|
||||
|
||||
namespace kraken {
|
||||
|
||||
@@ -253,4 +254,12 @@ int Vector2i::Dot(const Vector2i &v1, const Vector2i &v2) {
|
||||
return v1.x * v2.x + v1.y * v2.y;
|
||||
}
|
||||
|
||||
Vector2i Vector2i::Min(const Vector2i &v1, const Vector2i &v2) {
|
||||
return Vector2i::Create(KRMIN(v1.x, v2.x), KRMIN(v1.y, v2.y));
|
||||
}
|
||||
|
||||
Vector2i Vector2i::Max(const Vector2i &v1, const Vector2i &v2) {
|
||||
return Vector2i::Create(KRMAX(v1.x, v2.x), KRMAX(v1.y, v2.y));
|
||||
}
|
||||
|
||||
} // namepsace kraken
|
||||
|
||||
Reference in New Issue
Block a user