Browse Source

fix: ci

ShangHai_LongXiang
高志龙 3 years ago
parent
commit
b6940138e1
  1. 153
      public/static/qm/MainMap_QM_go.js

153
public/static/qm/MainMap_QM_go.js

@ -1951,8 +1951,8 @@ MainMap_QM.prototype = {
if (fIndex >= Map_QM.util.allMap[bIndex].buildArr.length) {
if (bIndex == Map_QM.util.allMap.length - 1) {
clearInterval(intTimer)
this.controls.minPan = new THREE.Vector3(this.w / -10, 0, this.h / -10)
this.controls.maxPan = new THREE.Vector3(this.w / 10, 0, this.h / 10)
this.controls.minPan = new THREE.Vector3(this.w / -8, 0, this.h / -8)
this.controls.maxPan = new THREE.Vector3(this.w / 8, 0, this.h / 8)
let pathData = Map_QM.util.allMap[parseInt(Map_QM.util.deviceObj.build)].buildArr[parseInt(Map_QM.util.deviceObj.floor)].mapData.path
if (Map_QM.util.deviceObj.xaxis) {
@ -5228,9 +5228,8 @@ FloorMap_QM.prototype = {
}
entColor = parseInt(mapData.buildArea[i].entColor.replace('#', '0x'), 16)
borderColor = parseInt(mapData.buildArea[i].borderColor.replace('#', '0x'), 16)
Map_QM.util.buildHeight = Math.max(parseInt(mapData.buildArea[i].toHeight), Map_QM.util.buildHeight)
buildH = parseInt(mapData.buildArea[i].toHeight)
let mash = this.Model_QM.MyModelShape(build, hows, mapData.buildArea[i], entColor, borderColor, 30)
let mash = this.Model_QM.MyPlaneShape(build, hows, mapData.buildArea[i], entColor, borderColor, 30 + 100 * this.floorOrder)
mash.receiveShadow = true
mash.castShadow = false
mash.userData = {
@ -5918,16 +5917,18 @@ MyModel_QM.prototype.MyModelShape = function (areaArr, howllowArr, opObj, entity
shape.bezierCurveTo(areaArr[i][2], -1 * areaArr[i][3], areaArr[i][4], -1 * areaArr[i][5], areaArr[i][6], -1 * areaArr[i][7])
}
}
let material
let material;
let matcolor = new THREE.Color(lineColor)
for (let k = 0; k < Map_QM.util.lineBasicMaterialArr.length; k++) {
let color2 = new THREE.Color(lineColor)
if (Map_QM.util.lineBasicMaterialArr[k].color.equals(color2)) {
if (Map_QM.util.lineBasicMaterialArr[k].color.equals(matcolor)) {
material = Map_QM.util.lineBasicMaterialArr[k]
}
}
if (!material) {
material = new THREE.LineBasicMaterial({
color: lineColor
color: lineColor,
opacity: 0.8,
transparent: true
}) //材质对象lineColor
Map_QM.util.lineBasicMaterialArr.push(material)
}
@ -5950,12 +5951,12 @@ MyModel_QM.prototype.MyModelShape = function (areaArr, howllowArr, opObj, entity
options = {
depth: parseInt(opObj.toHeight),
bevelEnabled: false,
curveSegments: 24
curveSegments: 12
}
scanGeometry = new THREE.ExtrudeGeometry(shape, options)
for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) {
let color2 = new THREE.Color(entityColor)
for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) {
if (Map_QM.util.meshMaterialArr[e].color.equals(color2) && Map_QM.util.meshMaterialArr[e].opacity == alphaModle) {
meshMaterial = Map_QM.util.meshMaterialArr[e]
}
@ -5994,6 +5995,115 @@ MyModel_QM.prototype.MyModelShape = function (areaArr, howllowArr, opObj, entity
return mesh
}
//绘制平面
MyModel_QM.prototype.MyPlaneShape = function (areaArr, howllowArr, opObj, entityColor = "#dadada", lineColor = "#eeeeee", indexOrder = 1) {
let len = areaArr.length;
if (len == 0) {
return;
}
let alphaModle = opObj.alphaModle / 100 || 0;
// 实例化shape对象
let shape = new THREE.Shape();
// 设置开始点的位置
shape.moveTo(areaArr[0][0], -1 * areaArr[0][1]);
for (let i = 0; i < areaArr.length; i++) {
if (areaArr[i].length == 4) {
shape.lineTo(areaArr[i][2], -1 * areaArr[i][3]);
} else {
shape.bezierCurveTo(areaArr[i][2], -1 * areaArr[i][3], areaArr[i][4], -1 * areaArr[i][5], areaArr[i][6], -1 * areaArr[i][7]);
}
}
let material;
for (let k = 0; k < Map_QM.util.lineBasicMaterialArr.length; k++) {
let color2 = new THREE.Color(lineColor)
if (Map_QM.util.lineBasicMaterialArr[k].color.equals(color2)) {
material = Map_QM.util.lineBasicMaterialArr[k];
}
}
if (!material) {
material = new THREE.LineBasicMaterial({
color: lineColor,
opacity: 0.8,
transparent: true
}); //材质对象lineColor
Map_QM.util.lineBasicMaterialArr.push(material);
}
if (howllowArr && howllowArr.length > 0) {
for (let n = 0; n < howllowArr.length; n++) {
let hole = new THREE.Path(); // 添加孔洞
hole.moveTo(howllowArr[n][0][0], -1 * howllowArr[n][0][1]);
for (let k = 0; k < howllowArr[n].length; k++) {
if (howllowArr[n][k].length == 4) {
hole.lineTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3]);
} else {
hole.bezierCurveTo(howllowArr[n][k][2], -1 * howllowArr[n][k][3], howllowArr[n][k][4], -1 * howllowArr[n][k][5], howllowArr[n][k][6], -1 * howllowArr[n][k][7]);
}
}
shape.holes.push(hole);
}
}
let scanGeometry, meshMaterial;
scanGeometry = new THREE.ShapeGeometry(shape, 8);
Map_QM.util.assignUVs(scanGeometry);
if(opObj.map){
for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) {
if (Map_QM.util.meshMaterialArr[e].userData.map == opObj.map) {
meshMaterial = Map_QM.util.meshMaterialArr[e];
}
}
if (!meshMaterial) {
let texture = new THREE.TextureLoader().load(Map_QM.util.beforPath + "static/img/map/" + opObj.map + ".jpg");
texture.wrapT = THREE.RepeatWrapping;
texture.repeat.y = 1;
meshMaterial = new THREE.MeshPhongMaterial({ //MeshStandardMaterial MeshPhongMaterial olor: entityColor,
color: entityColor,
map: texture,
transparent: true,
opacity: alphaModle,
side: THREE.DoubleSide,
depthTest: true
});
meshMaterial.userData.map = opObj.map;
Map_QM.util.meshMaterialArr.push(meshMaterial);
}
}else{
for (let e = 0; e < Map_QM.util.meshMaterialArr.length; e++) {
let color2 = new THREE.Color(entityColor);
if (Map_QM.util.meshMaterialArr[e].color.equals(color2) && Map_QM.util.meshMaterialArr[e].opacity == alphaModle && !Map_QM.util.meshMaterialArr[e].userData.map) {
meshMaterial = Map_QM.util.meshMaterialArr[e];
}
}
if (!meshMaterial) {
meshMaterial = new THREE.MeshPhongMaterial({
color: entityColor,
transparent: true,
opacity: alphaModle,
side: THREE.DoubleSide,
depthTest: true
});
Map_QM.util.meshMaterialArr.push(meshMaterial);
}
if (opObj.angleY || opObj.angleZ) {
Map_QM.util.rotateYZ(scanGeometry, opObj.angleY * Math.PI / 180, opObj.angleZ * Math.PI / 180);
}
}
// 创建模型
let mesh = new THREE.Mesh(scanGeometry, meshMaterial);
let cubeEdges = new THREE.EdgesGeometry(scanGeometry, 60);
let cubeLine = new THREE.LineSegments(cubeEdges, material);
cubeLine.renderOrder = indexOrder - 5;
mesh.add(cubeLine);
if (opObj.name != "floor") {
mesh.position.z = parseInt(opObj.toHeight) || 0;
}
mesh.castShadow = true;
mesh.renderOrder = indexOrder;
mesh.name = opObj.name || "";
return mesh;
}
MyModel_QM.prototype.MyModelText = function (svgArea) {
let text = svgArea.data
const paths = new THREE.SVGLoader().parse(text).paths
@ -6024,21 +6134,14 @@ MyModel_QM.prototype.MyModelText = function (svgArea) {
}
for (let i = 0; i < paths.length; i++) {
const path = paths[i]
let shapes = path.toShapes(true)
for (let j = 0; j < shapes.length; j++) {
const shape = shapes[j]
const geometry = new THREE.ExtrudeBufferGeometry(shape, {
depth: svgArea.toHeight,
bevelEnabled: false,
curveSegments: 24
})
const mesh = new THREE.Mesh(geometry, meshMaterial)
mesh.renderOrder = 50
mesh.name = svgArea.name || ''
mesh.position.set(-svgArea.width / 2, -svgArea.height / 2, 0)
group.add(mesh)
}
const path = paths[i];
let shapes = path.toShapes(true);
const geometry = new THREE.ShapeGeometry(shapes, 12);
const mesh = new THREE.Mesh(geometry, meshMaterial);
mesh.renderOrder = 50;
mesh.name = svgArea.name || "";
mesh.position.set(svgArea.width / -2, svgArea.height / -2, parseInt(svgArea.toHeight)+1);
group.add(mesh);
}
return group
}

Loading…
Cancel
Save