new WorldManager(world, fps)
Creates world manager with default values and connection, scene, camera listeners.
||network framerate, default 5 (send up to 5 events per second)|
Avatar factory, default this.createAvatar
Change listeners receive changes applied to all shared objects
Create animations for movement of avatars, default true. Recommended for low fps.
Custom avatar animations
Custom avatar options, applied to avatars after loading. Currently video avatars only
Enable debug output
Default position applied after an avatar loads
Default rotation applied after an avatar loads
Network frames per second, default 5
Current left arm position
Current left arm rotation
Optionally called after an avatar has loaded. Callback is passed VRObject and avatar object as parameters. Avatar object can be either Avatar or VideoAvatar instance, or an AssetContainer.
Called when loading fails, default null.
This is set once we connect to streaming server
Used in 3rd person view
Listeners notified after own avatar property (e.g. position) has changed and published
Movement resolution, default 1 cm/3.6 deg. Any movement less than this will be ignored.
Current right arm position
Current right arm rotation
Whether to track user rotation, default true.
User height in real world, default 1.8
Add a listener to remote events
Add a listener to own events
Utility method, calculates bounding box for an AssetContainer and returns maximum of x,y,z. Works only for meshes already rendered
Utility method, calculates bounding box for an AssetContainer.
Vector3 bounding box
Apply remote changes to an avatar (VRObject listener)
Apply remote changes to an object.
Check if a value has changed, and update change array if so.
Default video avatar factory method
Enter the world specified by world.name. If not already connected, first connect to world.serverUrl and set own properties, then start the session. World and WorldListeners are notified by calling entered methods.
||own properties to set before starting the session|
Return true if a value is ouside of given range.
Returns true if connected to the server and session is active
Load a 3D avatar, attach a listener to it
Load an object and attach a listener.
Load a video avatar, attach a listener to it.
Optionally log something
Notify listeners of remote changes
Publish and subscribe
Remove listener to remote events
Remove a mesh from the scene (scene listener), and dispose of everything.
Remove listener to own events
Called when applying changes other than rotation and translation: executes a method if such a method exists, passing it a current instance of associated VRObject.
||VRObject to apply change to|
||member field to set or method to execute|
Called when scene has changed (scene listener). If an object was added, calls either loadAvatar, loadStream or loadMesh, as appropriate. If an object was removed, calls removeMesh. Any WorldListeners on the world are notified after changes are performed, by calling added and removed methods.
||SceneEvent containing the change|
Send own event.
||object containing changes to be sent, i.e. name-value pair(s).|
Called when connection to the server is established (connection listener)
Tracks active camera
Periodically executed, as specified by fps. Tracks changes to camera and XR controllers. Calls checkChange, and if anything has changed, changes are sent to server, and to myChangeListeners.
Track a mesh, used in 3rd person view
Local user wrote something - send it over and notify local listener(s)