extra-game-loop 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16710,7 +16710,7 @@ class GameLoop {
16710
16710
  * 1. 响应游戏世界从上一帧更新后到这一帧更新之前发生的物理变化.
16711
16711
  * 注意, 如果渲染帧率比物理帧率快, 且运行性能良好, 则物理帧不一定会在此帧更新.
16712
16712
  * 2. 响应用户输入, 为这一帧的游戏世界做出非物理方面的更新, 例如角色转向, 改变武器瞄准角度等.
16713
- * 3. 渲染经过更新后的最新状态.
16713
+ * 3. 渲染经过更新后的最新状态, 渲染器可以根据alpha参数执行插值渲染.
16714
16714
  */
16715
16715
  nextFrame(deltaTime) {
16716
16716
  this.deltaTimeAccumulator = Math.min(this.deltaTimeAccumulator + deltaTime, this.maximumDeltaTime);
@@ -16719,7 +16719,8 @@ class GameLoop {
16719
16719
  this.deltaTimeAccumulator -= this.fixedDeltaTime;
16720
16720
  }
16721
16721
  this.update(deltaTime);
16722
- this.render();
16722
+ const alpha = this.deltaTimeAccumulator / this.fixedDeltaTime;
16723
+ this.render(alpha);
16723
16724
  }
16724
16725
  }
16725
16726