From 6d66915670e668cecb73b3c7249e0ff2c98ec5c6 Mon Sep 17 00:00:00 2001 From: gaozl Date: Mon, 29 May 2023 11:30:35 +0800 Subject: [PATCH] fix: ci --- public/static/qm/MainMap_QM.js | 14 +++++++++----- public/static/qm/three.js | 12 ++++++------ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/public/static/qm/MainMap_QM.js b/public/static/qm/MainMap_QM.js index e54d6c1..776e109 100644 --- a/public/static/qm/MainMap_QM.js +++ b/public/static/qm/MainMap_QM.js @@ -1,4 +1,4 @@ -var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = true, shopTime, debug = false; //dir--自定义地图大小适应不同版本的地图大小 +var Map_QM, renderFrame = -1, pathCameraState, stats, stateTime, isJUZ = false, hasLine = false, dir = false, iot = false, shopTime, debug = false; //dir--自定义地图大小适应不同版本的地图大小 //basePath 基础路径 graphPath最佳路径 ftPath 扶梯路径 dtPath 电梯路径 var typeObj = [{ ft: 0, type: 0, code: 'ft', name: '扶梯' }, { upft: 1, type: 1, code: 'upft', name: '上扶梯' }, { downft: 2, type: 2, code: 'downft', name: '下扶梯' }, { mys: 3, type: 3, code: 'mys', name: '母婴室' }, { xsj: 4, type: 4, code: 'xsj', name: '洗手间' }, @@ -843,7 +843,7 @@ QMUtil = function () { } else { //不是横线时 根据斜率计算点位 x = point.x + 5; - y = parseInt(gradient * (x - point.x) + point.y); + y = gradient * (x - point.x) + point.y; } return Map_QM.util.pointXY(point, new Map_QM.util.Point(x, y), wallWidth / 2); @@ -866,8 +866,8 @@ QMUtil = function () { let x1 = (-B + Math.sqrt(Math.pow(B, 2) - 4 * A * C)) / (2 * A); let x2 = (-B - Math.sqrt(Math.pow(B, 2) - 4 * A * C)) / (2 * A); - result.push(new Map_QM.util.Point(parseInt(x1), parseInt(k * x1 + b))); - result.push(new Map_QM.util.Point(parseInt(x2), parseInt(k * x2 + b))); + result.push(new Map_QM.util.Point(x1, k * x1 + b)); + result.push(new Map_QM.util.Point(x2, k * x2 + b)); return result; } //计算两条直线的相交点 @@ -2624,7 +2624,11 @@ MainMap_QM.prototype = { drawToLine: function (startPoint, endPoint, dash = 50, color = 0x2269dd, ctrlPoint1 = null, ctrlPoint2 = null) { let curve = new THREE.CubicBezierCurve3(startPoint, ctrlPoint1, ctrlPoint2, endPoint); let points = curve.getPoints(dash); - let flyLine = createFlyCurve(points, false); + let colorChange=[]; + for(let i=1; i<7; i+=2){ + colorChange.push(parseInt("0x"+color.slice(i,i+2))/255); + } + let flyLine = createFlyCurve(points,new THREE.Vector3( colorChange[0], colorChange[1], colorChange[2] ), false); flyLine.userData.type = "toLine"; return flyLine; }, diff --git a/public/static/qm/three.js b/public/static/qm/three.js index 5e36b93..c0362d5 100644 --- a/public/static/qm/three.js +++ b/public/static/qm/three.js @@ -39018,7 +39018,7 @@ var uniforms = { u_time: { value: 0.0 } }; // 着色器设置 -var vertexShader1 = ` +const vertexShader = ` varying vec2 vUv; attribute float percent; uniform float u_time; @@ -39037,7 +39037,7 @@ var vertexShader1 = ` gl_Position = projectionMatrix * mvPosition; } ` -var fragmentShader1 = ` +const fragmentShader = ` #ifdef GL_ES precision mediump float; #endif @@ -39050,10 +39050,10 @@ var fragmentShader1 = ` gl_FragColor = vec4(color,1); } ` -function createFlyCurve(points, closed) { +function createFlyCurve(points, color, closed) { var curve = new THREE.CatmullRomCurve3(points, closed); // 流光的颜色,三个数字分别代表rgb的值,不过注意,需要除以255 - var color = new THREE.Vector3( 0.2235, 0.412, 1 ); + var color = color || new THREE.Vector3( 0.2235, 0.412, 1 ); var flyLine = initFlyLine( curve, { speed: 0.5, color: color, @@ -39093,8 +39093,8 @@ function initFlyLine( curve, matSetting, pointsNumber ) { }; const lineMaterial = new THREE.ShaderMaterial( { uniforms: singleUniforms, - vertexShader: vertexShader1, - fragmentShader: fragmentShader1, + vertexShader: vertexShader, + fragmentShader: fragmentShader, transparent: true } ); return lineMaterial;