Skip to content

Commit 0f3247c

Browse files
committed
jsdoc fixes
1 parent 4b078ce commit 0f3247c

File tree

1 file changed

+96
-32
lines changed

1 file changed

+96
-32
lines changed

babylon/js/client/vrspace.js

Lines changed: 96 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -64,25 +64,45 @@ Basic VRObject, has the same properties as server counterpart.
6464
*/
6565
export class VRObject {
6666
constructor() {
67-
/** @type {number} Id, equal on server and all instances */
67+
/** Id, equal on server and all instances
68+
* @type {number}
69+
*/
6870
this.id = null;
69-
/** @type {Point} Position, Point */
71+
/** Position, Point
72+
* @type {Point}
73+
*/
7074
this.position = null;
71-
/** @type {Rotation|null} Rotation */
75+
/** Rotation
76+
* @type {Rotation|null}
77+
*/
7278
this.rotation = null;
73-
/** @type {Point|null} Scale, Point */
79+
/** Scale, Point
80+
* @type {Point|null}
81+
*/
7482
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+
*/
7686
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+
*/
7890
this.temporary = null;
79-
/** @type {string|null} URL of 3D mesh */
91+
/** URL of 3D mesh
92+
* @type {string|null}
93+
*/
8094
this.mesh = null;
81-
/** @type {boolean} Active i.e. online users */
95+
/** Active i.e. online users
96+
* @type {boolean}
97+
*/
8298
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+
*/
84102
this.animation = null;
85-
/** @type {string|null} URL of dynamically loaded script*/
103+
/** URL of dynamically loaded script
104+
* @type {string|null}
105+
*/
86106
this.script = null;
87107
/** Custom properties of an object - shared transient object*/
88108
this.properties = null;
@@ -95,7 +115,9 @@ export class VRObject {
95115
this._isLoaded = false;
96116
/** Handy reference to VRSpace instance */
97117
this.VRSPACE = null;
98-
/** @type {string} Server-side class name */
118+
/** Server-side class name
119+
* @type {string}
120+
*/
99121
this.className = 'VRObject';
100122
}
101123

@@ -179,13 +201,21 @@ Scene properties, same as server counterpart.
179201
*/
180202
export class SceneProperties{
181203
constructor() {
182-
/** @type {number} Visibility range, default 2000 */
204+
/** Visibility range, default 2000
205+
* @type {number}
206+
*/
183207
this.range = 2000;
184-
/** @type {number} Movement resolution, default 10 */
208+
/** Movement resolution, default 10
209+
* @type {number}
210+
*/
185211
this.resolution = 10;
186-
/** @type {number} Maximum size, default 1000 */
212+
/** Maximum size, default 1000
213+
* @type {number}
214+
*/
187215
this.size = 1000;
188-
/** @type {number} Invalidation timeout in ms, default 30000 */
216+
/** Invalidation timeout in ms, default 30000
217+
* @type {number}
218+
*/
189219
this.timeout = 30000;
190220
}
191221
}
@@ -197,15 +227,23 @@ Representation of a client (user, bot, remote server...).
197227
export class Client extends VRObject {
198228
constructor() {
199229
super();
200-
/** @type {string} Client name, must be unique */
230+
/** Client name, must be unique
231+
* @type {string}
232+
*/
201233
this.name = null;
202-
/** @type {SceneProperties} Scene properties */
234+
/** Scene properties
235+
* @type {SceneProperties}
236+
*/
203237
this.sceneProperties = null; // CHECKME private - should be declared?
204238
/** Private tokens, map of strings */
205239
this.tokens = null;
206-
/** @type {string} Server-side class name */
240+
/** Server-side class name
241+
* @type {string}
242+
*/
207243
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+
*/
209247
this.hasAvatar = true;
210248
}
211249

@@ -225,23 +263,41 @@ Representation of a user.
225263
export class User extends Client {
226264
constructor() {
227265
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+
*/
229269
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+
*/
231273
this.video = false;
232-
/** @type {Point} Left arm position */
274+
/** Left arm position
275+
* @type {Point}
276+
*/
233277
this.leftArmPos = { x: null, y: null, z: null };
234-
/** @type {Point} Right arm position */
278+
/** Right arm position
279+
* @type {Point}
280+
*/
235281
this.rightArmPos = { x: null, y: null, z: null };
236-
/** @type {Rotation} Left arm rotation, quaternion */
282+
/** Left arm rotation, quaternion
283+
* @type {Rotation}
284+
*/
237285
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+
*/
239289
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+
*/
241293
this.userHeight = 1.8;
242-
/** @type {string} Server-side class name */
294+
/** Server-side class name
295+
* @type {string}
296+
*/
243297
this.className = 'User';
244-
/** @type {string|null} avatar picture url*/
298+
/** avatar picture url
299+
* @type {string|null}
300+
*/
245301
this.picture = null;
246302
}
247303
}
@@ -375,11 +431,17 @@ export class SessionData {
375431
* @param {String} json string representation of this object (passed along connection as user data)
376432
*/
377433
constructor(json) {
378-
/** @type {number} Client id, long */
434+
/** Client id, long
435+
* @type {number}
436+
*/
379437
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+
*/
381441
this.name = null;
382-
/** @type {string} Session type - 'main' or 'screen' */
442+
/** Session type - 'main' or 'screen'
443+
* @type {string}
444+
*/
383445
this.type = null;
384446
JSON.parse(json, (key,value)=>{
385447
this[key] = value;
@@ -446,7 +508,9 @@ export class VRSpace {
446508
constructor() {
447509
/** Underlying websocket */
448510
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+
*/
450514
this.me = null;
451515
/** Map containing all objects in the scene */
452516
this.scene = new Map();

0 commit comments

Comments
 (0)