From 746e23c0f148142f0c108fdc56befb1ba8c80d66 Mon Sep 17 00:00:00 2001 From: Dk Date: Sat, 5 Apr 2014 06:39:42 +0530 Subject: [PATCH] Camera even moved more closer --- src/graphics/camera.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphics/camera.cpp b/src/graphics/camera.cpp index dab24b176..fbdd1d4f6 100644 --- a/src/graphics/camera.cpp +++ b/src/graphics/camera.cpp @@ -287,7 +287,7 @@ void Camera::reset() void Camera::setInitialTransform() { if (m_kart == NULL) return; - Vec3 start_offset(0, 1.6, -3.5); + Vec3 start_offset(0, 1.6, -3); Vec3 xx = m_kart->getTrans()(start_offset); m_camera->setPosition( xx.toIrrVector()); // Reset the target from the previous target (in case of a restart @@ -328,7 +328,7 @@ void Camera::smoothMoveCamera(float dt) float skid_angle = asin(skid_factor); float ratio = (current_speed - max_speed_without_zipper) / max_increase_with_zipper; ratio = ratio > -0.12 ? ratio : -0.12; - float camera_distance = -3.5 * (1 + ratio);// distance of camera from kart in x and z plane + float camera_distance = -3 * (1 + ratio);// distance of camera from kart in x and z plane Vec3 camera_offset(camera_distance * sin(skid_angle / 2), 1.6 * (1 + ratio / 2),camera_distance * cos(skid_angle / 2));// defines how far camera should be from player kart. Vec3 m_kart_camera_position_with_offset = m_kart->getTrans()(camera_offset); @@ -337,7 +337,7 @@ void Camera::smoothMoveCamera(float dt) core::vector3df current_target = m_kart->getXYZ().toIrrVector();// next target core::vector3df wanted_position = m_kart_camera_position_with_offset.toIrrVector();// new required position of camera - current_position += ((wanted_position - current_position) * dt * (m_kart->getSpeed()>0 ? m_kart->getSpeed()/3 : -1 * m_kart->getSpeed() * 2 ) ); + current_position += ((wanted_position - current_position) * dt * (m_kart->getSpeed()>0 ? m_kart->getSpeed()/3 : -1 * m_kart->getSpeed() * 1.5 ) ); if(m_mode!=CM_FALLING) m_camera->setPosition(current_position);