new SceneSync(syncInstance, configopt)
The SceneSync behavior manages the synchronization of an entire scene.
Parameters:
| Name | Type | Attributes | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
syncInstance |
Firebase | ||||||||||||||||||
config |
Object |
<optional> |
Properties
|
Members
(readonly) autoSendRateMS :number
Interval at which an object's position/rotation/scale data is sent to Firebase, in milliseconds.
(readonly) clientId :string
UUID of the current client.
(readonly) clientsRef :Firebase
Firebase reference for the 'clients' child location. Can be used by app to listen to clients entering and leaving the room (but generally should not be modified by apps).
(readonly) isMasterClient :boolean
True if this client is the master, false otherwise. Master is generally the client that has been in the room the longest.
Methods
destroy(object3d)
Destroy a synced object across instances.
Parameters:
| Name | Type | Description |
|---|---|---|
object3d |
Object | The object to destroy. |
instantiate(syncType, initData, destroyOnDisconnect)
Instantiate an object by syncType.
Parameters:
| Name | Type | Description |
|---|---|---|
syncType |
String | Type of object to instantiate. |
initData |
Object | An object containing initialization data, passed to the instantiator. |
destroyOnDisconnect |
Boolean | If the object should be destroyed across all synced instance when the instantiating instance disconnects. |