/* $Id$
-This file is part of the MSP Märklin suite
+This file is part of R²C²
Copyright © 2010 Mikkosoft Productions, Mikko Rasa
Distributed under the GPL
*/
using namespace std;
using namespace Msp;
-using namespace Marklin;
+using namespace R2C2;
CameraController::CameraController(Designer &d, Graphics::EventSource &es, GL::Camera &c):
designer(d),
{
const GL::Vector3 &pos = camera.get_position();
const GL::Vector3 &look = camera.get_look_direction();
+ float dist = get_distance();
+ float low = designer.get_layout().get_catalogue().get_gauge()*5;
+ if(dist+delta<low)
+ delta = low-dist;
camera.set_position(GL::Vector3(pos.x-look.x*delta, pos.y-look.y*delta, pos.z-look.z*delta));
+ dist += delta;
+ camera.set_depth_clip(dist*0.02, dist*50);
}
void CameraController::rotate(float angle)