diff --git a/src/app/babylon/model/data/institution/facility/all-facility-data.ts b/src/app/babylon/model/data/institution/facility/all-facility-data.ts index b6decfa..cd55fe6 100644 --- a/src/app/babylon/model/data/institution/facility/all-facility-data.ts +++ b/src/app/babylon/model/data/institution/facility/all-facility-data.ts @@ -55,6 +55,7 @@ export class AllFacilityData { //新建设备信息 static newFacilityData(type: FacilityType, posType: FacilityPosType, allFacilityData: AllFacilityData, isModel: boolean = true): ModelData_facility { + return; let name = ConfigManager.getFacilityTypeName(type); let result = new ModelData_facility(type.toString(), type, name, DataManager.getResName_facility(type) + ".gltf", new TransformData(), posType, isModel); switch (posType) { diff --git a/src/app/babylon/view/facility-window/facility-window.ts b/src/app/babylon/view/facility-window/facility-window.ts index 08e88d1..b09bb1f 100644 --- a/src/app/babylon/view/facility-window/facility-window.ts +++ b/src/app/babylon/view/facility-window/facility-window.ts @@ -156,7 +156,7 @@ export class FacilityWindow extends UIBase { let instance = this; //为了避免多个模型同时加载、导致indexDB创建冲突,所以先加载一个,保证indexDB创建完成 - BabylonTool.importMeshSync(null, "assets/facilities/outdoor/gd/", "GD.gltf", undefined, "GD_indexDB", (meshes) => { + BabylonTool.importMeshSync(null, "mesh/indexdb/gd/", "GD.gltf", undefined, "GD_indexDB", (meshes) => { meshes[0].dispose(); for (let i = 0; i < facilities.length; i++) { diff --git a/src/app/service/babylon/building-basic-infos.service.ts b/src/app/service/babylon/building-basic-infos.service.ts index 030615a..4cb08fc 100644 --- a/src/app/service/babylon/building-basic-infos.service.ts +++ b/src/app/service/babylon/building-basic-infos.service.ts @@ -40,7 +40,7 @@ export class BuildingBasicInfosService { name: name, content: JSON.stringify(data), } - return this.http.post(this.baseUrl + this.c_post, {},{params}) + return this.http.post(this.baseUrl + this.c_post, {}, { params }) .pipe( catchError((err) => this.handleError(err)) ); @@ -64,7 +64,11 @@ export class BuildingBasicInfosService { * @param data */ postMarkData(name: string, data: any): Observable { - return this.http.post(this.markUrl + this.c_post + '?name=' + name, data) + let params = { + name: name, + content: JSON.stringify(data), + } + return this.http.post(this.markUrl + this.c_post, {}, { params }) .pipe( catchError((err) => this.handleError(err)) ); diff --git a/src/assets/mesh/indexdb/gd/GD.bin b/src/assets/mesh/indexdb/gd/GD.bin new file mode 100644 index 0000000..5011d2b Binary files /dev/null and b/src/assets/mesh/indexdb/gd/GD.bin differ diff --git a/src/assets/mesh/indexdb/gd/GD.gltf b/src/assets/mesh/indexdb/gd/GD.gltf new file mode 100644 index 0000000..c99c72d --- /dev/null +++ b/src/assets/mesh/indexdb/gd/GD.gltf @@ -0,0 +1,183 @@ +{ + "asset": { + "version": "2.0", + "generator": "babylon.js glTF exporter for 3dsmax 2020 v20201214.2" + }, + "scene": 0, + "scenes": [ + { + "nodes": [ + 0 + ] + } + ], + "nodes": [ + { + "mesh": 0, + "translation": [ + 33.9399452, + 158.461441, + 35.7631378 + ], + "rotation": [ + 0.5688382, + 2.48647058e-8, + 0.8224495, + 3.59504071e-8 + ], + "scale": [ + 0.385688841, + 0.385688871, + 1.14512515 + ], + "name": "GaoDu", + "extras": { + "mr displacement use global settings": true, + "mr displacement view dependent": true, + "mr displacement method": 6, + "mr displacement smoothing on": true, + "mr displacement edge length": 2, + "mr displacement max displace": 20, + "mr displacement parametric subdivision level": 5 + } + } + ], + "meshes": [ + { + "primitives": [ + { + "attributes": { + "POSITION": 1, + "TANGENT": 2, + "NORMAL": 3, + "TEXCOORD_0": 4 + }, + "indices": 0, + "material": 0, + "mode": 4, + "extensions": { + "KHR_draco_mesh_compression": { + "bufferView": 0, + "attributes": { + "POSITION": 0, + "TANGENT": 1, + "NORMAL": 2, + "TEXCOORD_0": 3 + } + } + } + } + ], + "name": "GaoDu" + } + ], + "accessors": [ + { + "componentType": 5123, + "count": 20832, + "type": "SCALAR", + "name": "accessorIndices" + }, + { + "componentType": 5126, + "count": 19248, + "max": [ + 35.525958153932585, + 411.2544466350758, + 0.6266869361514412 + ], + "min": [ + -38.73667433507572, + -411.2543856350757, + -0.5775719690757206 + ], + "type": "VEC3", + "name": "accessorPositions" + }, + { + "componentType": 5126, + "count": 19248, + "type": "VEC4", + "name": "accessorTangents" + }, + { + "componentType": 5126, + "count": 19248, + "type": "VEC3", + "name": "accessorNormals" + }, + { + "componentType": 5126, + "count": 19248, + "type": "VEC2", + "name": "accessorUVs" + } + ], + "bufferViews": [ + { + "buffer": 0, + "byteOffset": 0, + "byteLength": 307722 + } + ], + "buffers": [ + { + "name": "GD", + "byteLength": 307724, + "uri": "GD.bin" + } + ], + "materials": [ + { + "pbrMetallicRoughness": { + "baseColorTexture": { + "index": 0, + "texCoord": 0 + }, + "metallicFactor": 0, + "roughnessFactor": 0.450053632, + "baseColorFactor": [ + 1, + 1, + 1, + 1 + ] + }, + "name": "GD", + "emissiveFactor": [ + 0, + 0, + 0 + ], + "alphaMode": "OPAQUE", + "doubleSided": false + } + ], + "textures": [ + { + "sampler": 0, + "source": 0, + "name": "GD.jpg" + } + ], + "images": [ + { + "name": "GD", + "uri": "GD.jpg" + } + ], + "samplers": [ + { + "magFilter": 9729, + "minFilter": 9987, + "wrapS": 10497, + "wrapT": 10497 + } + ], + "extensionsRequired": [ + "KHR_draco_mesh_compression" + ], + "extensionsUsed": [ + "KHR_draco_mesh_compression" + ] +} diff --git a/src/assets/mesh/indexdb/gd/GD.gltf.manifest b/src/assets/mesh/indexdb/gd/GD.gltf.manifest new file mode 100644 index 0000000..1781cb5 --- /dev/null +++ b/src/assets/mesh/indexdb/gd/GD.gltf.manifest @@ -0,0 +1,5 @@ +{ + "version" : 1, + "enableSceneOffline" : true, + "enableTexturesOffline" : true +} \ No newline at end of file diff --git a/src/assets/mesh/indexdb/gd/GD.jpg b/src/assets/mesh/indexdb/gd/GD.jpg new file mode 100644 index 0000000..fba64de Binary files /dev/null and b/src/assets/mesh/indexdb/gd/GD.jpg differ