17 :
Camera(), _z_near(0.2), _z_far(40.0), _vert_fov(70), _horiz_fov(70), _aspect(1.0)
40 glMatrixMode(GL_MODELVIEW);
43 glRotatef(-
_pitch, 1.0, 0.0, 0.0);
44 glRotatef(-
_yaw, 0.0, 0.0, 1.0);
46 glTranslatef(-
_x, -
_y, -
_z);
54 glMatrixMode(GL_PROJECTION);
67 glMatrixMode(GL_MODELVIEW);
103 glMatrixMode(GL_MODELVIEW);
106 glRotatef(-
_pitch, 1.0, 0.0, 0.0);
107 glRotatef(-
_yaw, 0.0, 0.0, 1.0);
109 glTranslatef(-
_x, -
_y, 0.0);
115 glMatrixMode(GL_PROJECTION);
118 glOrtho(-_pixels_width / 2.0 / _scale, _pixels_width / 2.0 / _scale,
119 -_pixels_height / 2.0 / _scale, _pixels_height / 2.0 / _scale, _y_min * _scale * 2,
120 _y_max * _scale * 2);
122 glMatrixMode(GL_MODELVIEW);
128 _pixels_width = pixels_width;
129 _pixels_height = pixels_height;
163 double to_scale = -
scale;
164 const double old_scale = _scale;
167 double factor = 1.0 + fabs(to_scale) / 25;
170 else if (factor > 2.5)
174 shift_x = shift_x / w - 0.5;
175 shift_y = shift_y / h - 0.5;
179 shift_x *= factor - 1.0;
180 shift_y *= factor - 1.0;
185 move(shift_x * w, -shift_y * h);
193 move(-shift_x * w / old_scale * _scale, shift_y * h / old_scale * _scale);
void Save(Worldfile *wf, int sec)
The Stage library uses its own namespace.
void Load(Worldfile *wf, int sec)
void forward(double amount)
int ReadTuple(const int entity, const char *name, const unsigned int first, const unsigned int num, const char *format,...)
void Save(Worldfile *wf, int sec)
void WriteTuple(const int entity, const char *name, const unsigned int first, const unsigned int count, const char *format,...)
void WriteFloat(int entity, const char *name, double value)
virtual void Draw(void) const
void strafe(double amount)
double ReadFloat(int entity, const char *name, double value)
void Load(Worldfile *wf, int sec)
void setPitch(double pitch)
void move(double x, double y, double z)
virtual void SetProjection(void) const
void move(double x, double y)
virtual void SetProjection(void) const
virtual void Draw() const