Made the time for the camera to move to the final
position configurable in stk_config and increased this value from 1.0 sec to 1.5 sec. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@2907 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
ea918dacbe
commit
e9ceca6ec0
@ -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
|
||||
;; -----------------------------
|
||||
|
@ -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_time<stk_config->m_final_camera_time )
|
||||
{
|
||||
m_xyz += m_velocity*dt;
|
||||
m_hpr += m_angular_velocity*dt;
|
||||
|
@ -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 );
|
||||
|
@ -58,6 +58,8 @@ public:
|
||||
float m_offroad_tolerance; /**<Road width is extended by that
|
||||
fraction to make shortcut detection
|
||||
more forgiving. */
|
||||
float m_final_camera_time; /**<Time for the movement of the final
|
||||
* camera. */
|
||||
float m_explosion_impulse; /**<Impulse affecting each non-hit kart.*/
|
||||
float m_explosion_impulse_objects;/**<Impulse of explosion on moving
|
||||
objects, e.g. road cones, ... */
|
||||
|
Loading…
Reference in New Issue
Block a user