From 6395b9e637db7c6494b73619cf38572537c94d66 Mon Sep 17 00:00:00 2001 From: mischa Date: Mon, 24 Jul 2023 20:04:58 +0800 Subject: [PATCH] syntax --- .../Core/LagCompensation/HistoryBounds.cs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Assets/Mirror/Core/LagCompensation/HistoryBounds.cs b/Assets/Mirror/Core/LagCompensation/HistoryBounds.cs index 1338331c6..2e45145c8 100644 --- a/Assets/Mirror/Core/LagCompensation/HistoryBounds.cs +++ b/Assets/Mirror/Core/LagCompensation/HistoryBounds.cs @@ -12,8 +12,13 @@ public static class HistoryBounds { // insert current bounds into history. returns new total bounds. // Queue.Dequeue() always has the oldest bounds. - public static Bounds Insert(Queue history, int limit, Bounds bounds) + public static Bounds Insert( + Queue history, + int limit, + Bounds bounds) { + // optimization: only insert if + // remove oldest if limit reached if (history.Count >= limit) history.Dequeue(); @@ -31,15 +36,5 @@ public static Bounds Insert(Queue history, int limit, Bounds bounds) return total; } - - - // TODO .bounds that wraps past N bounds - // TODO fast data structure to always .encapsulate latest and .remove oldest - - // TODO update: - // - capture bounds every few seconds - // - build new totalBounds only when capturing, not every .totalBounds call - - // TODO runtime debug gizmo } }