1 #ifndef GWORM_CAMERA_H_
2 #define GWORM_CAMERA_H_
12 Camera(Vector<int> size, const Vector<float> &);
15 void SetTarget(const Vector<float> &t) { target = &t; }
17 Vector<int> ScreenSize() const { return size; }
19 void Resize(int w, int h) { Resize(Vector<int>(w, h)); }
20 void Resize(Vector<int>);
21 void Update(float deltaT) { } // unused
23 /// transform v from world coords to screen coords
24 Vector<int> ToScreen(Vector<float> v) const {
25 return Vector<int>(v - *target) + offset;
28 /// transform v from screen coords to world coords
29 Vector<float> FromScreen(Vector<int> v) const {
30 return Vector<float>(v - offset) + *target;
34 const Vector<float> *target;