Source: world/world-listener.js

  1. /**
  2. Convenience class to make listening to world changes easier.
  3. Add WorldListeners to a World, and WorldManager will notify them when world changes.
  4. */
  5. export class WorldListener {
  6. constructor(){}
  7. /**
  8. Called when user enters the world.
  9. @param welcome Welcome message
  10. */
  11. entered(welcome) {}
  12. /**
  13. Called when a new object is added to the scene
  14. @param vrobject a VRObject, typically a Client, added to the scene.
  15. */
  16. added(vrobject){}
  17. /**
  18. Called when a new object is loaded.
  19. What that exactly means, depends on type of object - e.g. avatars are loaded differently than video streams.
  20. Actual mesh/avatar/etc is in vrobject, e.g. vrobject.container in case of general model.
  21. @param vrobject a VRObject, typically a Client, added to the scene.
  22. */
  23. loaded(vrobject){}
  24. /**
  25. Called when an object is removed from the scene
  26. @param vrobject a VRObject, typically a Client, removed from the scene
  27. */
  28. removed(vrobject){}
  29. }