comparison engine/core/view/camera.cpp @ 621:356634098bd9

* Removed the image chunking size variable from engine settings. * Replaced the existing define of PI and added some math related static const variables
author prock@33b003aa-7bff-0310-803a-e67f0ece8222
date Fri, 01 Oct 2010 14:09:47 +0000
parents d242e6ce6f9f
children 46b95d06c8c2
comparison
equal deleted inserted replaced
620:853d25234671 621:356634098bd9
325 // FL_WARN(_log, LMsg("vs2s matrix: ") << m_vscreen_2_screen << " s2vs matrix: " << m_screen_2_vscreen); 325 // FL_WARN(_log, LMsg("vs2s matrix: ") << m_vscreen_2_screen << " s2vs matrix: " << m_screen_2_vscreen);
326 } 326 }
327 327
328 void Camera::calculateZValue(ScreenPoint& screen_coords) { 328 void Camera::calculateZValue(ScreenPoint& screen_coords) {
329 int dy = -(screen_coords.y - toScreenCoordinates(m_location.getMapCoordinates()).y); 329 int dy = -(screen_coords.y - toScreenCoordinates(m_location.getMapCoordinates()).y);
330 screen_coords.z = static_cast<int>(tan(m_tilt * (M_PI / 180.0)) * static_cast<double>(dy)); 330 screen_coords.z = static_cast<int>(tan(m_tilt * (DBL_PI / 180.0)) * static_cast<double>(dy));
331 } 331 }
332 332
333 ExactModelCoordinate Camera::toMapCoordinates(ScreenPoint screen_coords, bool z_calculated) { 333 ExactModelCoordinate Camera::toMapCoordinates(ScreenPoint screen_coords, bool z_calculated) {
334 if (!z_calculated) { 334 if (!z_calculated) {
335 calculateZValue(screen_coords); 335 calculateZValue(screen_coords);