Utils functions for Mozilla Hubs scripting
✓ Published0🌍 Public
UUtopiah
Last edited Feb 14, 2022
Created on May 20, 2020
This example demonstrates a collection of utility functions for scripting Mozilla Hubs scenes, showing how to manipulate entities, load media assets, and query the scene graph. The code uses the A-Frame and Networked-AFRAME APIs to interact with the Three.js object hierarchy. It includes functions to get user media elements via DOM selectors, load assets from URLs by creating `a-entity` elements with `media-loader` and `networked` components, and find avatars by display name. It also traverses the Three.js scene graph to match objects by partial names, and queries media elements by URL patterns using `querySelectorAll` and regex matching.
AI-generated description