@epigraph/solutions 0.27.0-canary → 0.27.0-canary.1
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.
|
@@ -4363,7 +4363,7 @@ vec3 texelOld = texture2D(previousShadowMap, vUv).rgb;
|
|
|
4363
4363
|
.hotspot-indicator.occluded {
|
|
4364
4364
|
opacity: 0.3;
|
|
4365
4365
|
}
|
|
4366
|
-
`}get hidden(){const e=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(this.assetId);if(!e)return!1;const t=e.activeFinish;return!this.finishes.includes(t)}get config(){return this.__config}get assetId(){return this.__config.assetId}get name(){return this.__config.name}get hotspotId(){return this.__config.hotspotId}get position(){return this.entity.getWorldPosition(this.__worldPosition),this.__worldPosition}get normals(){return this.__normals}get camera(){return this.__camera}get header(){return this.__config.header}get carousel(){return this.__config.carousel}get finishes(){return this.__config.finishes}get animation(){return this.__config.animation}get desktopPlacement(){return this.__config.desktopPlacement}__updateHotspotPosition(){this.__localPosition.set(this.__config.position.x,this.__config.position.y,this.__config.position.z),this.entity.position.set(this.__localPosition.x,this.__localPosition.y,this.__localPosition.z)}__updateHotspotNormals(){if(this.__config.normals){const{x:t,y:i,z:a}=this.__config.normals;this.__normals.set(t,i,a);return}const e=new se;this.appWcRef.sceneManager.currentSceneBounds.getCenter(e),this.__normals.subVectors(this.position,e)}__updateCamera(){this.__camera.position.set(this.__config.camera.position.x,this.__config.camera.position.y,this.__config.camera.position.z),this.__camera.target.set(this.__config.camera.target.x,this.__config.camera.target.y,this.__config.camera.target.z),this.__camera.focalLength=this.__config.camera.focalLength}updateHotspotConfig(e){this.__config=e,this.details=this.__config.details,this.__updateHotspotPosition(),this.__updateHotspotNormals(),this.__updateCamera()}_onHotspotClick(){this.hotspotsManager.activeHotspot||(this.visited=!0,this.appWcRef.eventsManager.hotspotClickedEvent.fire({hotspot:this}))}__isFacingCamera(){return this.appWcRef.cameraManager.getCameras().main.getWorldDirection(this.__cameraDirection),this.__normals.angleTo(this.__cameraDirection)>Math.PI/2.2}renderAnnotationTemplate(e){const t=e!==void 0&&e===this.hotspotId;if(this.hotspotsManager.activeHotspot&&!t||this.hidden)return $e;this.screenPosition=this.appWcRef.getScreenPositionFromWorld(this.position);const i=e!==void 0&&e!==this.hotspotId;let a="top-left";return this.screenPosition.y>this.appWcRef.canvasSize.height*.12?a="top":a="bottom",this.screenPosition.x>this.appWcRef.canvasSize.width*.5?a+="-right":a+="-left",Ee`
|
|
4366
|
+
`}get hidden(){const e=this.appWcRef.sceneManager.sceneStructure.getEntityForAssetId(this.assetId);if(!e)return!1;const t=e.activeFinish;return!this.finishes.includes(t)}get config(){return this.__config}get assetId(){return this.__config.assetId}get name(){return this.__config.name}get hotspotId(){return this.__config.hotspotId}get position(){return this.entity.getWorldPosition(this.__worldPosition),this.__worldPosition}get normals(){return this.__normals}get camera(){return this.__camera}get header(){return this.__config.header}get carousel(){return this.__config.carousel}get finishes(){return this.__config.finishes}get animation(){return this.__config.animation}get desktopPlacement(){return this.__config.desktopPlacement}__updateHotspotPosition(){this.__localPosition.set(this.__config.position.x,this.__config.position.y,this.__config.position.z),this.entity.position.set(this.__localPosition.x,this.__localPosition.y,this.__localPosition.z)}__updateHotspotNormals(){if(this.__config.normals!==null){const{x:t,y:i,z:a}=this.__config.normals;this.__normals.set(t,i,a);return}const e=new se;this.appWcRef.sceneManager.currentSceneBounds.getCenter(e),this.__normals.subVectors(this.position,e)}__updateCamera(){this.__camera.position.set(this.__config.camera.position.x,this.__config.camera.position.y,this.__config.camera.position.z),this.__camera.target.set(this.__config.camera.target.x,this.__config.camera.target.y,this.__config.camera.target.z),this.__camera.focalLength=this.__config.camera.focalLength}updateHotspotConfig(e){this.__config=e,this.details=this.__config.details,this.__updateHotspotPosition(),this.__updateHotspotNormals(),this.__updateCamera()}_onHotspotClick(){this.hotspotsManager.activeHotspot||(this.visited=!0,this.appWcRef.eventsManager.hotspotClickedEvent.fire({hotspot:this}))}__isFacingCamera(){return this.appWcRef.cameraManager.getCameras().main.getWorldDirection(this.__cameraDirection),this.__normals.angleTo(this.__cameraDirection)>Math.PI/2.2}renderAnnotationTemplate(e){const t=e!==void 0&&e===this.hotspotId;if(this.hotspotsManager.activeHotspot&&!t||this.hidden)return $e;this.screenPosition=this.appWcRef.getScreenPositionFromWorld(this.position);const i=e!==void 0&&e!==this.hotspotId;let a="top-left";return this.screenPosition.y>this.appWcRef.canvasSize.height*.12?a="top":a="bottom",this.screenPosition.x>this.appWcRef.canvasSize.width*.5?a+="-right":a+="-left",Ee`
|
|
4367
4367
|
<epg-tool-hotspot
|
|
4368
4368
|
class="hotspot-indicator ${i?"inactive":""} ${this.__isFacingCamera()?"":"occluded"}"
|
|
4369
4369
|
style="left: ${this.screenPosition.x}px; top: ${this.screenPosition.y}px"
|
|
@@ -8530,7 +8530,7 @@ void main() {
|
|
|
8530
8530
|
opacity: 0;
|
|
8531
8531
|
pointer-events: none;
|
|
8532
8532
|
}
|
|
8533
|
-
`]}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get eventsManager(){return this._eventsManager}get canvasSize(){return this.__canvasSize}get loaders(){return this._loaders}get experienceData(){return this._experienceData}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}enterPickerState(){this.sessionState="hotspotPlacer",this.style.cursor="crosshair",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.renderEngine.scene.remove(this.__viewStateGrid),this.cameraManager.disableCameraZoomLimits(),this.requestUpdate()}enterViewState(){this.sessionState="cameraUpdate",this.style.cursor="grab",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hotspotsManager.style.opacity="0.25",this.renderEngine.scene.add(this.__viewStateGrid),this.cameraManager.resetCameraToDefault(this.productSettings.camera),this.requestUpdate()}enterDefaultState(){this.sessionState="default",this.style.cursor="grab",this.hotspotsManager.style.opacity="1",this.renderEngine.scene.remove(this.__viewStateGrid),this.cameraManager.resetCameraToDefault(this.productSettings.camera)}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().screenshot)}onLoadFailed(e,t){this._eventsManager.appFailedEvent.fire(t);const i=this.timeElapsedSinceLoadBegin,a=new ty(!0,i,e);this._epigraphAnalytics.sendEvent(a),this.showSplashScreen()}getFirstNonProxyFromIntersections(e){let t=null;for(const i of e)if(!(!i?.object||i.object.userData.isProxyMesh===!0)){t=i;break}return t}__getIntersectionsWithScene(e,t){const i=new l_,a=new He;return a.x=e/this.canvasSize.width*2-1,a.y=-(t/this.canvasSize.height)*2+1,i.setFromCamera(a,this.cameraManager.getCameras().main),i.intersectObjects(this.renderEngine.sceneHierarchy.sceneStructure.rootEntity.children,!0)}getPositionOnMeshFromPoint(e,t){const i=this.__getIntersectionsWithScene(e,t);if(i.length>0){const a=this.getFirstNonProxyFromIntersections(i);return a===null?null:a.point}else return null}getIntersectionOnProductFromPoint(e,t){const i=this.__getIntersectionsWithScene(e,t);let a=null;if(i.length>0){const l=this.getFirstNonProxyFromIntersections(i);if(!l?.object)return null;l.object.traverseAncestors(h=>{if(h instanceof Va&&h.isRoot===!1){a={asset:{id:h.asset.id,name:h.asset.name},intersection:{point:l.point,normals:l.normal}};return}})}return a}getSceneSphericalBoundsForCameraFocus(){const e=this.sceneManager.currentSceneBounds;e.getCenter(this._boundingSphereCenter);const t=e.getBoundingSphere(new vn(this._boundingSphereCenter));if(this.dimensionsManager?.enabled){const i=this.canvasSize.height/this.canvasSize.width;t.radius+=i}return t}async getUsdzUrlForAr(){return this.__usdzBlobUrl=await this.renderEngine.getSceneAsUsdzUrl(),this.eventsManager.arModelReadyEvent.fire(this.__usdzBlobUrl),this.__usdzBlobUrl}async getGlbUrlForAr(){return this.__glbBlobUrl=await this.renderEngine.getSceneAsGlbUrl(),this.eventsManager.arModelReadyEvent.fire(this.__glbBlobUrl),this.__glbBlobUrl}async launchAR(){if(!this.isLoading)return await this.viewInYourSpaceManager.launchAR()}highlightEntityByAssetId(e){const t=this.sceneManager.sceneStructure.getEntityForAssetId(e);if(!t){window.epigraph.logger.error({title:`No asset found for ID: ${e}`});return}t.highlight()}unhighlightAllEntities(){for(const e of this.sceneManager.sceneStructure.getSceneEntities())e.unhighlight()}async spawnAssetInScene(e){const t=this.sceneManager.sceneStructure.getPossibleConnectionsForAssetInScene(e);if(t.length<=0)return Promise.resolve(void 0);const i=t[0];i.connect();const a=new Va(e);await a.initialize();const l=i.receiver,h=i.plug.clone();this.sceneManager.sceneStructure.add(h);const d=new se;l.getWorldPosition(d),h.position.set(d.x,d.y,d.z),h.attach(a);const p=new zi;return l.getWorldQuaternion(p),h.setRotationFromQuaternion(p),l.attach(a),h.removeFromParent(),Et.dispose3(h),this.eventsManager.structureChangedEvent.fire(),Promise.resolve(a)}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),this.cameraManager.fitCameraToSceneBounds()}hideDimensions(e=!1){this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),e||this.cameraManager.fitCameraToSceneBounds()}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsState(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length.distance,width:e.width.distance,height:e.height.distance,unit:t}}printSceneHierarchy(){this.renderEngine.printSceneHierarchy()}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}showHotspots(){window.epigraph.logger.info({title:"Showing Hotspots"}),this.areHotspotsActive=!0,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!0})}hideHotspots(){window.epigraph.logger.info({title:"Hiding Hotspots"}),this.areHotspotsActive=!1,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!1})}toggleHotspots(){this.hotspotsManager.enabled?this.hideHotspots():this.showHotspots()}updateHotspotsOrder(e){this.hotspotsManager.updateHotspotsOrder(e)}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:i=!1}){this.hotspotsManager.openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:i})}closeActiveHotspot(){this.hotspotsManager.closeActiveHotspot()}setActiveHotspotState(e){this.hotspotsManager.setActiveHotspotState(e)}nextHotspot(){return this.hotspotsManager.nextHotspot()}previousHotspot(){return this.hotspotsManager.previousHotspot()}getActiveHotspot(){return this.hotspotsManager.activeHotspot}areHotspotsVisible(){return this.hotspotsManager.enabled}getAllHotspots(){return Array.from(this.hotspotsManager.hotspots.values())}getAllHotspotIds(){return Array.from(this.hotspotsManager.hotspots.keys())}getHotspotById(e){return this.hotspotsManager.hotspots.get(e)}async __onPlayInteractionPrompt(e=2){this.showCameraInteractionPromptIndicator(),await Et.wait(800);for(let t=0;t<e;t++)this.cameraInteractionPromptIndicatorElemRef.classList.add("play-wiggle-animation"),await this.cameraManager.wiggleCamera();this.cameraInteractionPromptIndicatorElemRef.classList.remove("play-wiggle-animation"),this.hideCameraInteractionPromptIndicator(),this._isSceneInteractedWith||setTimeout(()=>{this.__onPlayInteractionPrompt()},3e3)}getAllAnimations(){const e=this.sceneManager.sceneStructure.getFirstEntity();return e?e.getAllAnimations():[]}getAllAnimationNames(){const e=this.sceneManager.sceneStructure.getFirstEntity();return e?e.getAllAnimationNames():[]}playAnimationByName({animationName:e,clampWhenFinished:t=!1,loop:i=!1,repetitions:a=1/0,reverse:l=!1}){if(!e)return;const h=this.getAllAnimationNames();if(!h.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:h});return}const d=h.indexOf(e),p=this.getAllAnimations()[d];return l?(p.timeScale=-1,p.fadeOut(this._animationFadeDurationInMiliseconds*.001)):(p.timeScale=1,p.fadeIn(this._animationFadeDurationInMiliseconds*.001)),p.setLoop(i?$a:El,a),p.clampWhenFinished=t,p.enabled=!0,p.play(),this._activeAnimations.set(e,p),{animationName:e,targetAnimationAction:p}}stopAnimationByName(e){if(!e)return;const t=this.getAllAnimationNames();if(!t.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:t});return}const i=t.indexOf(e),a=this.getAllAnimations()[i];a.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{a.stop()},this._animationFadeDurationInMiliseconds),this._activeAnimations.delete(e)}pauseActiveAnimations(e){for(const t of this._activeAnimations.values())t.paused=!0,e!==void 0&&(t.weight=e)}resumeActiveAnimations(){for(const e of this._activeAnimations.values())e.paused=!1,e.weight=1}stopAllAnimations(){for(const[e,t]of this._activeAnimations.entries())t.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{t.stop(),this._activeAnimations.delete(e)},this._animationFadeDurationInMiliseconds)}postRenderFrameUpdateInEngine(e){try{this.cameraManager.mainCameraControls.update(e),this.debugManager&&this.debugManager.stats.update(),this.renderEngine.mainRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main),this.renderEngine.textRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main)}catch(t){return t}}getScreenPositionFromWorld(e){const t=new He,i=this.cameraManager.getCameras().main,a=this.renderEngine.canvas.clientWidth*.5,l=this.renderEngine.canvas.clientHeight*.5,d=e.clone().project(i);return t.x=(d.x+1)*a,t.y=-(d.y-1)*l,t}_renderAppCanvasContainer(){return this.featuresToEnable.viewer?Ee`
|
|
8533
|
+
`]}get timeElapsedSinceLoadBegin(){return parseFloat((performance.now()-this._loadTimeBegin).toFixed(2))}get epigraphAnalytics(){return this._epigraphAnalytics}get identifier(){return this._identifier}get identifierType(){return this._identifierType}get eventsManager(){return this._eventsManager}get canvasSize(){return this.__canvasSize}get loaders(){return this._loaders}get experienceData(){return this._experienceData}get sceneManager(){return this._sceneManager}get cameraManager(){return this._cameraManager}get hasSceneChanged(){return this.__hasSceneChanged}set hasSceneChanged(e){this.__hasSceneChanged=e}get renderEngine(){return this._renderEngine}get isDevEnv(){return this._isDevEnv}enterPickerState(){this.sessionState="hotspotPlacer",this.style.cursor="crosshair",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.renderEngine.scene.remove(this.__viewStateGrid),this.cameraManager.disableCameraZoomLimits(),this.requestUpdate()}enterViewState(){this.sessionState="cameraUpdate",this.style.cursor="grab",this._isSceneInteractedWith=!0,this.playInteractionPrompt=!1,this.hotspotsManager.style.opacity="0.25",this.renderEngine.scene.add(this.__viewStateGrid),this.cameraManager.resetCameraToDefault(this.productSettings.camera),this.requestUpdate()}enterDefaultState(){this.sessionState="default",this.style.cursor="grab",this.hotspotsManager.style.opacity="1",this.renderEngine.scene.remove(this.__viewStateGrid),this.cameraManager.resetCameraToDefault(this.productSettings.camera)}renderScreenshotCanvasFrame(){this.renderEngine.screenshotRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().screenshot)}onLoadFailed(e,t){this._eventsManager.appFailedEvent.fire(t);const i=this.timeElapsedSinceLoadBegin,a=new ty(!0,i,e);this._epigraphAnalytics.sendEvent(a),this.showSplashScreen()}getFirstNonProxyFromIntersections(e){let t=null;for(const i of e)if(!(!i?.object||i.object.userData.isProxyMesh===!0)){t=i;break}return t}__getIntersectionsWithScene(e,t){const i=new l_,a=new He;return a.x=e/this.canvasSize.width*2-1,a.y=-(t/this.canvasSize.height)*2+1,i.setFromCamera(a,this.cameraManager.getCameras().main),i.intersectObjects(this.renderEngine.sceneHierarchy.sceneStructure.rootEntity.children,!0)}getPositionOnMeshFromPoint(e,t){const i=this.__getIntersectionsWithScene(e,t);if(i.length>0){const a=this.getFirstNonProxyFromIntersections(i);return a===null?null:a.point}else return null}getIntersectionOnProductFromPoint(e,t){const i=this.__getIntersectionsWithScene(e,t);let a=null;if(i.length>0){const l=this.getFirstNonProxyFromIntersections(i);if(!l?.object)return null;l.object.traverseAncestors(h=>{if(h instanceof Va&&h.isRoot===!1){a={asset:{id:h.asset.id,name:h.asset.name},intersection:{point:l.point,normals:l.normal??null}};return}})}return a}getSceneSphericalBoundsForCameraFocus(){const e=this.sceneManager.currentSceneBounds;e.getCenter(this._boundingSphereCenter);const t=e.getBoundingSphere(new vn(this._boundingSphereCenter));if(this.dimensionsManager?.enabled){const i=this.canvasSize.height/this.canvasSize.width;t.radius+=i}return t}async getUsdzUrlForAr(){return this.__usdzBlobUrl=await this.renderEngine.getSceneAsUsdzUrl(),this.eventsManager.arModelReadyEvent.fire(this.__usdzBlobUrl),this.__usdzBlobUrl}async getGlbUrlForAr(){return this.__glbBlobUrl=await this.renderEngine.getSceneAsGlbUrl(),this.eventsManager.arModelReadyEvent.fire(this.__glbBlobUrl),this.__glbBlobUrl}async launchAR(){if(!this.isLoading)return await this.viewInYourSpaceManager.launchAR()}highlightEntityByAssetId(e){const t=this.sceneManager.sceneStructure.getEntityForAssetId(e);if(!t){window.epigraph.logger.error({title:`No asset found for ID: ${e}`});return}t.highlight()}unhighlightAllEntities(){for(const e of this.sceneManager.sceneStructure.getSceneEntities())e.unhighlight()}async spawnAssetInScene(e){const t=this.sceneManager.sceneStructure.getPossibleConnectionsForAssetInScene(e);if(t.length<=0)return Promise.resolve(void 0);const i=t[0];i.connect();const a=new Va(e);await a.initialize();const l=i.receiver,h=i.plug.clone();this.sceneManager.sceneStructure.add(h);const d=new se;l.getWorldPosition(d),h.position.set(d.x,d.y,d.z),h.attach(a);const p=new zi;return l.getWorldQuaternion(p),h.setRotationFromQuaternion(p),l.attach(a),h.removeFromParent(),Et.dispose3(h),this.eventsManager.structureChangedEvent.fire(),Promise.resolve(a)}showDimensions(){this.dimensionsManager.enabled=!0,this.areDimensionsActive=!0,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),this.cameraManager.fitCameraToSceneBounds()}hideDimensions(e=!1){this.dimensionsManager.enabled=!1,this.areDimensionsActive=!1,this.renderEngine.setDimensionsVisibility(this.dimensionsManager.enabled),e||this.cameraManager.fitCameraToSceneBounds()}getDimensions(){const e=this.dimensionsManager.getCurrentDimensionsState(),t=this.dimensionsManager.dimensionsUnit;return{length:e.length.distance,width:e.width.distance,height:e.height.distance,unit:t}}printSceneHierarchy(){this.renderEngine.printSceneHierarchy()}showCameraAim(){this.cameraAimElemRef.classList.remove("hide")}hideCameraAim(){this.cameraAimElemRef.classList.add("hide")}showHelp(){this.isHelpVisible=!0}hideHelp(){this.isHelpVisible=!1}toggleHelp(){this.isHelpVisible=!this.isHelpVisible}showHotspots(){window.epigraph.logger.info({title:"Showing Hotspots"}),this.areHotspotsActive=!0,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!0})}hideHotspots(){window.epigraph.logger.info({title:"Hiding Hotspots"}),this.areHotspotsActive=!1,this.eventsManager.hotspotsVisibilityChanged.fire({visible:!1})}toggleHotspots(){this.hotspotsManager.enabled?this.hideHotspots():this.showHotspots()}updateHotspotsOrder(e){this.hotspotsManager.updateHotspotsOrder(e)}openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:i=!1}){this.hotspotsManager.openHotspot({hotspotId:e,state:t,skipHotspotOpenEvent:i})}closeActiveHotspot(){this.hotspotsManager.closeActiveHotspot()}setActiveHotspotState(e){this.hotspotsManager.setActiveHotspotState(e)}nextHotspot(){return this.hotspotsManager.nextHotspot()}previousHotspot(){return this.hotspotsManager.previousHotspot()}getActiveHotspot(){return this.hotspotsManager.activeHotspot}areHotspotsVisible(){return this.hotspotsManager.enabled}getAllHotspots(){return Array.from(this.hotspotsManager.hotspots.values())}getAllHotspotIds(){return Array.from(this.hotspotsManager.hotspots.keys())}getHotspotById(e){return this.hotspotsManager.hotspots.get(e)}async __onPlayInteractionPrompt(e=2){this.showCameraInteractionPromptIndicator(),await Et.wait(800);for(let t=0;t<e;t++)this.cameraInteractionPromptIndicatorElemRef.classList.add("play-wiggle-animation"),await this.cameraManager.wiggleCamera();this.cameraInteractionPromptIndicatorElemRef.classList.remove("play-wiggle-animation"),this.hideCameraInteractionPromptIndicator(),this._isSceneInteractedWith||setTimeout(()=>{this.__onPlayInteractionPrompt()},3e3)}getAllAnimations(){const e=this.sceneManager.sceneStructure.getFirstEntity();return e?e.getAllAnimations():[]}getAllAnimationNames(){const e=this.sceneManager.sceneStructure.getFirstEntity();return e?e.getAllAnimationNames():[]}playAnimationByName({animationName:e,clampWhenFinished:t=!1,loop:i=!1,repetitions:a=1/0,reverse:l=!1}){if(!e)return;const h=this.getAllAnimationNames();if(!h.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:h});return}const d=h.indexOf(e),p=this.getAllAnimations()[d];return l?(p.timeScale=-1,p.fadeOut(this._animationFadeDurationInMiliseconds*.001)):(p.timeScale=1,p.fadeIn(this._animationFadeDurationInMiliseconds*.001)),p.setLoop(i?$a:El,a),p.clampWhenFinished=t,p.enabled=!0,p.play(),this._activeAnimations.set(e,p),{animationName:e,targetAnimationAction:p}}stopAnimationByName(e){if(!e)return;const t=this.getAllAnimationNames();if(!t.includes(e)){window.epigraph.logger.warn({title:`Invalid animation name: ${e}. Expand for a list of valid names`,details:t});return}const i=t.indexOf(e),a=this.getAllAnimations()[i];a.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{a.stop()},this._animationFadeDurationInMiliseconds),this._activeAnimations.delete(e)}pauseActiveAnimations(e){for(const t of this._activeAnimations.values())t.paused=!0,e!==void 0&&(t.weight=e)}resumeActiveAnimations(){for(const e of this._activeAnimations.values())e.paused=!1,e.weight=1}stopAllAnimations(){for(const[e,t]of this._activeAnimations.entries())t.fadeOut(this._animationFadeDurationInMiliseconds*.001),setTimeout(()=>{t.stop(),this._activeAnimations.delete(e)},this._animationFadeDurationInMiliseconds)}postRenderFrameUpdateInEngine(e){try{this.cameraManager.mainCameraControls.update(e),this.debugManager&&this.debugManager.stats.update(),this.renderEngine.mainRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main),this.renderEngine.textRenderer.render(this.renderEngine.scene,this.cameraManager.getCameras().main)}catch(t){return t}}getScreenPositionFromWorld(e){const t=new He,i=this.cameraManager.getCameras().main,a=this.renderEngine.canvas.clientWidth*.5,l=this.renderEngine.canvas.clientHeight*.5,d=e.clone().project(i);return t.x=(d.x+1)*a,t.y=-(d.y-1)*l,t}_renderAppCanvasContainer(){return this.featuresToEnable.viewer?Ee`
|
|
8534
8534
|
<div id="appCanvasContainer" class="app-canvas-container">
|
|
8535
8535
|
<span id="cameraAimIndicator" class="camera-aim-indicator hide"></span>
|
|
8536
8536
|
</div>
|