]> git.tdb.fi Git - r2c2.git/blobdiff - source/designer/cameracontroller.cpp
Move gauge to TrackAppearance
[r2c2.git] / source / designer / cameracontroller.cpp
index 0679cbe2f165934f93824929c6268640100690aa..7b7e5f1339672d0dac127d8a5931a76d6f54ef57 100644 (file)
@@ -59,7 +59,8 @@ void CameraController::adjust_distance(float delta)
        const GL::Vector3 &pos = camera.get_position();
        const GL::Vector3 &look = camera.get_look_direction();
        float dist = get_distance();
-       float low = view.get_layout().get_layout().get_catalogue().get_gauge()*5;
+       // XXX This should probably depend on the layout contents in some way
+       float low = 0.1;
        if(dist+delta<low)
                delta = low-dist;
        camera.set_position(pos-look*delta);
@@ -191,6 +192,6 @@ float CameraController::get_distance() const
 
 float CameraController::get_view_scale() const
 {
-       float t = tan(camera.get_field_of_view()/2)*2;
+       float t = tan(camera.get_field_of_view()/2.0f)*2.0f;
        return get_distance()*t;
 }