@@ -64,25 +64,45 @@ Basic VRObject, has the same properties as server counterpart.
64
64
*/
65
65
export class VRObject {
66
66
constructor ( ) {
67
- /** @type {number } Id, equal on server and all instances */
67
+ /** Id, equal on server and all instances
68
+ * @type {number }
69
+ */
68
70
this . id = null ;
69
- /** @type {Point } Position, Point */
71
+ /** Position, Point
72
+ * @type {Point }
73
+ */
70
74
this . position = null ;
71
- /** @type {Rotation|null } Rotation */
75
+ /** Rotation
76
+ * @type {Rotation|null }
77
+ */
72
78
this . rotation = null ;
73
- /** @type {Point|null } Scale, Point */
79
+ /** Scale, Point
80
+ * @type {Point|null }
81
+ */
74
82
this . scale = null ;
75
- /** @type {boolean } Default false, permanent objects remain in the scene forever */
83
+ /** Default false, permanent objects remain in the scene forever
84
+ * @type {boolean }
85
+ */
76
86
this . permanent = false ;
77
- /** @type {boolean } Everything created by guest client is by default temporary */
87
+ /** Everything created by guest client is by default temporary
88
+ * @type {boolean }
89
+ */
78
90
this . temporary = null ;
79
- /** @type {string|null } URL of 3D mesh */
91
+ /** URL of 3D mesh
92
+ * @type {string|null }
93
+ */
80
94
this . mesh = null ;
81
- /** @type {boolean } Active i.e. online users */
95
+ /** Active i.e. online users
96
+ * @type {boolean }
97
+ */
82
98
this . active = false ;
83
- /** @type {string|null } Name of the animation that is currently active */
99
+ /** Name of the animation that is currently active
100
+ * @type {string|null }
101
+ */
84
102
this . animation = null ;
85
- /** @type {string|null } URL of dynamically loaded script*/
103
+ /** URL of dynamically loaded script
104
+ * @type {string|null }
105
+ */
86
106
this . script = null ;
87
107
/** Custom properties of an object - shared transient object*/
88
108
this . properties = null ;
@@ -95,7 +115,9 @@ export class VRObject {
95
115
this . _isLoaded = false ;
96
116
/** Handy reference to VRSpace instance */
97
117
this . VRSPACE = null ;
98
- /** @type {string } Server-side class name */
118
+ /** Server-side class name
119
+ * @type {string }
120
+ */
99
121
this . className = 'VRObject' ;
100
122
}
101
123
@@ -179,13 +201,21 @@ Scene properties, same as server counterpart.
179
201
*/
180
202
export class SceneProperties {
181
203
constructor ( ) {
182
- /** @type {number } Visibility range, default 2000 */
204
+ /** Visibility range, default 2000
205
+ * @type {number }
206
+ */
183
207
this . range = 2000 ;
184
- /** @type {number } Movement resolution, default 10 */
208
+ /** Movement resolution, default 10
209
+ * @type {number }
210
+ */
185
211
this . resolution = 10 ;
186
- /** @type {number } Maximum size, default 1000 */
212
+ /** Maximum size, default 1000
213
+ * @type {number }
214
+ */
187
215
this . size = 1000 ;
188
- /** @type {number } Invalidation timeout in ms, default 30000 */
216
+ /** Invalidation timeout in ms, default 30000
217
+ * @type {number }
218
+ */
189
219
this . timeout = 30000 ;
190
220
}
191
221
}
@@ -197,15 +227,23 @@ Representation of a client (user, bot, remote server...).
197
227
export class Client extends VRObject {
198
228
constructor ( ) {
199
229
super ( ) ;
200
- /** @type {string } Client name, must be unique */
230
+ /** Client name, must be unique
231
+ * @type {string }
232
+ */
201
233
this . name = null ;
202
- /** @type {SceneProperties } Scene properties */
234
+ /** Scene properties
235
+ * @type {SceneProperties }
236
+ */
203
237
this . sceneProperties = null ; // CHECKME private - should be declared?
204
238
/** Private tokens, map of strings */
205
239
this . tokens = null ;
206
- /** @type {string } Server-side class name */
240
+ /** Server-side class name
241
+ * @type {string }
242
+ */
207
243
this . className = 'Client' ;
208
- /** @type {boolean } true if the client has an avatar */
244
+ /** true if the client has an avatar
245
+ * @type {boolean }
246
+ */
209
247
this . hasAvatar = true ;
210
248
}
211
249
@@ -225,23 +263,41 @@ Representation of a user.
225
263
export class User extends Client {
226
264
constructor ( ) {
227
265
super ( ) ;
228
- /** @type {boolean } Does this client have humanoid avatar, default true */
266
+ /** Does this client have humanoid avatar, default true
267
+ * @type {boolean }
268
+ */
229
269
this . humanoid = true ;
230
- /** @type {boolean } Does this client have video avatar, default false */
270
+ /** Does this client have video avatar, default false
271
+ * @type {boolean }
272
+ */
231
273
this . video = false ;
232
- /** @type {Point } Left arm position */
274
+ /** Left arm position
275
+ * @type {Point }
276
+ */
233
277
this . leftArmPos = { x : null , y : null , z : null } ;
234
- /** @type {Point } Right arm position */
278
+ /** Right arm position
279
+ * @type {Point }
280
+ */
235
281
this . rightArmPos = { x : null , y : null , z : null } ;
236
- /** @type {Rotation } Left arm rotation, quaternion */
282
+ /** Left arm rotation, quaternion
283
+ * @type {Rotation }
284
+ */
237
285
this . leftArmRot = { x : null , y : null , z : null , w : null } ;
238
- /** @type {Rotation } Right arm rotation, quaternion */
286
+ /** Right arm rotation, quaternion
287
+ * @type {Rotation }
288
+ */
239
289
this . rightArmRot = { x : null , y : null , z : null , w : null } ;
240
- /** @type {number } User height, default 1.8 */
290
+ /** User height, default 1.8
291
+ * @type {number }
292
+ */
241
293
this . userHeight = 1.8 ;
242
- /** @type {string } Server-side class name */
294
+ /** Server-side class name
295
+ * @type {string }
296
+ */
243
297
this . className = 'User' ;
244
- /** @type {string|null } avatar picture url*/
298
+ /** avatar picture url
299
+ * @type {string|null }
300
+ */
245
301
this . picture = null ;
246
302
}
247
303
}
@@ -375,11 +431,17 @@ export class SessionData {
375
431
* @param {String } json string representation of this object (passed along connection as user data)
376
432
*/
377
433
constructor ( json ) {
378
- /** @type {number } Client id, long */
434
+ /** Client id, long
435
+ * @type {number }
436
+ */
379
437
this . clientId = null ;
380
- /** @type {string } Session name, matches either world name for public world, or world token for private world */
438
+ /** Session name, matches either world name for public world, or world token for private world
439
+ * @type {string }
440
+ */
381
441
this . name = null ;
382
- /** @type {string } Session type - 'main' or 'screen' */
442
+ /** Session type - 'main' or 'screen'
443
+ * @type {string }
444
+ */
383
445
this . type = null ;
384
446
JSON . parse ( json , ( key , value ) => {
385
447
this [ key ] = value ;
@@ -446,7 +508,9 @@ export class VRSpace {
446
508
constructor ( ) {
447
509
/** Underlying websocket */
448
510
this . ws = null ;
449
- /** @type {User } Representation of own Client, available once connection is established */
511
+ /** Representation of own Client, available once the connection is established
512
+ * @type {User }
513
+ */
450
514
this . me = null ;
451
515
/** Map containing all objects in the scene */
452
516
this . scene = new Map ( ) ;
0 commit comments