@viji-dev/core 0.3.6 → 0.3.7

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.
@@ -446,16 +446,16 @@ class InteractionSystem {
446
446
  this.mouseState.rightButton = (data.buttons & 2) !== 0;
447
447
  this.mouseState.middleButton = (data.buttons & 4) !== 0;
448
448
  this.mouseState.isPressed = data.buttons > 0;
449
- this.mouseState.deltaX = data.deltaX || 0;
450
- this.mouseState.deltaY = data.deltaY || 0;
451
- this.mouseState.wheelDelta = data.wheelDeltaY || 0;
452
- this.mouseState.wheelX = data.wheelDeltaX || 0;
453
- this.mouseState.wheelY = data.wheelDeltaY || 0;
449
+ this.mouseState.deltaX += data.deltaX || 0;
450
+ this.mouseState.deltaY += data.deltaY || 0;
451
+ this.mouseState.wheelDelta += data.wheelDeltaY || 0;
452
+ this.mouseState.wheelX += data.wheelDeltaX || 0;
453
+ this.mouseState.wheelY += data.wheelDeltaY || 0;
454
454
  this.mouseState.velocity.x = data.deltaX || 0;
455
455
  this.mouseState.velocity.y = data.deltaY || 0;
456
- this.mouseState.wasPressed = data.wasPressed || false;
457
- this.mouseState.wasReleased = data.wasReleased || false;
458
- this.mouseState.wasMoved = data.deltaX !== 0 || data.deltaY !== 0;
456
+ this.mouseState.wasPressed = this.mouseState.wasPressed || (data.wasPressed || false);
457
+ this.mouseState.wasReleased = this.mouseState.wasReleased || (data.wasReleased || false);
458
+ this.mouseState.wasMoved = this.mouseState.wasMoved || (data.deltaX !== 0 || data.deltaY !== 0);
459
459
  }
460
460
  /**
461
461
  * Handle keyboard update messages from the host
@@ -4180,7 +4180,6 @@ class VijiWorkerRuntime {
4180
4180
  renderFrame() {
4181
4181
  if (!this.isRunning) return;
4182
4182
  const currentTime = performance.now();
4183
- this.interactionSystem.frameStart();
4184
4183
  this.updateVijiStreams();
4185
4184
  this.viji.fps = this.frameRateMode === "full" ? this.screenRefreshRate : this.screenRefreshRate / 2;
4186
4185
  let shouldRender = true;
@@ -4249,6 +4248,7 @@ class VijiWorkerRuntime {
4249
4248
  }
4250
4249
  }
4251
4250
  this.reportPerformanceStats(currentTime);
4251
+ this.interactionSystem.frameStart();
4252
4252
  requestAnimationFrame(() => this.renderFrame());
4253
4253
  }
4254
4254
  postMessage(type, data) {
@@ -4359,4 +4359,4 @@ async function setSceneCode(sceneCode) {
4359
4359
  }
4360
4360
  }
4361
4361
  self.setSceneCode = setSceneCode;
4362
- //# sourceMappingURL=viji.worker-C3iqy9t2.js.map
4362
+ //# sourceMappingURL=viji.worker-CariIqqP.js.map