Reduce camera shaking (caused by camera being updated during rewind).
This commit is contained in:
parent
6c18664967
commit
4f9353e03f
@ -1269,6 +1269,7 @@ void Kart::update(float dt)
|
|||||||
if(!history->replayHistory() || !history->dontDoPhysics())
|
if(!history->replayHistory() || !history->dontDoPhysics())
|
||||||
m_controller->update(dt);
|
m_controller->update(dt);
|
||||||
|
|
||||||
|
#ifndef SERVER_ONLY
|
||||||
#undef DEBUG_CAMERA_SHAKE
|
#undef DEBUG_CAMERA_SHAKE
|
||||||
#ifdef DEBUG_CAMERA_SHAKE
|
#ifdef DEBUG_CAMERA_SHAKE
|
||||||
Log::verbose("camera", "%s t %f %f xyz %f %f %f v %f %f %f d3 %f d2 %f",
|
Log::verbose("camera", "%s t %f %f xyz %f %f %f v %f %f %f d3 %f d2 %f",
|
||||||
@ -1280,6 +1281,7 @@ void Kart::update(float dt)
|
|||||||
(Camera::getCamera(0)->getXYZ()-getXYZ()).length_2d()
|
(Camera::getCamera(0)->getXYZ()-getXYZ()).length_2d()
|
||||||
);
|
);
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef DEBUG_TO_COMPARE_KART_PHYSICS
|
#undef DEBUG_TO_COMPARE_KART_PHYSICS
|
||||||
#ifdef DEBUG_TO_COMPARE_KART_PHYSICS
|
#ifdef DEBUG_TO_COMPARE_KART_PHYSICS
|
||||||
|
@ -1002,12 +1002,17 @@ void World::update(float dt)
|
|||||||
}
|
}
|
||||||
PROFILER_POP_CPU_MARKER();
|
PROFILER_POP_CPU_MARKER();
|
||||||
|
|
||||||
|
// Updating during a rewind introduces stuttering in the camera
|
||||||
|
if (!RewindManager::get()->isRewinding())
|
||||||
|
{
|
||||||
PROFILER_PUSH_CPU_MARKER("World::update (camera)", 0x60, 0x7F, 0x00);
|
PROFILER_PUSH_CPU_MARKER("World::update (camera)", 0x60, 0x7F, 0x00);
|
||||||
for(unsigned int i=0; i<Camera::getNumCameras(); i++)
|
|
||||||
|
for (unsigned int i = 0; i < Camera::getNumCameras(); i++)
|
||||||
{
|
{
|
||||||
Camera::getCamera(i)->update(dt);
|
Camera::getCamera(i)->update(dt);
|
||||||
}
|
}
|
||||||
PROFILER_POP_CPU_MARKER();
|
PROFILER_POP_CPU_MARKER();
|
||||||
|
} // if !rewind
|
||||||
|
|
||||||
if(race_manager->isRecordingRace()) ReplayRecorder::get()->update(dt);
|
if(race_manager->isRecordingRace()) ReplayRecorder::get()->update(dt);
|
||||||
Scripting::ScriptEngine *script_engine = Scripting::ScriptEngine::getInstance();
|
Scripting::ScriptEngine *script_engine = Scripting::ScriptEngine::getInstance();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user