Skip to content

Commit 6e80d57

Browse files
committed
Temporarily disable model visibility in first person mode if available
1 parent 6c7e5db commit 6e80d57

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/gui/ar/videoPlayback.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ class VideoPlayer extends Followable {
129129
this.phoneParent.rotateX(Math.PI / 2);
130130
// this.phoneParent.position.y = this.floorOffset;
131131
this.firstPersonMode = false;
132+
this.didOverrideModelVisibility = false;
132133

133134
// add a visual element to show the position of the camera that recorded the video
134135
// note: we use the same visual style as the remote operator CameraVis
@@ -396,6 +397,14 @@ class VideoPlayer extends Followable {
396397
if (this.shaderMode === ShaderMode.SOLID) {
397398
this.setShaderMode(ShaderMode.FIRST_PERSON);
398399
}
400+
401+
if (realityEditor.gui.ar.desktopRenderer?.setModelVisibility) {
402+
const visibility = realityEditor.gui.ar.desktopRenderer.getModelVisibility();
403+
if (visibility) {
404+
this.didOverrideModelVisibility = true;
405+
realityEditor.gui.ar.desktopRenderer.setModelVisibility(false);
406+
}
407+
}
399408
}
400409

401410
// switch back the shader mode when not fully zoomed in
@@ -404,6 +413,12 @@ class VideoPlayer extends Followable {
404413
if (this.shaderMode === ShaderMode.FIRST_PERSON) {
405414
this.setShaderMode(ShaderMode.SOLID);
406415
}
416+
if (realityEditor.gui.ar.desktopRenderer?.setModelVisibility) {
417+
if (this.didOverrideModelVisibility) {
418+
realityEditor.gui.ar.desktopRenderer.setModelVisibility(true);
419+
this.didOverrideModelVisibility = false;
420+
}
421+
}
407422
}
408423

409424
// hide the camera mesh if we get close to it

0 commit comments

Comments
 (0)