12 Camera(Vector<int> size, const Vector<float> &);
15 void SetTarget(const Vector<float> &t) { target = &t; }
16 void SetScale(Vector<float> s) { scale = s; }
18 Vector<int> ScreenSize() const { return size; }
20 void Resize(int w, int h) { Resize(Vector<int>(w, h)); }
21 void Resize(Vector<int>);
22 void Update(float deltaT) { } // unused
24 /// transform v from world coords to screen coords
25 Vector<int> ToScreen(Vector<float> v) const {
26 return Vector<int>(round(ToScale(v - *target))) + offset;
28 /// scale v from world to screen
29 Vector<float> ToScale(Vector<float> v) const {
30 return Vector<float>(v * scale);
33 /// transform v from screen coords to world coords
34 Vector<float> FromScreen(Vector<int> v) const {
35 return FromScale(v - offset) + *target;
37 /// scale v from screen to world
38 Vector<float> FromScale(Vector<int> v) const {
39 return Vector<float>(v) / scale;
43 const Vector<float> *target;