瀏覽代碼

Physics Interpolation - fix client interpolation pump

Client interpolation pump is moved AFTER the physics tick, after physics objects have been moved.
This is necessary because the `current` transform is also updated during the pump.
lawnjelly 7 月之前
父節點
當前提交
7e9be93338
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      scene/main/scene_tree.cpp

+ 5 - 5
scene/main/scene_tree.cpp

@@ -559,11 +559,6 @@ void SceneTree::iteration_prepare() {
 		// are flushed before pumping the interpolation prev and currents.
 		flush_transform_notifications();
 		VisualServer::get_singleton()->tick();
-
-		// Any objects performing client physics interpolation
-		// should be given an opportunity to keep their previous transforms
-		// up to date before each new physics tick.
-		_client_physics_interpolation.physics_process();
 	}
 }
 
@@ -572,6 +567,11 @@ void SceneTree::iteration_end() {
 	// to be flushed to the VisualServer before finishing a physics tick.
 	if (_physics_interpolation_enabled) {
 		flush_transform_notifications();
+
+		// Any objects performing client physics interpolation
+		// should be given an opportunity to keep their previous transforms
+		// up to date.
+		_client_physics_interpolation.physics_process();
 	}
 }