-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCurveModule.hpp
More file actions
36 lines (31 loc) · 869 Bytes
/
CurveModule.hpp
File metadata and controls
36 lines (31 loc) · 869 Bytes
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
#ifndef CURVEMODULE_HPP
#define CURVEMODULE_HPP
#include "Module.hpp"
class CurveModule : public Module {
public:
CurveModule() {
in_ports.push_back(&points);
points.position = make_vector(-1.0f, 0.0f);
out_ports.push_back(&coords);
coords.position = make_vector(1.0f, 0.0f);
current = 0;
twist = false;
}
virtual ~CurveModule() {
}
//Item functions:
virtual Vector2f size();
virtual void draw(Box2f viewport, Box2f screen_viewport, float scale, unsigned int recurse = 0);
//Module functions:
virtual void update(float elapsed_time);
virtual bool handle_event(SDL_Event const &event, Vector2f local_mouse);
void recalc();
//input:
PortDataContainer< vector< Vector4f > > points;
//curve points -> x, y, rot, time.
//output:
PortDataContainer< vector< Vector3f > > coords;
unsigned int current;
bool twist;
};
#endif //CURVEMODULE_HPP