new Client()
Constructs a new
Client
.
Basic client class, adds user-related properties and business logic to VRObject.
- Source:
Classes
Members
_isLoaded
Internal, set by WorldManager after the mesh/script has loaded.
- Overrides:
- Source:
active :boolean
Active i.e. online users
Type:
- boolean
- Overrides:
- Source:
animation :string|null
Name of the animation that is currently active
Type:
- string | null
- Overrides:
- Source:
className :string
Server-side class name
Type:
- string
- Overrides:
- Source:
hasAvatar :boolean
true if the client has an avatar
Type:
- boolean
- Source:
id :number
Id, equal on server and all instances
Type:
- number
- Overrides:
- Source:
listeners
Event listeners. Typically world manager listens to changes, and moves objects around.
- Overrides:
- Source:
loadListeners
Load listeners, functions that trigger after the mesh or script is loaded. Managed by WorldManager. CHECKME SoC
- Overrides:
- Source:
mesh :string|null
URL of 3D mesh
Type:
- string | null
- Overrides:
- Source:
name :string
Client name, must be unique
Type:
- string
- Source:
permanent :boolean
Default false, permanent objects remain in the scene forever
Type:
- boolean
- Overrides:
- Source:
position :Point
Position, Point
Type:
- Overrides:
- Source:
properties
Custom properties of an object - shared transient object
- Overrides:
- Source:
rotation :Rotation|null
Rotation
Type:
- Rotation | null
- Overrides:
- Source:
scale :Point|null
Scale, Point
Type:
- Point | null
- Overrides:
- Source:
sceneProperties :SceneProperties
Scene properties
Type:
- Source:
script :string|null
URL of dynamically loaded script
Type:
- string | null
- Overrides:
- Source:
temporary :boolean
Everything created by guest client is by default temporary
Type:
- boolean
- Overrides:
- Source:
tokens
Private tokens, map of strings
- Source:
VRSPACE
Handy reference to VRSpace instance
- Overrides:
- Source:
Methods
addListener()
Add a change listener to the object.
- Overrides:
- Source:
addLoadListener()
Add a load listener function to the object. Triggers immediatelly if mesh/script has already loaded (_isLoaded is true).
- Overrides:
- Source:
getNameOrId()
Handy function, returns name if not null, else class and id
- Source:
notifyListeners()
Called when server sends notification that the object has changed.
Notifies all listeners of object and changes.
- Overrides:
- Source:
notifyLoadListeners()
Triggers all load listeners
- Overrides:
- Source:
publish()
Publish the object to the server. Can be used only on new objects.
- Overrides:
- Source:
removeListener()
Remove the listener.
- Overrides:
- Source:
removeLoadListener()
Remove a load listener.
- Overrides:
- Source: