teleportxr 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/client.js +35 -2
- package/package.json +1 -1
package/client/client.js
CHANGED
|
@@ -125,6 +125,10 @@ class Client {
|
|
|
125
125
|
{
|
|
126
126
|
this.setupCommand=new command.SetupCommand();
|
|
127
127
|
this.clientDynamicLighting=new core.ClientDynamicLighting();
|
|
128
|
+
// Session is (re)starting; the client has zero state, so retract any
|
|
129
|
+
// outstanding ack tracking from a previous session and force a resend.
|
|
130
|
+
this.currentOriginState = new OriginState();
|
|
131
|
+
this.currentLightingState = new LightingState();
|
|
128
132
|
this.setupCommand.float32_draw_distance=10.0;
|
|
129
133
|
if(this.scene)
|
|
130
134
|
{
|
|
@@ -348,7 +352,25 @@ class Client {
|
|
|
348
352
|
var setl =new command.SetLightingCommand();
|
|
349
353
|
setl.uint64_ackId =this.next_ack_id++;
|
|
350
354
|
setl.ClientDynamicLighting_clientDynamicLighting = this.clientDynamicLighting;
|
|
351
|
-
|
|
355
|
+
|
|
356
|
+
// Log in declaration order matching ClientDynamicLighting / SetLightingCommand structs.
|
|
357
|
+
const cdl = setl.ClientDynamicLighting_clientDynamicLighting;
|
|
358
|
+
console.log("\n===== NODE SERVER SENDING SETLIGHTINGCOMMAND =====");
|
|
359
|
+
console.log(JSON.stringify({
|
|
360
|
+
ack_id: setl.uint64_ackId.toString(),
|
|
361
|
+
specularPos: cdl.int2_specularPos,
|
|
362
|
+
specularCubemapSize: cdl.int32_specularCubemapSize,
|
|
363
|
+
specularMips: cdl.int32_specularMips,
|
|
364
|
+
diffusePos: cdl.int2_diffusePos,
|
|
365
|
+
diffuseCubemapSize: cdl.int32_diffuseCubemapSize,
|
|
366
|
+
lightPos: cdl.int2_lightPos,
|
|
367
|
+
lightCubemapSize: cdl.int32_lightCubemapSize,
|
|
368
|
+
specular_cubemap_texture_uid: cdl.uid_specular_cubemap_texture_uid.toString(),
|
|
369
|
+
diffuse_cubemap_texture_uid: cdl.uid_diffuse_cubemap_texture_uid.toString(),
|
|
370
|
+
lightingMode: cdl.LightingMode_lightingMode,
|
|
371
|
+
}, null, 2));
|
|
372
|
+
console.log("===== END SETLIGHTINGCOMMAND =====\n");
|
|
373
|
+
|
|
352
374
|
// This is now the valid origin.
|
|
353
375
|
this.currentLightingState.ackId=setl.uint64_ackId;
|
|
354
376
|
this.currentLightingState.acknowledged=false;
|
|
@@ -389,8 +411,19 @@ class Client {
|
|
|
389
411
|
const buffer = new ArrayBuffer(MAX_BUFFER_SIZE);
|
|
390
412
|
const resourceSize=resource_encoder.EncodeResource(resource,buffer);
|
|
391
413
|
this.geometryService.EncodedResource(uid);
|
|
392
|
-
const view2 = new DataView(buffer, 0, resourceSize);
|
|
414
|
+
const view2 = new DataView(buffer, 0, resourceSize);
|
|
393
415
|
console.log("Sending resource "+uid+" "+resource.url+" to Client "+this.clientID+", size: "+resourceSize+" bytes");
|
|
416
|
+
if(!this.webRtcConnection)
|
|
417
|
+
{
|
|
418
|
+
console.error("this.webRtcConnection is null");
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
if(!this.webRtcConnection.sendGeometry)
|
|
422
|
+
{
|
|
423
|
+
console.error("this.webRtcConnection.sendGeometry is null");
|
|
424
|
+
console.log(JSON.stringify(this.webRtcConnection));
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
394
427
|
this.webRtcConnection.sendGeometry(view2);
|
|
395
428
|
}
|
|
396
429
|
SendMesh(uid)
|
package/package.json
CHANGED