summaryrefslogtreecommitdiff
path: root/engines/kokompe/kokompe/wysiwyg2d/control_object.h
blob: c464c390d16cd0ec4b3a689f5c33f0c5a5306ef5 (plain)
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 "../math/vector2.h"

/*
//types of control objects:
point (object space locations)
offset (vector relative to specific point)
direction (normalized vector)
radius (scalar)
*/

class control_object
{
	public:

		virtual void render_static() = 0; //basic rendering function
		virtual void render_hover() = 0; //rendering for when mouse is over the object
		virtual void render_drag(_vector2<double> mouse_position) = 0;

		virtual bool check_hit(_vector2<double> position, double radius) = 0;
		//virtual void start_drag(_vector2<double> p) = 0;
		//virtual void end_drag(_vector2<double> p) = 0;
			
		
		virtual _vector2<double> get_state() = 0;
		virtual void set_state(_vector2<double> new_param) = 0;
	private:

};

class point_control
	: public control_object
{
	public:
		point_control(_vector2<double> initial_position) : my_position(initial_position) {}

		bool check_hit(_vector2<double> position, double radius);

		void render_static(); //basic rendering function
		void render_hover(); //rendering for when mouse is over the object
		void render_drag(_vector2<double> mouse_position);
		_vector2<double> get_state();		
		void set_state(_vector2<double> new_param);
	private:
		_vector2<double> my_position;
	
};