-
Notifications
You must be signed in to change notification settings - Fork 1
/
Utils.h
47 lines (38 loc) · 773 Bytes
/
Utils.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#pragma once
#include <stdio.h>
#include <string>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
class Vector2 {
public:
Vector2(float x = .0f, float y = .0f);
static Vector2 Zero();
float x;
float y;
};
class Vector3 {
public:
Vector3(float x = .0f, float y = .0f, float z = .0f);
static Vector3 Zero();
float x;
float y;
float z;
};
class Vector4 {
public:
Vector4(float x = .0f, float y = .0f, float w = .0f, float z = .0f);
static Vector4 Zero();
float x;
float y;
float w;
float z;
};
class Utils {
public:
static float EuclidianDistance(Vector2 p1, Vector2 p2);
static bool RectangleIntersection(Vector2 tl1, Vector2 br1, Vector2 tl2, Vector2 br2);
static int RandNumber(int min, int max);
};