| | |
| | | this.centerVectorYC = null |
| | | this.centerVectorZC = null |
| | | this.dashLineList = [] |
| | | this.flip = { x: false, y: false, z: false } |
| | | |
| | | this.planeCtx = { activeShape: null, polygonPositionList: [], centerPoint: null } |
| | | this.axisModelUris = { axisX: 'gltf/green-arrows.gltf', axisY: 'gltf/red-arrows.gltf', axisZ: 'gltf/blue-arrows.gltf' } |
| | |
| | | if (this.dashLineList[1]) { this.dashLineList[1].polyline.positions = g.dashY } else { this.dashLineList[1] = this.entityFactory.drawDashLine(g.dashY, 'dashY') } |
| | | if (this.dashLineList[2]) { this.dashLineList[2].polyline.positions = g.dashZ } else { this.dashLineList[2] = this.entityFactory.drawDashLine(g.dashZ, 'dashZ') } |
| | | |
| | | const qX = this._getAxisOrientation(g.centerPoint, g.centerVectorXC, this.axisLocalBasis.axisX) |
| | | const xDir = this.flip.x ? Cesium.Cartesian3.multiplyByScalar(g.centerVectorXC, -1, new Cesium.Cartesian3()) : g.centerVectorXC |
| | | const qX = this._getAxisOrientation(g.centerPoint, xDir, this.axisLocalBasis.axisX) |
| | | const qY = this._getAxisOrientation(g.centerPoint, g.rotationNormalY, this.axisLocalBasis.axisY) |
| | | const qZ = this._getAxisOrientation(g.centerPoint, g.rotationNormalZ, this.axisLocalBasis.axisZ) |
| | | const zDir = this.flip.z ? Cesium.Cartesian3.multiplyByScalar(g.rotationNormalZ, -1, new Cesium.Cartesian3()) : g.rotationNormalZ |
| | | const qZ = this._getAxisOrientation(g.centerPoint, zDir, this.axisLocalBasis.axisZ) |
| | | this.lastOrientation.axisX = qX |
| | | this.lastOrientation.axisY = qY |
| | | this.lastOrientation.axisZ = qZ |
| | |
| | | } |
| | | const qsX = this._getOrientationWithUp(g.centerPoint, g.refDirX, g.rotationNormalX, this.circleLocalBasis.sphereX) |
| | | const qsY = this._getOrientationWithUp(g.centerPoint, g.refDirY, g.rotationNormalY, this.circleLocalBasis.sphereY) |
| | | const qsZ = this._getOrientationWithUp(g.centerPoint, g.refDirZ, g.rotationNormalZ, this.circleLocalBasis.sphereZ) |
| | | const zUp = this.flip.z ? Cesium.Cartesian3.multiplyByScalar(g.rotationNormalZ, -1, new Cesium.Cartesian3()) : g.rotationNormalZ |
| | | const qsZ = this._getOrientationWithUp(g.centerPoint, g.refDirZ, zUp, this.circleLocalBasis.sphereZ) |
| | | this.lastOrientation.sphereX = qsX |
| | | this.lastOrientation.sphereY = qsY |
| | | this.lastOrientation.sphereZ = qsZ |
| | |
| | | this.applyAxisGeometry(g) |
| | | } |
| | | |
| | | setReversalMode (flag) { |
| | | this.flip.z = !!flag |
| | | this.flip.x = !!flag |
| | | const p = this.planeCtx.polygonPositionList |
| | | if (Array.isArray(p) && p.length >= 4) this.createAxisEntity(p[0], p[1], p[2], p[3]) |
| | | } |
| | | |
| | | /** |
| | | * 生成围绕指定法向的圆轴折线点集合 |
| | | * @param {Cesium.Cartesian3} normalize 单位法向量 |