Hubs-Foundation / hubs

Duck-themed multi-user virtual spaces in WebVR. Built with A-Frame.
https://hubsfoundation.org
Mozilla Public License 2.0
2.13k stars 1.42k forks source link

AFrame: Placing a loading cube in a media frame with Scale To Bounds on causes Hubs to crash. #6400

Open Exairnous opened 10 months ago

Exairnous commented 10 months ago

Description If you place a loading cube in a media frame with the Scale To Bounds property on, then Hubs will crash with an error in the console. Hubs only crashes when you let go of the object, but even before you let go the preview isn't placed correctly.

Error message:

Uncaught TypeError: AudioParam.linearRampToValueAtTime: Argument 1 is not a finite floating-point value.
    updateMatrixWorld three.module.js:44115
    updateMatrixWorld three.module.js:8218
    tick shadow-system.js:23
    setupRenderer hubs-systems.ts:250
    setupRenderer app.ts:236
    fl three.module.js:27389
    r three.module.js:12900
[three.module.js:44115:23](webpack://hubs/node_modules/three/build/three.module.js)
    updateMatrixWorld three.module.js:44115
    updateMatrixWorld three.module.js:8218
    tick shadow-system.js:23
    setupRenderer hubs-systems.ts:250
    setupRenderer app.ts:236
    fl three.module.js:27389
    r three.module.js:12900

To Reproduce Steps to reproduce the behavior:

  1. Go to a room with this scene: https://hubs.mozilla.com/scenes/qgaMVT9/mediaframealignment
  2. Spawn in an object that takes a long time to load (something from SKetchFab usually works for me).
  3. Move it into one of the media frames that scales the object and see that its preview is not in the correct location.
  4. Let go of the object and see Hubs crash.
  5. Or move it out of the media frame without letting go to avoid the crash.

Expected behavior The preview should be in the correct location and Hubs should not crash when you let go of the object.

Hardware

Additional context The new loader doesn't have this problem because media frames still don't trigger in it for loading cubes as described in this issue: https://github.com/mozilla/hubs/issues/6345