quake2ts 0.0.436 → 0.0.437

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.
@@ -9311,6 +9311,17 @@ var DemoPlaybackController = class {
9311
9311
  getSpeed() {
9312
9312
  return this.playbackSpeed;
9313
9313
  }
9314
+ getPlaybackSpeed() {
9315
+ return this.playbackSpeed;
9316
+ }
9317
+ /**
9318
+ * Returns the interpolation factor (0.0 to 1.0) for the current frame.
9319
+ * Used for smooth rendering between demo frames.
9320
+ */
9321
+ getInterpolationFactor() {
9322
+ if (this.frameDuration <= 0) return 0;
9323
+ return Math.max(0, Math.min(1, this.accumulatedTime / this.frameDuration));
9324
+ }
9314
9325
  update(dt) {
9315
9326
  if (this.state !== 1 || !this.reader) {
9316
9327
  return;
@@ -15263,7 +15274,8 @@ function createClient(imports) {
15263
15274
  lastRenderTime = now;
15264
15275
  demoPlayback.update(dt);
15265
15276
  lastRendered = demoHandler.getPredictionState(demoPlayback.getCurrentTime());
15266
- renderEntities = demoHandler.getRenderableEntities(1, configStrings);
15277
+ const alpha = demoPlayback.getInterpolationFactor();
15278
+ renderEntities = demoHandler.getRenderableEntities(alpha, configStrings);
15267
15279
  if (demoHandler.latestFrame && demoHandler.latestFrame.packetEntities) {
15268
15280
  currentPacketEntities = demoHandler.latestFrame.packetEntities.entities;
15269
15281
  }