quake2ts 0.0.435 → 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.
@@ -9276,6 +9276,17 @@ var DemoPlaybackController = class {
9276
9276
  getSpeed() {
9277
9277
  return this.playbackSpeed;
9278
9278
  }
9279
+ getPlaybackSpeed() {
9280
+ return this.playbackSpeed;
9281
+ }
9282
+ /**
9283
+ * Returns the interpolation factor (0.0 to 1.0) for the current frame.
9284
+ * Used for smooth rendering between demo frames.
9285
+ */
9286
+ getInterpolationFactor() {
9287
+ if (this.frameDuration <= 0) return 0;
9288
+ return Math.max(0, Math.min(1, this.accumulatedTime / this.frameDuration));
9289
+ }
9279
9290
  update(dt) {
9280
9291
  if (this.state !== 1 || !this.reader) {
9281
9292
  return;
@@ -15231,7 +15242,8 @@ function createClient(imports) {
15231
15242
  lastRenderTime = now;
15232
15243
  demoPlayback.update(dt);
15233
15244
  lastRendered = demoHandler.getPredictionState(demoPlayback.getCurrentTime());
15234
- renderEntities = demoHandler.getRenderableEntities(1, configStrings);
15245
+ const alpha = demoPlayback.getInterpolationFactor();
15246
+ renderEntities = demoHandler.getRenderableEntities(alpha, configStrings);
15235
15247
  if (demoHandler.latestFrame && demoHandler.latestFrame.packetEntities) {
15236
15248
  currentPacketEntities = demoHandler.latestFrame.packetEntities.entities;
15237
15249
  }