|
@@ -454,8 +454,25 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
|
|
|
if (!sessionStorage.getItem('3dMode') || sessionStorage.getItem('3dMode') == 0) {
|
|
|
window.sdkInstance.changeMode(finalMode);
|
|
|
setTimeout(() => {
|
|
|
+ var element = document.getElementById('house-player');
|
|
|
var container = document.getElementById("ordinary-map")
|
|
|
container.style.opacity = 1;
|
|
|
+ let mapDom = document.getElementsByClassName("ordinary-map-container")[0];
|
|
|
+ let style = getComputedStyle(mapDom);
|
|
|
+ let width = parseFloat(style.width);
|
|
|
+ let height = parseFloat(style.height);
|
|
|
+
|
|
|
+ let ratio = 1.8;
|
|
|
+ window.renderWidth = width * ratio;
|
|
|
+ window.renderHeight = height * ratio;
|
|
|
+ window.sdkInstance.sceneRenderer.updateScreenSize(width * ratio, height * ratio);
|
|
|
+ element.style.marginLeft = ((width - (width * ratio)) / 2) + 'px';
|
|
|
+ element.style.marginTop = ((height - (height * ratio)) / 2) + 'px';
|
|
|
+ let playersmall = document.getElementById('playersmall')
|
|
|
+ playersmall.appendChild(element)
|
|
|
+ setTimeout(() => {
|
|
|
+ window.sdkInstance.changeMode('floorplan');
|
|
|
+ })
|
|
|
}, 500)
|
|
|
}
|
|
|
|
|
@@ -556,43 +573,38 @@ export function uwbMain(domId, modelWidth, modelHeight, finalMode, callback) {
|
|
|
let bFirst = true;
|
|
|
let bool = false;
|
|
|
let bool1 = false;
|
|
|
- // intersects.forEach(m => {
|
|
|
- // if (m.object.geometry.type != "PlaneBufferGeometry") {
|
|
|
- // if (m.object.userData && m.object.userData.benchFlag == true) {
|
|
|
- // if (!bool) {
|
|
|
- // bool = true;
|
|
|
- // //m.object.material = window.shader1;
|
|
|
- // ////m.object.scale.set(10, 10, 10)
|
|
|
- // //m.object.scale.set(5, 5, 5)
|
|
|
- // //outlineObj(m.object)
|
|
|
- // // let player = document.getElementById(domId)
|
|
|
- // // player.style.display = "none"
|
|
|
-
|
|
|
- // if (box) {
|
|
|
- // sdkInstance.sceneRenderer.scene.remove(box);
|
|
|
- // }
|
|
|
- // window.handleBenchClick(m.object.userData.benchId, m.object.userData.bShowRemoteButton)
|
|
|
-
|
|
|
- // box = new THREE.BoxHelper(m.object, '#ff0000'); //object 模型
|
|
|
- // sdkInstance.sceneRenderer.scene.add(box);
|
|
|
-
|
|
|
- // //let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
|
- // //sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
|
- // //let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
|
- // //pointLight.position.set(200, 200, 200); //设置点光源位置
|
|
|
- // //sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
|
|
|
- // }
|
|
|
- // //outlineObj(m.object)
|
|
|
-
|
|
|
- // //m.object.material = FXAAShader
|
|
|
- // }
|
|
|
-
|
|
|
- // } else if (m.object.geometry.type == "PlaneBufferGeometry") {
|
|
|
- // if (m.object.userData && m.object.userData.benchFlag == true) {
|
|
|
- // window.handleListClick(m.object.userData.benchId)
|
|
|
- // }
|
|
|
- // }
|
|
|
- // })
|
|
|
+ intersects.forEach(m => {
|
|
|
+ if (m.object.geometry.type != "PlaneBufferGeometry") {
|
|
|
+ if (m.object.userData && m.object.userData.benchFlag == true) {
|
|
|
+ if (!bool) {
|
|
|
+ bool = true;
|
|
|
+ //m.object.material = window.shader1;
|
|
|
+ ////m.object.scale.set(10, 10, 10)
|
|
|
+ //m.object.scale.set(5, 5, 5)
|
|
|
+ //outlineObj(m.object)
|
|
|
+ // let player = document.getElementById(domId)
|
|
|
+ // player.style.display = "none
|
|
|
+ if (box) {
|
|
|
+ sdkInstance.sceneRenderer.scene.remove(box);
|
|
|
+ }
|
|
|
+ window.handleBenchClick(m.object.userData.benchId, m.object.userData.bShowRemoteButton)
|
|
|
+ box = new THREE.BoxHelper(m.object, '#ff0000'); //object 模型
|
|
|
+ sdkInstance.sceneRenderer.scene.add(box)
|
|
|
+ //let ambientLight = new THREE.AmbientLight(0xffffff); //设置环境光
|
|
|
+ //sdkInstance.sceneRenderer.scene.add(ambientLight); //将环境光添加到场景中
|
|
|
+ //let pointLight = new THREE.PointLight(0xffffff, 1, 0);
|
|
|
+ //pointLight.position.set(200, 200, 200); //设置点光源位置
|
|
|
+ //sdkInstance.sceneRenderer.scene.add(pointLight); //将点光源添加至场景
|
|
|
+ }
|
|
|
+ //outlineObj(m.object
|
|
|
+ //m.object.material = FXAAShader
|
|
|
+
|
|
|
+ } else if (m.object.geometry.type == "PlaneBufferGeometry") {
|
|
|
+ if (m.object.userData && m.object.userData.benchFlag == true) {
|
|
|
+ window.handleListClick(m.object.userData.benchId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }})
|
|
|
bool = false;
|
|
|
bool1 = false;
|
|
|
}
|