|
@@ -12,10 +12,10 @@ import { MTLLoader } from "three/examples/jsm/loaders/MTLLoader.js";
|
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
import { ConvexGeometry } from "three/examples/jsm/geometries/ConvexGeometry.js";
|
|
import { ConvexGeometry } from "three/examples/jsm/geometries/ConvexGeometry.js";
|
|
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";
|
|
import { DRACOLoader } from "three/examples/jsm/loaders/DRACOLoader";
|
|
-import {
|
|
|
|
- showFullScreenLoading,
|
|
|
|
- tryHideFullScreenLoading,
|
|
|
|
-} from "../../../axios/filter";
|
|
|
|
|
|
+// import {
|
|
|
|
+// showFullScreenLoading,
|
|
|
|
+// tryHideFullScreenLoading,
|
|
|
|
+// } from "../../../axios/filter";
|
|
import { mapState } from "vuex";
|
|
import { mapState } from "vuex";
|
|
|
|
|
|
export default {
|
|
export default {
|
|
@@ -440,7 +440,7 @@ export default {
|
|
this.car = null;
|
|
this.car = null;
|
|
}
|
|
}
|
|
|
|
|
|
- showFullScreenLoading();
|
|
|
|
|
|
+ // showFullScreenLoading();
|
|
|
|
|
|
var that = this;
|
|
var that = this;
|
|
var loader = new GLTFLoader(); //创建一个FBX加载器
|
|
var loader = new GLTFLoader(); //创建一个FBX加载器
|
|
@@ -454,7 +454,8 @@ export default {
|
|
loader.load(
|
|
loader.load(
|
|
model,
|
|
model,
|
|
function (obj) {
|
|
function (obj) {
|
|
- tryHideFullScreenLoading();
|
|
|
|
|
|
+ // tryHideFullScreenLoading();
|
|
|
|
+ that.$emit('loadingDone', 'carDone');
|
|
|
|
|
|
obj.scene.rotation.set(
|
|
obj.scene.rotation.set(
|
|
(-90 * Math.PI) / 180,
|
|
(-90 * Math.PI) / 180,
|
|
@@ -479,7 +480,8 @@ export default {
|
|
// console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
|
|
// console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
|
|
},
|
|
},
|
|
(error) => {
|
|
(error) => {
|
|
- tryHideFullScreenLoading();
|
|
|
|
|
|
+ // tryHideFullScreenLoading();
|
|
|
|
+ that.$emit('loadingDone', 'carDone');
|
|
console.error(error);
|
|
console.error(error);
|
|
}
|
|
}
|
|
);
|
|
);
|
|
@@ -617,18 +619,18 @@ export default {
|
|
objUrl = `${that.publicPath}sensor/gps/lidar.obj`;
|
|
objUrl = `${that.publicPath}sensor/gps/lidar.obj`;
|
|
}
|
|
}
|
|
|
|
|
|
- if (type === "ogt") {
|
|
|
|
- showFullScreenLoading();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (type === "ogt") {
|
|
|
|
+ // showFullScreenLoading();
|
|
|
|
+ // }
|
|
|
|
|
|
Loader.load(
|
|
Loader.load(
|
|
mtlUrl,
|
|
mtlUrl,
|
|
function (materials) {
|
|
function (materials) {
|
|
loader.setMaterials(materials);
|
|
loader.setMaterials(materials);
|
|
loader.load(objUrl, function (obj) {
|
|
loader.load(objUrl, function (obj) {
|
|
- if (type === "ogt") {
|
|
|
|
- tryHideFullScreenLoading();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (type === "ogt") {
|
|
|
|
+ // tryHideFullScreenLoading();
|
|
|
|
+ // }
|
|
|
|
|
|
that.cacheList.push(obj);
|
|
that.cacheList.push(obj);
|
|
for (let i = 0; i < obj.children.length; i++) {
|
|
for (let i = 0; i < obj.children.length; i++) {
|
|
@@ -655,9 +657,9 @@ export default {
|
|
// console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
|
|
// console.log((xhr.loaded / xhr.total) * 100 + "% loaded");
|
|
},
|
|
},
|
|
(error) => {
|
|
(error) => {
|
|
- if (type === "ogt") {
|
|
|
|
- tryHideFullScreenLoading();
|
|
|
|
- }
|
|
|
|
|
|
+ // if (type === "ogt") {
|
|
|
|
+ // tryHideFullScreenLoading();
|
|
|
|
+ // }
|
|
console.error(error);
|
|
console.error(error);
|
|
}
|
|
}
|
|
);
|
|
);
|