diff --git a/data/stk_config.data b/data/stk_config.data index 095e3fe48..8524db1d9 100644 --- a/data/stk_config.data +++ b/data/stk_config.data @@ -18,10 +18,13 @@ (max-history 10000) ;; maximum number of history frames. (max-skidmarks 100) ;; max. number of skidmarks per kart. (skid-fadeout-time 60) ;; Time till skidm marks fade out - (slowdown-factor 10) ;; Engine reduction depending on terrain, see - ;; kart for details. + (slowdown-factor 10) ;; Engine reduction depending on terrain, + ;; see kart for details. (delay-finish-time 10) ;; delay till race results are displayed. - (music-credit-time 10) ;; time for which the music credits are displayed. + (music-credit-time 10) ;; time for which the music credits + ;; are displayed. + (final-camera-time 1.5) ;; time for the final camera to reach + ;; its destination ;; Attachment related parameters ;; ----------------------------- diff --git a/src/camera.cpp b/src/camera.cpp index e2ccce5ae..487711398 100644 --- a/src/camera.cpp +++ b/src/camera.cpp @@ -108,9 +108,10 @@ void Camera::setMode(Mode mode) const Track* track=RaceManager::getTrack(); // If the track doesn't have a final position, ignore this mode if(!track->hasFinalCamera()) return; - const float duration = 1.0f; - m_velocity = (track->getCameraPosition()-m_xyz)/duration; - m_angular_velocity = (track->getCameraHPR()-m_hpr)/duration; + m_velocity = (track->getCameraPosition()-m_xyz) + / stk_config->m_final_camera_time; + m_angular_velocity = (track->getCameraHPR()-m_hpr) + / stk_config->m_final_camera_time; m_final_time = 0.0f; } m_mode = mode; @@ -219,7 +220,7 @@ void Camera::finalCamera(float dt) { // Turn/move the camera for 1 second only m_final_time += dt; - if( m_final_time<1.0f ) + if( m_final_timem_final_camera_time ) { m_xyz += m_velocity*dt; m_hpr += m_angular_velocity*dt; diff --git a/src/stk_config.cpp b/src/stk_config.cpp index ff1a9a958..196fc1a60 100644 --- a/src/stk_config.cpp +++ b/src/stk_config.cpp @@ -109,6 +109,7 @@ void STKConfig::load(const std::string &filename) CHECK_NEG(m_zipper_speed_gain, "zipper-speed-gain" ); CHECK_NEG(m_shortcut_length, "shortcut-length" ); CHECK_NEG(m_offroad_tolerance, "offroad-tolerance" ); + CHECK_NEG(m_final_camera_time, "final-camera-time" ); CHECK_NEG(m_explosion_impulse, "explosion-impulse" ); CHECK_NEG(m_explosion_impulse_objects, "explosion-impulse-objects" ); CHECK_NEG(m_max_history, "max-history" ); @@ -137,6 +138,7 @@ void STKConfig::init_defaults() m_shortcut_length = m_music_credit_time = m_delay_finish_time = m_skid_fadeout_time = m_slowdown_factor = m_offroad_tolerance = + m_final_camera_time = UNDEFINED; m_max_karts = -100; m_grid_order = -100; @@ -178,6 +180,7 @@ void STKConfig::getAllData(const lisp::Lisp* lisp) lisp->get("anvil-weight", m_anvil_weight ); lisp->get("shortcut-length", m_shortcut_length ); lisp->get("offroad-tolerance", m_offroad_tolerance ); + lisp->get("final-camera-time", m_final_camera_time ); lisp->get("anvil-speed-factor", m_anvil_speed_factor ); lisp->get("parachute-friction", m_parachute_friction ); lisp->get("parachute-time", m_parachute_time ); diff --git a/src/stk_config.hpp b/src/stk_config.hpp index d3923e5cb..85e067ed2 100644 --- a/src/stk_config.hpp +++ b/src/stk_config.hpp @@ -58,6 +58,8 @@ public: float m_offroad_tolerance; /**