|
@@ -24,7 +24,7 @@ var fbxMesh2 = null;
|
|
var fbxMesh3 = null;
|
|
var fbxMesh3 = null;
|
|
var fbxLoader1Loaded = false;
|
|
var fbxLoader1Loaded = false;
|
|
var fbxLoader2Loaded = false;
|
|
var fbxLoader2Loaded = false;
|
|
-var fbxLoader3Loaded = false
|
|
|
|
|
|
+var fbxLoader3Loaded = false;
|
|
|
|
|
|
var oldStatus = '';
|
|
var oldStatus = '';
|
|
var oldBenchIds = '';
|
|
var oldBenchIds = '';
|
|
@@ -1150,8 +1150,8 @@ function benchRefresh(result) {
|
|
}
|
|
}
|
|
|
|
|
|
if (benchIdList.indexOf(Number(bench_id)) >= 0) {
|
|
if (benchIdList.indexOf(Number(bench_id)) >= 0) {
|
|
- console.log('移动原台架模型位置', bench_id)
|
|
|
|
- window.benchMeshMap[bench_id].position.set(x, y + 10, z);
|
|
|
|
|
|
+ // console.log('移动原台架模型位置', bench_id)
|
|
|
|
+ window.benchMeshMap[bench_id].position.set(x, y, z);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else { // 台架变化,需移除原模型后重新添加新模型
|
|
} else { // 台架变化,需移除原模型后重新添加新模型
|
|
@@ -1159,25 +1159,25 @@ function benchRefresh(result) {
|
|
oldBenchIds = newBenchIds;
|
|
oldBenchIds = newBenchIds;
|
|
// 请求到的新台架id
|
|
// 请求到的新台架id
|
|
|
|
|
|
- let new_bench_id_arr = []
|
|
|
|
|
|
+ let new_bench_id_arr = [];
|
|
benchList.forEach(function (item) {
|
|
benchList.forEach(function (item) {
|
|
- new_bench_id_arr.push(item.id)
|
|
|
|
- })
|
|
|
|
|
|
+ new_bench_id_arr.push(item.id);
|
|
|
|
+ });
|
|
// console.log('新台架id', new_bench_id_arr)
|
|
// console.log('新台架id', new_bench_id_arr)
|
|
|
|
|
|
// 旧存的台架id
|
|
// 旧存的台架id
|
|
- let old_bench_id_arr = Object.keys(window.benchMeshMap);
|
|
|
|
|
|
+ let old_bench_id_arr = Object.keys(window.benchMeshMap);
|
|
// console.log('旧台架id', old_bench_id_arr)
|
|
// console.log('旧台架id', old_bench_id_arr)
|
|
|
|
|
|
// 要移除的台架id
|
|
// 要移除的台架id
|
|
- let remove_bench_id_arr = old_bench_id_arr.filter(item => !new_bench_id_arr.includes(item))
|
|
|
|
|
|
+ let remove_bench_id_arr = old_bench_id_arr.filter(item => !new_bench_id_arr.includes(item));
|
|
// console.log('要移除的台架', remove_bench_id_arr)
|
|
// console.log('要移除的台架', remove_bench_id_arr)
|
|
|
|
|
|
if (remove_bench_id_arr.length > 0) {
|
|
if (remove_bench_id_arr.length > 0) {
|
|
// console.log('存在消失的台架,移除模型')
|
|
// console.log('存在消失的台架,移除模型')
|
|
for (var bench_id of remove_bench_id_arr) {
|
|
for (var bench_id of remove_bench_id_arr) {
|
|
let deleteChildMesh = window.benchMeshMap[bench_id];
|
|
let deleteChildMesh = window.benchMeshMap[bench_id];
|
|
- window.sdkInstance.sceneRenderer.scene.remove(deleteChildMesh)
|
|
|
|
|
|
+ window.sdkInstance.sceneRenderer.scene.remove(deleteChildMesh);
|
|
// deleteChildMesh.geometry.dispose(); // 清理几何体
|
|
// deleteChildMesh.geometry.dispose(); // 清理几何体
|
|
// deleteChildMesh.material.dispose(); // 清理材质
|
|
// deleteChildMesh.material.dispose(); // 清理材质
|
|
deleteChildMesh = null; // 置空指向该3D模型的变量
|
|
deleteChildMesh = null; // 置空指向该3D模型的变量
|