-
Notifications
You must be signed in to change notification settings - Fork 1
/
Clicks.h
30 lines (24 loc) · 1.07 KB
/
Clicks.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
#ifndef __Clicks__
#define __Clicks__
#include "includes.h"
#include "Object.h"
class Clicks {
public:
Clicks();
virtual ~Clicks();
//This gets the clicked objects and clears the current set of clicked objects
vector<Object*> getClickedObjects();
//Sets the objects for clicks to check against
void setObjects(vector<Object*>* bob);
//This is what main calls for the click callback this is also where the objects get inserted into clickedObjects
void mouse_click(int mouse_x, int mouse_y, int height, int width, glm::mat4 position, glm::mat4 view, glm::vec3 o);
//Gets the direction of the last click so it can be drawn in minigames that want that kind of thing. It also clears out direction afterwards so the same line won't be drawn twice.
glm::vec3 getDirection();
private:
vector<Object*>* objects;
vector<Object*> clickedObjects;
glm::vec3 direction;
//Used to check against spheres. Give in the object and the o that is provided into mouse_click.
bool checkAgainstSphere(Object *object, glm::vec3 o);
};
#endif