Browse Source

对接api

dev
刘向辉 3 years ago
parent
commit
aea9fe3839
  1. 1
      src/app/babylon/model/data/institution/facility/all-facility-data.ts
  2. 2
      src/app/babylon/view/facility-window/facility-window.ts
  3. 8
      src/app/service/babylon/building-basic-infos.service.ts
  4. BIN
      src/assets/mesh/indexdb/gd/GD.bin
  5. 183
      src/assets/mesh/indexdb/gd/GD.gltf
  6. 5
      src/assets/mesh/indexdb/gd/GD.gltf.manifest
  7. BIN
      src/assets/mesh/indexdb/gd/GD.jpg

1
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) {

2
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++) {

8
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<any>(this.baseUrl + this.c_post, {},{params})
return this.http.post<any>(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<any> {
return this.http.post<any>(this.markUrl + this.c_post + '?name=' + name, data)
let params = {
name: name,
content: JSON.stringify(data),
}
return this.http.post<any>(this.markUrl + this.c_post, {}, { params })
.pipe(
catchError((err) => this.handleError(err))
);

BIN
src/assets/mesh/indexdb/gd/GD.bin

Binary file not shown.

183
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"
]
}

5
src/assets/mesh/indexdb/gd/GD.gltf.manifest

@ -0,0 +1,5 @@
{
"version" : 1,
"enableSceneOffline" : true,
"enableTexturesOffline" : true
}

BIN
src/assets/mesh/indexdb/gd/GD.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Loading…
Cancel
Save