@anov/3d 0.0.30 → 0.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/anov3d.js +6 -1
- package/dist/anov3d.js.map +1 -1
- package/dist/applicationApi.js +9 -1
- package/dist/applicationApi.js.map +1 -1
- package/dist/factory/3d.d.ts +7 -3
- package/dist/factory/3d.js +43 -32
- package/dist/factory/3d.js.map +1 -1
- package/dist/factory/regionData.js +10 -4
- package/dist/factory/regionData.js.map +1 -1
- package/dist/factory/unit/CameraPoi.d.ts +2 -2
- package/dist/factory/unit/CameraPoi.js +57 -45
- package/dist/factory/unit/CameraPoi.js.map +1 -1
- package/dist/factory/unit/circle.d.ts +1 -0
- package/dist/factory/unit/circle.js +25 -7
- package/dist/factory/unit/circle.js.map +1 -1
- package/dist/factory/unit/cylinder.d.ts +2 -0
- package/dist/factory/unit/cylinder.js +76 -13
- package/dist/factory/unit/cylinder.js.map +1 -1
- package/dist/factory/unit/districtLine.d.ts +11 -0
- package/dist/factory/unit/districtLine.js +73 -0
- package/dist/factory/unit/districtLine.js.map +1 -0
- package/dist/factory/unit/glsl/highway/fragmentShader.js +1 -1
- package/dist/factory/unit/glsl/highway/fragmentShader.js.map +1 -1
- package/dist/factory/unit/handle.js +1 -1
- package/dist/factory/unit/handle.js.map +1 -1
- package/dist/factory/unit/index.d.ts +2 -2
- package/dist/factory/unit/index.js +5 -19
- package/dist/factory/unit/index.js.map +1 -1
- package/dist/factory/unit/inspection/InspectionObject.d.ts +3 -0
- package/dist/factory/unit/inspection/InspectionObject.js +17 -47
- package/dist/factory/unit/inspection/InspectionObject.js.map +1 -1
- package/dist/factory/unit/inspection/index.js +18 -11
- package/dist/factory/unit/inspection/index.js.map +1 -1
- package/dist/factory/unit/poi.js +2 -1
- package/dist/factory/unit/poi.js.map +1 -1
- package/dist/factory/utils/fontMesh.js +2 -1
- package/dist/factory/utils/fontMesh.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BoxGeometry","Color","Group","Mesh","ShaderMaterial","Vector3","globalObjectManage","use","utils","createFontMesh","SceneStyle","regionMap","collisionDetection","lookAtOnYAxis","emitter","cylinderData","label","id","title","reform","belongTo","color","getHex","points","poi","position","height","reduction","crudeOil","catalyticCracking","hydrocrackingUnit","cokingUnit","administrative","CylinderManage","gobal","options","Map","currentCameraPosition","control","object","box","areaBoundingBox","boundingBoxMap","get","currentoperate","iscollision","emit","cameraRemoveListener","scene","option","forEach","item","geometry","material","transparent","depthWrite","depthTest","uniforms","uHeight","value","uColor","vertexShader","fragmentShader","cylinder","group","name","visible","copy","fromArray","interactionManager","storeManagement","add","addEventListener","style","real","cameraUtil","set","target","then","currentGroup","cylinderMesh","cameraAddListener","font","mesh","center","useframe","camera","controlAddListener","cameraListenerHandle","maxDistance","controls","getDistance","removeEventListener"],"sources":["../../../src/factory/unit/cylinder.ts"],"sourcesContent":["import type { InteractionManager, Object3D, Scene } from '@anov/3d-core'\nimport { BoxGeometry, Color, Group, Mesh, ShaderMaterial, Vector3, globalObjectManage, use, utils } from '@anov/3d-core'\nimport createFontMesh from '../utils/fontMesh'\nimport type Factory3D from '../3d'\nimport { SceneStyle } from '../utils/constant'\nimport regionMap from '../regionData'\nimport { collisionDetection } from '../utils/areaBoundingBox'\n\nimport { lookAtOnYAxis } from '../utils'\n\nconst { emitter } = utils\n\nconst cylinderData = [\n {\n label: '8人',\n id: '1',\n title: regionMap.reform.title,\n belongTo: regionMap.reform.id,\n color: new Color('#FED602').getHex(),\n points: regionMap.reform.poi.position,\n height: 80,\n },\n {\n label: '7人',\n id: '2',\n title: regionMap.reduction.title,\n belongTo: regionMap.reduction.id,\n color: new Color('#FED602').getHex(),\n points: regionMap.reduction.poi.position,\n height: 70,\n },\n {\n label: '4人',\n id: '3',\n title: regionMap.crudeOil.title,\n belongTo: regionMap.crudeOil.id,\n color: new Color('#FED602').getHex(),\n points: regionMap.crudeOil.poi.position,\n height: 40,\n },\n {\n label: '10人',\n id: '4',\n title: regionMap.catalyticCracking.title,\n belongTo: regionMap.catalyticCracking.id,\n color: new Color('#FED602').getHex(),\n points: regionMap.catalyticCracking.poi.position,\n height: 100,\n },\n {\n label: '3人',\n id: '5',\n title: regionMap.hydrocrackingUnit.title,\n belongTo: regionMap.hydrocrackingUnit.id,\n color: new Color('#FED602').getHex(),\n points: regionMap.hydrocrackingUnit.poi.position,\n height: 30,\n },\n {\n label: '8人',\n id: '6',\n title: regionMap.cokingUnit.title,\n belongTo: regionMap.cokingUnit.id,\n color: new Color('#FED602').getHex(),\n points: regionMap.cokingUnit.poi.position,\n height: 80,\n },\n {\n label: '20人',\n id: '7',\n title: regionMap.administrative.title,\n belongTo: regionMap.administrative.id,\n color: new Color('#FED602').getHex(),\n points: regionMap.administrative.poi.position,\n height: 150,\n },\n]\n\ntype CylinderManageOption = {\n visible?: boolean\n}\n\nclass CylinderManage {\n private scene: Scene\n readonly cylinderMesh: Map<string, Object3D> = new Map()\n private option: CylinderManageOption\n private gobal: Factory3D\n private currentoperate: string = cylinderData[0].belongTo\n\n constructor(gobal: Factory3D, options?: CylinderManageOption) {\n this.scene = gobal.scene.scene\n this.gobal = gobal\n this.option = options || {}\n }\n\n generateCylinder() {\n cylinderData.forEach((item) => {\n const geometry = new BoxGeometry(10, item.height, 10)\n const material = new ShaderMaterial({\n transparent: true,\n depthWrite: false,\n depthTest: false,\n uniforms: {\n uHeight: {\n value: item.height,\n },\n uColor: {\n value: new Color(item.color),\n },\n },\n vertexShader: `\n uniform float uHeight;\n varying float vOpacity;\n void main() {\n vOpacity = (position.y + uHeight/2.0) / uHeight;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);\n }\n `,\n fragmentShader: `\n uniform vec3 uColor;\n varying float vOpacity;\n void main() {\n gl_FragColor = vec4(uColor,0.3+vOpacity/10.0*7.0);\n }\n `,\n })\n const cylinder = new Mesh(geometry, material)\n const group = new Group()\n group.name = item.title\n\n group.visible = this.option?.visible ?? true\n cylinder.position.copy(new Vector3().fromArray([item.points[0], item.points[1] + item.height / 2, item.points[2]]))\n\n const interactionManager = utils.storeManagement.get<InteractionManager>('interactionManager')\n interactionManager.add(group)\n\n group.addEventListener('click', () => {\n if (this.gobal.style === SceneStyle.real)\n return\n\n if (group.visible === false)\n return\n\n this.gobal.cameraUtil.set({\n position: [item.points[0], item.points[1] + item.height / 2, item.points[2] + 100],\n target: [item.points[0], item.points[1] + item.height / 2, item.points[2]],\n }).then(() => {\n emitter.emit('peoplemanagement-camera-enter', item)\n const currentGroup = this.cylinderMesh.get(item.belongTo) as Group\n currentGroup.visible = false\n\n this.currentoperate = item.belongTo\n this.cameraAddListener()\n })\n })\n this.cylinderMesh.set(item.belongTo, group)\n group.add(cylinder)\n\n const font = createFontMesh(item.label, {\n position: new Vector3().fromArray([item.points[0], item.points[1] + item.height + 10, item.points[2]]),\n })\n\n font.then((mesh) => {\n mesh.geometry.center()\n\n group.add(mesh)\n\n use.useframe(() => {\n lookAtOnYAxis(mesh, globalObjectManage.camera.position)\n })\n this.scene.add(group)\n })\n })\n this.controlAddListener()\n }\n\n private cameraListenerHandle = () => {\n const currentCameraPosition = this.gobal.control.object.position\n const box = this.gobal.areaBoundingBox.boundingBoxMap.get(this.currentoperate)\n const iscollision = collisionDetection(box, currentCameraPosition)\n if (!iscollision) {\n emitter.emit('peoplemanagement-camera-out', {\n belongTo: this.currentoperate,\n })\n\n this.cameraRemoveListener()\n }\n }\n\n private cameraAddListener() {\n this.gobal.control.addEventListener('change', this.cameraListenerHandle)\n }\n\n private controlAddListener() {\n const maxDistance = this.gobal.option.controls.maxDistance\n maxDistance && this.gobal.control.addEventListener('change', () => {\n if (this.gobal.control.getDistance() >= maxDistance - 5)\n emitter.emit('peoplemanagement-control-maxDistance', null)\n })\n }\n\n private cameraRemoveListener() {\n this.gobal.control.removeEventListener('change', this.cameraListenerHandle)\n }\n}\n\nexport default CylinderManage"],"mappings":";;;;;;;AACA,SAASA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AC,UAACK,IAAI,EAAK;UAClBA,IAAI,CAAC/B,QAAQ,CAACgC,MAAM,EAAE;UAEtBpB,KAAK,CAACO,GAAG,CAACY,IAAI,CAAC;UAEf5E,GAAG,CAAC8E,QAAQ,CAAC,YAAM;YACjBxE,aAAa,CAACsE,IAAI,EAAE7E,kBAAkB,CAACgF,MAAM,CAAC7D,QAAQ,CAAC;UACzD,CAAC,CAAC;UACF,MAAI,CAACuB,KAAK,CAACuB,GAAG,CAACP,KAAK,CAAC;QACvB,CAAC,CAAC;MACJ,CAAC,CAAC;MACF,IAAI,CAACuB,kBAAkB,EAAE;IAC3B;EAAC;IAAA;IAAA,OAeD,6BAA4B;MAC1B,IAAI,CAACrD,KAAK,CAACI,OAAO,CAACkC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAACgB,oBAAoB,CAAC;IAC1E;EAAC;IAAA;IAAA,OAED,8BAA6B;MAAA;MAC3B,IAAMC,WAAW,GAAG,IAAI,CAACvD,KAAK,CAACe,MAAM,CAACyC,QAAQ,CAACD,WAAW;MAC1DA,WAAW,IAAI,IAAI,CAACvD,KAAK,CAACI,OAAO,CAACkC,gBAAgB,CAAC,QAAQ,EAAE,YAAM;QACjE,IAAI,MAAI,CAACtC,KAAK,CAACI,OAAO,CAACqD,WAAW,EAAE,IAAIF,WAAW,GAAG,CAAC,EACrD3E,OAAO,CAACgC,IAAI,CAAC,sCAAsC,EAAE,IAAI,CAAC;MAC9D,CAAC,CAAC;IACJ;EAAC;IAAA;IAAA,OAED,gCAA+B;MAC7B,IAAI,CAACZ,KAAK,CAACI,OAAO,CAACsD,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAACJ,oBAAoB,CAAC;IAC7E;EAAC;EAAA;AAAA;AAGH,eAAevD,cAAc"}
|
|
1
|
+
{"version":3,"names":["BoxGeometry","Color","Float32BufferAttribute","Group","Mesh","MeshBasicMaterial","Vector3","globalObjectManage","use","utils","createFontMesh","SceneStyle","regionMap","collisionDetection","lookAtOnYAxis","emitter","cylinderData","label","id","title","reform","belongTo","area","color","getHex","points","poi","position","height","reduction","crudeOil","catalyticCracking","hydrocrackingUnit","cokingUnit","administrative","CylinderManage","gobal","options","Map","currentCameraPosition","control","object","box","areaBoundingBox","boundingBoxMap","get","currentoperate","iscollision","emit","cameraRemoveListener","scene","option","forEach","item","cylinder","getMesh","group","name","visible","copy","fromArray","interactionManager","storeManagement","add","addEventListener","style","real","cameraUtil","set","target","then","currentGroup","cylinderMesh","cameraAddListener","font","mesh","geometry","center","useframe","camera","controlAddListener","data","width","gradientMaterial","vertexColors","transparent","attributes","colors","i","count","vertex","fromBufferAttribute","gradientX","x","gradientY","y","setHex","lerp","push","r","g","b","setAttribute","rotateY","Math","PI","cameraListenerHandle","maxDistance","controls","getDistance","removeEventListener"],"sources":["../../../src/factory/unit/cylinder.ts"],"sourcesContent":["import type { InteractionManager, Object3D, Scene } from '@anov/3d-core'\nimport { BoxGeometry, Color, Float32BufferAttribute, Group, Mesh, MeshBasicMaterial, ShaderMaterial, Vector3, globalObjectManage, use, utils } from '@anov/3d-core'\nimport createFontMesh from '../utils/fontMesh'\nimport type Factory3D from '../3d'\nimport { SceneStyle } from '../utils/constant'\nimport regionMap from '../regionData'\nimport { collisionDetection } from '../utils/areaBoundingBox'\n\nimport { lookAtOnYAxis } from '../utils'\n\nconst { emitter } = utils\n\nconst cylinderData = [\n {\n label: '8人',\n id: '1',\n title: regionMap.reform.title,\n belongTo: regionMap.reform.id,\n area: regionMap.reform.area,\n color: new Color('#FED602').getHex(),\n points: regionMap.reform.poi.position,\n height: 80,\n },\n {\n label: '7人',\n id: '2',\n title: regionMap.reduction.title,\n belongTo: regionMap.reduction.id,\n area: regionMap.reduction.area,\n color: new Color('#FED602').getHex(),\n points: regionMap.reduction.poi.position,\n height: 70,\n },\n {\n label: '4人',\n id: '3',\n title: regionMap.crudeOil.title,\n belongTo: regionMap.crudeOil.id,\n area: regionMap.crudeOil.area,\n color: new Color('#FED602').getHex(),\n points: regionMap.crudeOil.poi.position,\n height: 40,\n },\n {\n label: '10人',\n id: '4',\n title: regionMap.catalyticCracking.title,\n belongTo: regionMap.catalyticCracking.id,\n area: regionMap.catalyticCracking.area,\n color: new Color('#FED602').getHex(),\n points: regionMap.catalyticCracking.poi.position,\n height: 100,\n },\n {\n label: '3人',\n id: '5',\n title: regionMap.hydrocrackingUnit.title,\n belongTo: regionMap.hydrocrackingUnit.id,\n area: regionMap.hydrocrackingUnit.area,\n color: new Color('#FED602').getHex(),\n points: regionMap.hydrocrackingUnit.poi.position,\n height: 30,\n },\n {\n label: '8人',\n id: '6',\n title: regionMap.cokingUnit.title,\n belongTo: regionMap.cokingUnit.id,\n area: regionMap.cokingUnit.area,\n color: new Color('#FED602').getHex(),\n points: regionMap.cokingUnit.poi.position,\n height: 80,\n },\n {\n label: '20人',\n id: '7',\n title: regionMap.administrative.title,\n belongTo: regionMap.administrative.id,\n area: regionMap.administrative.area,\n color: new Color('#FED602').getHex(),\n points: regionMap.administrative.poi.position,\n height: 150,\n },\n]\n\ntype CylinderManageOption = {\n visible?: boolean\n}\n\nclass CylinderManage {\n private scene: Scene\n readonly cylinderMesh: Map<string, Object3D> = new Map()\n private option: CylinderManageOption\n private gobal: Factory3D\n private currentoperate: string = cylinderData[0].belongTo\n\n constructor(gobal: Factory3D, options?: CylinderManageOption) {\n this.scene = gobal.scene.scene\n this.gobal = gobal\n this.option = options || {}\n }\n\n generateCylinder() {\n cylinderData.forEach((item) => {\n /* const geometry = new BoxGeometry(10, item.height, 10)\n const material = new ShaderMaterial({\n transparent: true,\n depthWrite: false,\n depthTest: false,\n uniforms: {\n uHeight: {\n value: item.height,\n },\n uColor: {\n value: new Color(item.color),\n },\n },\n vertexShader: `\n uniform float uHeight;\n varying float vOpacity;\n void main() {\n vOpacity = (position.y + uHeight/2.0) / uHeight;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position,1.0);\n }\n `,\n fragmentShader: `\n uniform vec3 uColor;\n varying float vOpacity;\n void main() {\n gl_FragColor = vec4(uColor,0.3+vOpacity/10.0*7.0);\n }\n `,\n })\n const cylinder = new Mesh(geometry, material) */\n const cylinder = this.getMesh(item)\n const group = new Group()\n group.name = item.title\n\n group.visible = this.option?.visible ?? true\n cylinder.position.copy(new Vector3().fromArray([item.points[0], item.points[1] + item.height / 2, item.points[2]]))\n\n const interactionManager = utils.storeManagement.get<InteractionManager>('interactionManager')\n interactionManager.add(group)\n\n group.addEventListener('click', () => {\n if (this.gobal.style === SceneStyle.real || group.visible === false)\n return\n\n this.gobal.cameraUtil.set({\n position: [item.points[0], item.points[1] + item.height / 2 + 100, item.points[2] + 100],\n target: [item.points[0], item.points[1] + item.height / 2, item.points[2]],\n }).then(() => {\n emitter.emit('peoplemanagement-camera-enter', item)\n const currentGroup = this.cylinderMesh.get(item.belongTo) as Group\n currentGroup.visible = false\n\n this.currentoperate = item.belongTo\n this.cameraAddListener()\n })\n /* this.gobal.cameraUtil.focus({ target: item.area, pitch: 0 }).then(() => {\n emitter.emit('peoplemanagement-camera-enter', item)\n const currentGroup = this.cylinderMesh.get(item.belongTo) as Group\n currentGroup.visible = false\n\n this.currentoperate = item.belongTo\n this.cameraAddListener()\n }) */\n })\n this.cylinderMesh.set(item.belongTo, group)\n group.add(cylinder)\n\n const font = createFontMesh(item.label, {\n position: new Vector3().fromArray([item.points[0], item.points[1] + item.height + 10, item.points[2]]),\n })\n\n font.then((mesh) => {\n mesh.geometry.center()\n\n group.add(mesh)\n\n use.useframe(() => {\n lookAtOnYAxis(mesh, globalObjectManage.camera.position)\n })\n this.scene.add(group)\n })\n })\n this.controlAddListener()\n }\n\n getMesh(data) {\n const width = 10\n // 创建渐变材质\n const gradientMaterial = new MeshBasicMaterial({\n vertexColors: true, // 启用顶点颜色插值\n transparent: true,\n // blending: AdditiveBlending,\n })\n // 创建渐变立方体的顶点颜色数组\n const geometry = new BoxGeometry(width, data.height, width)\n const position = geometry.attributes.position\n const colors = []\n for (let i = 0; i < position.count; i++) {\n const vertex = new Vector3()\n vertex.fromBufferAttribute(position, i)\n // 计算顶点的浅橘色到白色渐变值\n const gradientX = (vertex.x + width / 2) / width // 从0到1的梯度\n const gradientY = (vertex.y + data.height / 2) / data.height // 从0到1的梯度\n // 计算渐变色\n const color = new Color().setHex(0xD5A86F) // 初始颜色为浅橘色\n color.lerp(new Color(1, 1, 0.9), gradientX * gradientY) // 从浅橘色渐变到白色\n // 添加顶点颜色\n colors.push(color.r, color.g, color.b) // 添加渐变色\n }\n geometry.setAttribute('color', new Float32BufferAttribute(colors, 3))\n\n // 创建渐变立方体\n const cylinder = new Mesh(geometry, gradientMaterial)\n cylinder.rotateY(Math.PI / 2)\n return cylinder\n }\n\n private cameraListenerHandle = () => {\n const currentCameraPosition = this.gobal.control.object.position\n const box = this.gobal.areaBoundingBox.boundingBoxMap.get(this.currentoperate)\n const iscollision = collisionDetection(box, currentCameraPosition)\n if (!iscollision) {\n emitter.emit('peoplemanagement-camera-out', {\n belongTo: this.currentoperate,\n })\n\n this.cameraRemoveListener()\n }\n }\n\n private cameraAddListener() {\n this.gobal.control.addEventListener('change', this.cameraListenerHandle)\n }\n\n private controlAddListener() {\n const maxDistance = this.gobal.option.controls.maxDistance\n maxDistance && this.gobal.control.addEventListener('change', () => {\n if (this.gobal.control.getDistance() >= maxDistance - 5)\n emitter.emit('peoplemanagement-control-maxDistance', null)\n })\n }\n\n private cameraRemoveListener() {\n this.gobal.control.removeEventListener('change', this.cameraListenerHandle)\n }\n}\n\nexport default CylinderManage"],"mappings":";;;;;;;AACA,SAASA,WAAW,EAAEC,KAAK,EAAEC,sBAAsB,EAAEC,KAAK,EAAEC,IAAI,EAAEC,iBAAiB,EAAkBC,OAAO,EAAEC,kBAAkB,EAAEC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AACnK,OAAOC,cAAc;AAErB,SAASC,UAAU;AACnB,OAAOC,SAAS;AAChB,SAASC,kBAAkB;AAE3B,SAASC,aAAa;AAEtB,IAAQC,OAAO,GAAKN,KAAK,CAAjB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';
|
|
3
|
+
declare class DistrictLineManage {
|
|
4
|
+
private gobal;
|
|
5
|
+
private scene;
|
|
6
|
+
readonly lineMesh: Map<string, Object3D>;
|
|
7
|
+
constructor(gobal: Factory3D);
|
|
8
|
+
generateLine(): void;
|
|
9
|
+
remove(): void;
|
|
10
|
+
}
|
|
11
|
+
export default DistrictLineManage;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
+
import { Mesh, MeshBasicMaterial, TubeGeometry, Vector3 } from '@anov/3d-core';
|
|
12
|
+
import { RoundLineGeometry } from '@anov/3d-ability';
|
|
13
|
+
import { regionMap } from "../regionData";
|
|
14
|
+
var DistrictLineManage = /*#__PURE__*/function () {
|
|
15
|
+
function DistrictLineManage(gobal) {
|
|
16
|
+
_classCallCheck(this, DistrictLineManage);
|
|
17
|
+
_defineProperty(this, "gobal", void 0);
|
|
18
|
+
_defineProperty(this, "scene", void 0);
|
|
19
|
+
_defineProperty(this, "lineMesh", new Map());
|
|
20
|
+
this.gobal = gobal;
|
|
21
|
+
this.scene = gobal.scene.scene;
|
|
22
|
+
}
|
|
23
|
+
_createClass(DistrictLineManage, [{
|
|
24
|
+
key: "generateLine",
|
|
25
|
+
value: function generateLine() {
|
|
26
|
+
var _this = this;
|
|
27
|
+
Object.keys(regionMap).forEach( /*#__PURE__*/function () {
|
|
28
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(key) {
|
|
29
|
+
var region, groundLinePoints, groundLine, geometry, material, mesh;
|
|
30
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
31
|
+
while (1) switch (_context.prev = _context.next) {
|
|
32
|
+
case 0:
|
|
33
|
+
// 摄像机
|
|
34
|
+
region = regionMap[key];
|
|
35
|
+
groundLinePoints = region.area.map(function (v) {
|
|
36
|
+
return new Vector3(v[0], v[1], v[2]);
|
|
37
|
+
});
|
|
38
|
+
groundLine = new RoundLineGeometry(groundLinePoints, {
|
|
39
|
+
radius: 5,
|
|
40
|
+
close: true
|
|
41
|
+
});
|
|
42
|
+
geometry = new TubeGeometry(groundLine.curve, 10000, 1, 2, false);
|
|
43
|
+
material = new MeshBasicMaterial({
|
|
44
|
+
color: '#eff0f0'
|
|
45
|
+
});
|
|
46
|
+
mesh = new Mesh(geometry, material);
|
|
47
|
+
_this.scene.add(mesh);
|
|
48
|
+
_this.lineMesh.set(region.id, mesh);
|
|
49
|
+
case 8:
|
|
50
|
+
case "end":
|
|
51
|
+
return _context.stop();
|
|
52
|
+
}
|
|
53
|
+
}, _callee);
|
|
54
|
+
}));
|
|
55
|
+
return function (_x) {
|
|
56
|
+
return _ref.apply(this, arguments);
|
|
57
|
+
};
|
|
58
|
+
}());
|
|
59
|
+
}
|
|
60
|
+
}, {
|
|
61
|
+
key: "remove",
|
|
62
|
+
value: function remove() {
|
|
63
|
+
this.lineMesh.forEach(function (mesh) {
|
|
64
|
+
mesh.removeFromParent();
|
|
65
|
+
mesh.remove();
|
|
66
|
+
});
|
|
67
|
+
this.lineMesh.clear();
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
return DistrictLineManage;
|
|
71
|
+
}();
|
|
72
|
+
export default DistrictLineManage;
|
|
73
|
+
//# sourceMappingURL=districtLine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Mesh","MeshBasicMaterial","TubeGeometry","Vector3","RoundLineGeometry","regionMap","DistrictLineManage","gobal","Map","scene","Object","keys","forEach","key","region","groundLinePoints","area","map","v","groundLine","radius","close","geometry","curve","material","color","mesh","add","lineMesh","set","id","removeFromParent","remove","clear"],"sources":["../../../src/factory/unit/districtLine.ts"],"sourcesContent":["import { Mesh, MeshBasicMaterial, TubeGeometry, Vector3 } from '@anov/3d-core'\nimport type { Object3D, Scene } from '@anov/3d-core'\nimport { RoundLineGeometry } from '@anov/3d-ability'\nimport type Factory3D from '../3d'\nimport { regionMap } from '../regionData'\n\nclass DistrictLineManage {\n private gobal: Factory3D\n private scene: Scene\n readonly lineMesh: Map<string, Object3D> = new Map()\n\n constructor(gobal: Factory3D) {\n this.gobal = gobal\n this.scene = gobal.scene.scene\n }\n\n generateLine() {\n Object.keys(regionMap).forEach(async (key: string) => {\n // 摄像机\n const region = regionMap[key]\n const groundLinePoints = region.area.map(v => new Vector3(v[0], v[1], v[2]))\n\n const groundLine = new RoundLineGeometry(groundLinePoints, {\n radius: 5,\n close: true,\n })\n\n const geometry = new TubeGeometry(groundLine.curve, 10000, 1, 2, false)\n const material = new MeshBasicMaterial({ color: '#eff0f0' })\n const mesh = new Mesh(geometry, material)\n this.scene.add(mesh)\n this.lineMesh.set(region.id, mesh)\n })\n }\n\n remove() {\n this.lineMesh.forEach((mesh) => {\n mesh.removeFromParent()\n mesh.remove()\n })\n this.lineMesh.clear()\n }\n}\n\nexport default DistrictLineManage"],"mappings":";+CACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADA,SAASA,IAAI,EAAEC,iBAAiB,EAAEC,YAAY,EAAEC,OAAO,QAAQ,eAAe;AAE9E,SAASC,iBAAiB,QAAQ,kBAAkB;AAEpD,SAASC,SAAS;AAAuB,IAEnCC,kBAAkB;EAKtB,4BAAYC,KAAgB,EAAE;IAAA;IAAA;IAAA;IAAA,kCAFa,IAAIC,GAAG,EAAE;IAGlD,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACE,KAAK,GAAGF,KAAK,CAACE,KAAK,CAACA,KAAK;EAChC;EAAC;IAAA;IAAA,OAED,wBAAe;MAAA;MACbC,MAAM,CAACC,IAAI,CAACN,SAAS,CAAC,CAACO,OAAO;QAAA,sEAAC,iBAAOC,GAAW;UAAA;UAAA;YAAA;cAAA;gBAC/C;gBACMC,MAAM,GAAGT,SAAS,CAACQ,GAAG,CAAC;gBACvBE,gBAAgB,GAAGD,MAAM,CAACE,IAAI,CAACC,GAAG,CAAC,UAAAC,CAAC;kBAAA,OAAI,IAAIf,OAAO,CAACe,CAAC,CAAC,CAAC,CAAC,EAAEA,CAAC,CAAC,CAAC,CAAC,EAAEA,CAAC,CAAC,CAAC,CAAC,CAAC;gBAAA,EAAC;gBAEtEC,UAAU,GAAG,IAAIf,iBAAiB,CAACW,gBAAgB,EAAE;kBACzDK,MAAM,EAAE,CAAC;kBACTC,KAAK,EAAE;gBACT,CAAC,CAAC;gBAEIC,QAAQ,GAAG,IAAIpB,YAAY,CAACiB,UAAU,CAACI,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC;gBACjEC,QAAQ,GAAG,IAAIvB,iBAAiB,CAAC;kBAAEwB,KAAK,EAAE;gBAAU,CAAC,CAAC;gBACtDC,IAAI,GAAG,IAAI1B,IAAI,CAACsB,QAAQ,EAAEE,QAAQ,CAAC;gBACzC,KAAI,CAACf,KAAK,CAACkB,GAAG,CAACD,IAAI,CAAC;gBACpB,KAAI,CAACE,QAAQ,CAACC,GAAG,CAACf,MAAM,CAACgB,EAAE,EAAEJ,IAAI,CAAC;cAAA;cAAA;gBAAA;YAAA;UAAA;QAAA,CACnC;QAAA;UAAA;QAAA;MAAA,IAAC;IACJ;EAAC;IAAA;IAAA,OAED,kBAAS;MACP,IAAI,CAACE,QAAQ,CAAChB,OAAO,CAAC,UAACc,IAAI,EAAK;QAC9BA,IAAI,CAACK,gBAAgB,EAAE;QACvBL,IAAI,CAACM,MAAM,EAAE;MACf,CAAC,CAAC;MACF,IAAI,CAACJ,QAAQ,CAACK,KAAK,EAAE;IACvB;EAAC;EAAA;AAAA;AAGH,eAAe3B,kBAAkB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ShaderChunk } from '@anov/3d-core';
|
|
2
|
-
var fragmentShader = /* glsl */"\n".concat(ShaderChunk.logdepthbuf_pars_fragment, "\nuniform float alpha;\nvarying vec2 vUv;\n\nvoid main() {\n float centerLineWidth = 0.05; \n float sideLineWidth = 0.1; \n\n vec2 adjustedUv = vec2(vUv.x, vUv.y - 0.25);\n\n float centerLine = smoothstep(centerLineWidth * 0.5, centerLineWidth * 0.6, abs(adjustedUv.y)); \n float leftLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, adjustedUv.x); \n float rightLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, 1.0 - adjustedUv.x);\n\n float line = max(max(centerLine, leftLine), rightLine); \n
|
|
2
|
+
var fragmentShader = /* glsl */"\n".concat(ShaderChunk.logdepthbuf_pars_fragment, "\nuniform float alpha;\nuniform vec3 centerColor;\nuniform vec3 sideColor;\nuniform vec3 otherColor;\nvarying vec2 vUv;\n\nvoid main() {\n float centerLineWidth = 0.05; \n float sideLineWidth = 0.1; \n\n vec2 adjustedUv = vec2(vUv.x, vUv.y - 0.25);\n\n float centerLine = smoothstep(centerLineWidth * 0.5, centerLineWidth * 0.6, abs(adjustedUv.y)); \n float leftLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, adjustedUv.x); \n float rightLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, 1.0 - adjustedUv.x);\n\n float line = max(max(centerLine, leftLine), rightLine); \n vec3 finalColor;\n\n if (abs(adjustedUv.y) < centerLineWidth * 0.5) {\n gl_FragColor = vec4(vec3(1.0, 1.0, 1.0), .5); \n }else if(abs(adjustedUv.y+0.25)>0.0 && abs(adjustedUv.y+0.25)<0.05){\n gl_FragColor = vec4(sideColor, .5); \n }else if(abs(adjustedUv.y-0.25)>0.0 && abs(adjustedUv.y-0.25)<0.05){\n gl_FragColor = vec4(sideColor, .5); \n }\n else{\n gl_FragColor = vec4(otherColor, 0.2);\n }\n ; \n\n ").concat(ShaderChunk.logdepthbuf_fragment, "\n}\n");
|
|
3
3
|
export default fragmentShader;
|
|
4
4
|
//# sourceMappingURL=fragmentShader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ShaderChunk","fragmentShader","logdepthbuf_pars_fragment","logdepthbuf_fragment"],"sources":["../../../../../src/factory/unit/glsl/highway/fragmentShader.ts"],"sourcesContent":["import { ShaderChunk } from '@anov/3d-core'\n\nconst fragmentShader = /* glsl */ `\n${ShaderChunk.logdepthbuf_pars_fragment}\nuniform float alpha;\nvarying vec2 vUv;\n\nvoid main() {\n float centerLineWidth = 0.05; \n float sideLineWidth = 0.1; \n\n vec2 adjustedUv = vec2(vUv.x, vUv.y - 0.25);\n\n float centerLine = smoothstep(centerLineWidth * 0.5, centerLineWidth * 0.6, abs(adjustedUv.y)); \n float leftLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, adjustedUv.x); \n float rightLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, 1.0 - adjustedUv.x);\n\n float line = max(max(centerLine, leftLine), rightLine); \n
|
|
1
|
+
{"version":3,"names":["ShaderChunk","fragmentShader","logdepthbuf_pars_fragment","logdepthbuf_fragment"],"sources":["../../../../../src/factory/unit/glsl/highway/fragmentShader.ts"],"sourcesContent":["import { ShaderChunk } from '@anov/3d-core'\n\nconst fragmentShader = /* glsl */ `\n${ShaderChunk.logdepthbuf_pars_fragment}\nuniform float alpha;\nuniform vec3 centerColor;\nuniform vec3 sideColor;\nuniform vec3 otherColor;\nvarying vec2 vUv;\n\nvoid main() {\n float centerLineWidth = 0.05; \n float sideLineWidth = 0.1; \n\n vec2 adjustedUv = vec2(vUv.x, vUv.y - 0.25);\n\n float centerLine = smoothstep(centerLineWidth * 0.5, centerLineWidth * 0.6, abs(adjustedUv.y)); \n float leftLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, adjustedUv.x); \n float rightLine = smoothstep(sideLineWidth * 0.5, sideLineWidth * 0.6, 1.0 - adjustedUv.x);\n\n float line = max(max(centerLine, leftLine), rightLine); \n vec3 finalColor;\n\n if (abs(adjustedUv.y) < centerLineWidth * 0.5) {\n gl_FragColor = vec4(vec3(1.0, 1.0, 1.0), .5); \n }else if(abs(adjustedUv.y+0.25)>0.0 && abs(adjustedUv.y+0.25)<0.05){\n gl_FragColor = vec4(sideColor, .5); \n }else if(abs(adjustedUv.y-0.25)>0.0 && abs(adjustedUv.y-0.25)<0.05){\n gl_FragColor = vec4(sideColor, .5); \n }\n else{\n gl_FragColor = vec4(otherColor, 0.2);\n }\n ; \n\n ${ShaderChunk.logdepthbuf_fragment}\n}\n`\n\nexport default fragmentShader"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAE3C,IAAMC,cAAc,GAAG,sBACrBD,WAAW,CAACE,yBAAyB,gkCAgCjCF,WAAW,CAACG,oBAAoB,UAErC;AAED,eAAeF,cAAc"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["map","HF","HPU","LLCV","CMP1","CMP2","invertMap","HandlerManage","app","params","click","id","title","
|
|
1
|
+
{"version":3,"names":["map","HF","HPU","LLCV","CMP1","CMP2","invertMap","HandlerManage","app","params","click","id","title","caseInstance","cameraPoi","closeHotmap","name","object","sceneControl","scene","getObjectByName","console","log","dispatchEvent","type","target","inspection","goToInspectionTarget","inspectionObject","stop","contineMove"],"sources":["../../../src/factory/unit/handle.ts"],"sourcesContent":["import { regionMap } from '../regionData'\nimport type Anov3D from '../../sdkEntry'\nimport type { BaseModule } from '../../utils/abstract'\n\nexport const map = {\n HF: 0.04,\n HPU: 0.15,\n LLCV: 0.24,\n CMP1: 0.40,\n CMP2: 0.68,\n}\n\nexport const invertMap = {\n 0.04: 'HF',\n 0.15: 'HPU',\n 0.24: 'LLCV',\n 0.40: 'CMP1',\n 0.68: 'CMP2',\n}\n\nclass HandlerManage implements BaseModule {\n app: Anov3D\n constructor(app: Anov3D) {\n this.app = app\n }\n\n clickPerson(params: any) {\n this.click(params.id)\n }\n\n clickBar(params: any) {\n this.click(params.title)\n }\n\n clickCamera(params: any) {\n this.click(params.id)\n }\n\n clickGasCancel() {\n // @ts-ignore\n this.app.caseInstance.cameraPoi.closeHotmap()\n }\n\n click(name) {\n // 根据名称动态获取Mesh对象\n const object = this.app.sceneControl.scene!.getObjectByName(name)\n\n // 触发事件\n if (object) {\n console.log('Mesh对象已找到!')\n // 手动调用Mesh对象上的点击事件处理函数\n object.dispatchEvent({ type: 'click' })\n }\n else {\n console.log('未找到Mesh对象!')\n }\n }\n\n setInspectTarget(params: { target: string }) {\n const { target } = params\n\n // @ts-ignore\n return this.app.caseInstance.inspection.goToInspectionTarget(map[target])\n }\n\n stopInspect() {\n // @ts-ignore\n this.app.caseInstance.inspection.inspectionObject.stop()\n }\n\n continueInspect() {\n // @ts-ignore\n this.app.caseInstance.inspection.inspectionObject.contineMove()\n }\n}\n\nexport default HandlerManage\n"],"mappings":";;;;;;;AAIA,OAAO,IAAMA,GAAG,GAAG;EACjBC,EAAE,EAAE,IAAI;EACRC,GAAG,EAAE,IAAI;EACTC,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE,IAAI;EACVC,IAAI,EAAE;AACR,CAAC;AAED,OAAO,IAAMC,SAAS,GAAG;EACvB,IAAI,EAAE,IAAI;EACV,IAAI,EAAE,KAAK;EACX,IAAI,EAAE,MAAM;EACZ,IAAI,EAAE,MAAM;EACZ,IAAI,EAAE;AACR,CAAC;AAAA,IAEKC,aAAa;EAEjB,uBAAYC,GAAW,EAAE;IAAA;IAAA;IACvB,IAAI,CAACA,GAAG,GAAGA,GAAG;EAChB;EAAC;IAAA;IAAA,OAED,qBAAYC,MAAW,EAAE;MACvB,IAAI,CAACC,KAAK,CAACD,MAAM,CAACE,EAAE,CAAC;IACvB;EAAC;IAAA;IAAA,OAED,kBAASF,MAAW,EAAE;MACpB,IAAI,CAACC,KAAK,CAACD,MAAM,CAACG,KAAK,CAAC;IAC1B;EAAC;IAAA;IAAA,OAED,qBAAYH,MAAW,EAAE;MACvB,IAAI,CAACC,KAAK,CAACD,MAAM,CAACE,EAAE,CAAC;IACvB;EAAC;IAAA;IAAA,OAED,0BAAiB;MACf;MACA,IAAI,CAACH,GAAG,CAACK,YAAY,CAACC,SAAS,CAACC,WAAW,EAAE;IAC/C;EAAC;IAAA;IAAA,OAED,eAAMC,IAAI,EAAE;MACV;MACA,IAAMC,MAAM,GAAG,IAAI,CAACT,GAAG,CAACU,YAAY,CAACC,KAAK,CAAEC,eAAe,CAACJ,IAAI,CAAC;;MAEjE;MACA,IAAIC,MAAM,EAAE;QACVI,OAAO,CAACC,GAAG,CAAC,YAAY,CAAC;QACzB;QACAL,MAAM,CAACM,aAAa,CAAC;UAAEC,IAAI,EAAE;QAAQ,CAAC,CAAC;MACzC,CAAC,MACI;QACHH,OAAO,CAACC,GAAG,CAAC,YAAY,CAAC;MAC3B;IACF;EAAC;IAAA;IAAA,OAED,0BAAiBb,MAA0B,EAAE;MAC3C,IAAQgB,MAAM,GAAKhB,MAAM,CAAjBgB,MAAM;;MAEd;MACA,OAAO,IAAI,CAACjB,GAAG,CAACK,YAAY,CAACa,UAAU,CAACC,oBAAoB,CAAC3B,GAAG,CAACyB,MAAM,CAAC,CAAC;IAC3E;EAAC;IAAA;IAAA,OAED,uBAAc;MACZ;MACA,IAAI,CAACjB,GAAG,CAACK,YAAY,CAACa,UAAU,CAACE,gBAAgB,CAACC,IAAI,EAAE;IAC1D;EAAC;IAAA;IAAA,OAED,2BAAkB;MAChB;MACA,IAAI,CAACrB,GAAG,CAACK,YAAY,CAACa,UAAU,CAACE,gBAAgB,CAACE,WAAW,EAAE;IACjE;EAAC;EAAA;AAAA;AAGH,eAAevB,aAAa"}
|
|
@@ -16,6 +16,7 @@ import CircleManage from "./circle";
|
|
|
16
16
|
import AreaBoundingBoxManage from "./areaBoundingBox";
|
|
17
17
|
import Inspection from "./inspection";
|
|
18
18
|
import CameraPoi from "./CameraPoi";
|
|
19
|
+
import DistrictLineManage from "./districtLine";
|
|
19
20
|
var emitter = utils.emitter;
|
|
20
21
|
|
|
21
22
|
// 临时优化
|
|
@@ -33,11 +34,13 @@ var showPeopleManagemen = function showPeopleManagemen() {
|
|
|
33
34
|
this.cylinder.cylinderMesh.forEach(function (mesh) {
|
|
34
35
|
mesh.visible = true;
|
|
35
36
|
});
|
|
37
|
+
this.districtLine.generateLine();
|
|
36
38
|
};
|
|
37
39
|
var closePeopleManagemen = function closePeopleManagemen() {
|
|
38
40
|
this.cylinder.cylinderMesh.forEach(function (mesh) {
|
|
39
41
|
mesh.visible = false;
|
|
40
42
|
});
|
|
43
|
+
this.districtLine.remove();
|
|
41
44
|
this.circle.remove();
|
|
42
45
|
};
|
|
43
46
|
var showSmartInspection = function showSmartInspection() {
|
|
@@ -81,37 +84,18 @@ var toggleSecurityOperation = function toggleSecurityOperation() {
|
|
|
81
84
|
export var toggleTag = (_toggleTag = {}, _defineProperty(_toggleTag, SceneTag.overview, function () {
|
|
82
85
|
this.tag = SceneTag.overview;
|
|
83
86
|
this.toggleSceneStyle(SceneStyle.real);
|
|
84
|
-
// this.cameraUtil.set({
|
|
85
|
-
// position: [0, 200, 400],
|
|
86
|
-
// target: [0, 0, 0],
|
|
87
|
-
// })
|
|
88
|
-
|
|
89
87
|
toggleOverview.apply(this);
|
|
90
88
|
}), _defineProperty(_toggleTag, SceneTag['people-management'], function () {
|
|
91
89
|
this.tag = SceneTag['people-management'];
|
|
92
90
|
this.toggleSceneStyle(SceneStyle.tech);
|
|
93
|
-
// this.cameraUtil.set({
|
|
94
|
-
// position: [150, 300, 400],
|
|
95
|
-
// target: [0, 0, 0],
|
|
96
|
-
// })
|
|
97
|
-
|
|
98
91
|
togglePeopleManagemen.apply(this);
|
|
99
92
|
}), _defineProperty(_toggleTag, SceneTag['smart-inspection'], function () {
|
|
100
93
|
this.tag = SceneTag['smart-inspection'];
|
|
101
94
|
this.toggleSceneStyle(SceneStyle.real);
|
|
102
|
-
this.cameraUtil.set({
|
|
103
|
-
position: [0, 200, 400],
|
|
104
|
-
target: [0, 0, 0]
|
|
105
|
-
});
|
|
106
95
|
toggleSmartInspection.apply(this);
|
|
107
96
|
}), _defineProperty(_toggleTag, SceneTag['security-operation'], function () {
|
|
108
97
|
this.tag = SceneTag['security-operation'];
|
|
109
98
|
this.toggleSceneStyle(SceneStyle.real);
|
|
110
|
-
// this.cameraUtil.set({
|
|
111
|
-
// position: [350.99, 39.07, 194.30],
|
|
112
|
-
// target: [401.89, -52.54, 3.04],
|
|
113
|
-
// duration: 2,
|
|
114
|
-
// })
|
|
115
99
|
toggleSecurityOperation.apply(this);
|
|
116
100
|
}), _toggleTag);
|
|
117
101
|
var handleUnit = function handleUnit() {
|
|
@@ -138,6 +122,8 @@ var handleUnit = function handleUnit() {
|
|
|
138
122
|
// people
|
|
139
123
|
var circle = new CircleManage(this);
|
|
140
124
|
this.circle = circle;
|
|
125
|
+
var districtLine = new DistrictLineManage(this);
|
|
126
|
+
this.districtLine = districtLine;
|
|
141
127
|
emitter.on('peoplemanagement-camera-enter', function (data) {
|
|
142
128
|
sendToMessage(MessageType.Event, 'onClick', EMessageStatus.Success, undefined, _objectSpread({
|
|
143
129
|
type: 'Bar'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["utils","SceneStyle","SceneTag","MessageType","sendToMessage","EMessageStatus","WallManage","CylinderManage","PoiManage","CircleManage","AreaBoundingBoxManage","Inspection","CameraPoi","emitter","showOverview","poi","generatePoi","closeOverview","wall","wallMesh","forEach","mesh","visible","remove","showPeopleManagemen","cylinder","cylinderMesh","closePeopleManagemen","circle","showSmartInspection","inspection","show","closeSmartInspection","hide","closeCameraPoiInspection","cameraPoi","showCameraPoiInspection","generateObject","toggleOverview","apply","togglePeopleManagemen","toggleSmartInspection","toggleSecurityOperation","toggleTag","overview","tag","toggleSceneStyle","real","tech","cameraUtil","set","position","target","handleUnit","generateWall","generateCylinder","on","data","Event","Success","undefined","type","generateCircle","belongTo","areaBoundingBox","generateBoundingBox","addEventListener","args","item"],"sources":["../../../src/factory/unit/index.ts"],"sourcesContent":["import { utils } from '@anov/3d-core'\nimport { SceneStyle, SceneTag } from '../utils/constant'\n\nimport { MessageType, sendToMessage } from '../../utils/messageFn'\nimport { EMessageStatus } from '../../messageStatus'\nimport WallManage from './wall'\nimport CylinderManage from './cylinder'\nimport PoiManage from './poi'\nimport CircleManage from './circle'\nimport AreaBoundingBoxManage from './areaBoundingBox'\nimport Inspection from './inspection'\nimport CameraPoi from './CameraPoi'\n\nconst { emitter } = utils\n\n// 临时优化\n\nconst showOverview = function () {\n this.poi.generatePoi()\n}\n\nconst closeOverview = function () {\n this.wall.wallMesh.forEach((mesh) => {\n mesh.visible = false\n })\n\n this.poi.remove()\n}\n\nconst showPeopleManagemen = function () {\n this.cylinder.cylinderMesh.forEach((mesh) => {\n mesh.visible = true\n })\n}\n\nconst closePeopleManagemen = function () {\n this.cylinder.cylinderMesh.forEach((mesh) => {\n mesh.visible = false\n })\n\n this.circle.remove()\n}\n\nconst showSmartInspection = function () {\n this.inspection.show()\n}\n\nconst closeSmartInspection = function () {\n this.inspection.hide()\n}\n\nconst closeCameraPoiInspection = function () {\n this.cameraPoi?.remove()\n}\nconst showCameraPoiInspection = function () {\n this.cameraPoi?.generateObject()\n}\n\nconst toggleOverview = function () {\n showOverview.apply(this)\n closePeopleManagemen.apply(this)\n closeSmartInspection.apply(this)\n closeCameraPoiInspection.apply(this)\n}\n\nconst togglePeopleManagemen = function () {\n showPeopleManagemen.apply(this)\n closeOverview.apply(this)\n closeSmartInspection.apply(this)\n closeCameraPoiInspection.apply(this)\n}\n\nconst toggleSmartInspection = function () {\n showSmartInspection.apply(this)\n closeOverview.apply(this)\n closePeopleManagemen.apply(this)\n closeCameraPoiInspection.apply(this)\n}\n\nconst toggleSecurityOperation = function () {\n showCameraPoiInspection.apply(this)\n closeOverview.apply(this)\n closePeopleManagemen.apply(this)\n closeSmartInspection.apply(this)\n}\n\nexport const toggleTag = {\n [SceneTag.overview]() {\n this.tag = SceneTag.overview\n this.toggleSceneStyle(SceneStyle.real)\n // this.cameraUtil.set({\n // position: [0, 200, 400],\n // target: [0, 0, 0],\n // })\n\n toggleOverview.apply(this)\n },\n [SceneTag['people-management']]() {\n this.tag = SceneTag['people-management']\n this.toggleSceneStyle(SceneStyle.tech)\n // this.cameraUtil.set({\n // position: [150, 300, 400],\n // target: [0, 0, 0],\n // })\n\n togglePeopleManagemen.apply(this)\n },\n [SceneTag['smart-inspection']]() {\n this.tag = SceneTag['smart-inspection']\n this.toggleSceneStyle(SceneStyle.real)\n this.cameraUtil.set({\n position: [0, 200, 400],\n target: [0, 0, 0],\n })\n\n toggleSmartInspection.apply(this)\n },\n [SceneTag['security-operation']]() {\n this.tag = SceneTag['security-operation']\n this.toggleSceneStyle(SceneStyle.real)\n // this.cameraUtil.set({\n // position: [350.99, 39.07, 194.30],\n // target: [401.89, -52.54, 3.04],\n // duration: 2,\n // })\n toggleSecurityOperation.apply(this)\n },\n}\n\nconst handleUnit = function () {\n // 围栏\n const wall = new WallManage(this, { visible: false })\n wall.generateWall()\n this.wall = wall\n\n // 圆柱\n const cylinder = new CylinderManage(this, {\n visible: false,\n })\n cylinder.generateCylinder()\n\n this.cylinder = cylinder\n\n // POI\n const poi = new PoiManage(this)\n poi.generatePoi()\n this.poi = poi\n\n // people\n const circle = new CircleManage(this)\n this.circle = circle\n\n emitter.on('peoplemanagement-camera-enter', (data: any) => {\n sendToMessage(MessageType.Event, 'onClick', EMessageStatus.Success, undefined, {\n type: 'Bar',\n ...data,\n })\n this.circle.generateCircle(data?.belongTo)\n })\n\n emitter.on('peoplemanagement-person-click', (data: any) => {\n sendToMessage(MessageType.Event, 'onClick', EMessageStatus.Success, undefined, {\n type: 'POI',\n ...data,\n })\n })\n\n // boundingBox\n const areaBoundingBox = new AreaBoundingBoxManage()\n areaBoundingBox.generateBoundingBox()\n this.areaBoundingBox = areaBoundingBox\n\n const inspection = new Inspection(this)\n this.inspection = inspection\n\n const cameraPoi = new CameraPoi(this)\n this.cameraPoi = cameraPoi\n\n // some global events handle\n this.addEventListener('peoplemanagement-camera-out', (args) => {\n if (this.tag !== SceneTag['people-management'])\n return\n cylinder.cylinderMesh.forEach((item) => {\n item.visible = true\n })\n this.circle.remove()\n })\n\n emitter.on('peoplemanagement-control-maxDistance', () => {\n sendToMessage(MessageType.Event, 'onCancel', EMessageStatus.Success, undefined, { })\n })\n}\n\nexport default handleUnit\n"],"mappings":";;;;;;;AAAA,SAASA,KAAK,QAAQ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Ae,GAAGA,eAAe;EAEtC,IAAMlC,UAAU,GAAG,IAAInB,UAAU,CAAC,IAAI,CAAC;EACvC,IAAI,CAACmB,UAAU,GAAGA,UAAU;EAE5B,IAAMK,SAAS,GAAG,IAAIvB,SAAS,CAAC,IAAI,CAAC;EACrC,IAAI,CAACuB,SAAS,GAAGA,SAAS;;EAE1B;EACA,IAAI,CAAC+B,gBAAgB,CAAC,6BAA6B,EAAE,UAACC,IAAI,EAAK;IAC7D,IAAI,KAAI,CAACtB,GAAG,KAAK3C,QAAQ,CAAC,mBAAmB,CAAC,EAC5C;IACFuB,QAAQ,CAACC,YAAY,CAACN,OAAO,CAAC,UAACgD,IAAI,EAAK;MACtCA,IAAI,CAAC9C,OAAO,GAAG,IAAI;IACrB,CAAC,CAAC;IACF,KAAI,CAACM,MAAM,CAACL,MAAM,EAAE;EACtB,CAAC,CAAC;EAEFV,OAAO,CAAC2C,EAAE,CAAC,sCAAsC,EAAE,YAAM;IACvDpD,aAAa,CAACD,WAAW,CAACuD,KAAK,EAAE,UAAU,EAAErD,cAAc,CAACsD,OAAO,EAAEC,SAAS,EAAE,CAAE,CAAC,CAAC;EACtF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeP,UAAU"}
|
|
1
|
+
{"version":3,"names":["utils","SceneStyle","SceneTag","MessageType","sendToMessage","EMessageStatus","WallManage","CylinderManage","PoiManage","CircleManage","AreaBoundingBoxManage","Inspection","CameraPoi","DistrictLineManage","emitter","showOverview","poi","generatePoi","closeOverview","wall","wallMesh","forEach","mesh","visible","remove","showPeopleManagemen","cylinder","cylinderMesh","districtLine","generateLine","closePeopleManagemen","circle","showSmartInspection","inspection","show","closeSmartInspection","hide","closeCameraPoiInspection","cameraPoi","showCameraPoiInspection","generateObject","toggleOverview","apply","togglePeopleManagemen","toggleSmartInspection","toggleSecurityOperation","toggleTag","overview","tag","toggleSceneStyle","real","tech","handleUnit","generateWall","generateCylinder","on","data","Event","Success","undefined","type","generateCircle","belongTo","areaBoundingBox","generateBoundingBox","addEventListener","args","item"],"sources":["../../../src/factory/unit/index.ts"],"sourcesContent":["import { utils } from '@anov/3d-core'\nimport { SceneStyle, SceneTag } from '../utils/constant'\n\nimport { MessageType, sendToMessage } from '../../utils/messageFn'\nimport { EMessageStatus } from '../../messageStatus'\nimport WallManage from './wall'\nimport CylinderManage from './cylinder'\nimport PoiManage from './poi'\nimport CircleManage from './circle'\nimport AreaBoundingBoxManage from './areaBoundingBox'\nimport Inspection from './inspection'\nimport CameraPoi from './CameraPoi'\nimport DistrictLineManage from './districtLine'\n\nconst { emitter } = utils\n\n// 临时优化\n\nconst showOverview = function () {\n this.poi.generatePoi()\n}\n\nconst closeOverview = function () {\n this.wall.wallMesh.forEach((mesh) => {\n mesh.visible = false\n })\n\n this.poi.remove()\n}\n\nconst showPeopleManagemen = function () {\n this.cylinder.cylinderMesh.forEach((mesh) => {\n mesh.visible = true\n })\n this.districtLine.generateLine()\n}\n\nconst closePeopleManagemen = function () {\n this.cylinder.cylinderMesh.forEach((mesh) => {\n mesh.visible = false\n })\n this.districtLine.remove()\n this.circle.remove()\n}\n\nconst showSmartInspection = function () {\n this.inspection.show()\n}\n\nconst closeSmartInspection = function () {\n this.inspection.hide()\n}\n\nconst closeCameraPoiInspection = function () {\n this.cameraPoi?.remove()\n}\nconst showCameraPoiInspection = function () {\n this.cameraPoi?.generateObject()\n}\n\nconst toggleOverview = function () {\n showOverview.apply(this)\n closePeopleManagemen.apply(this)\n closeSmartInspection.apply(this)\n closeCameraPoiInspection.apply(this)\n}\n\nconst togglePeopleManagemen = function () {\n showPeopleManagemen.apply(this)\n closeOverview.apply(this)\n closeSmartInspection.apply(this)\n closeCameraPoiInspection.apply(this)\n}\n\nconst toggleSmartInspection = function () {\n showSmartInspection.apply(this)\n closeOverview.apply(this)\n closePeopleManagemen.apply(this)\n closeCameraPoiInspection.apply(this)\n}\n\nconst toggleSecurityOperation = function () {\n showCameraPoiInspection.apply(this)\n closeOverview.apply(this)\n closePeopleManagemen.apply(this)\n closeSmartInspection.apply(this)\n}\n\nexport const toggleTag = {\n [SceneTag.overview]() {\n this.tag = SceneTag.overview\n this.toggleSceneStyle(SceneStyle.real)\n\n toggleOverview.apply(this)\n },\n [SceneTag['people-management']]() {\n this.tag = SceneTag['people-management']\n this.toggleSceneStyle(SceneStyle.tech)\n\n togglePeopleManagemen.apply(this)\n },\n [SceneTag['smart-inspection']]() {\n this.tag = SceneTag['smart-inspection']\n this.toggleSceneStyle(SceneStyle.real)\n\n toggleSmartInspection.apply(this)\n },\n [SceneTag['security-operation']]() {\n this.tag = SceneTag['security-operation']\n this.toggleSceneStyle(SceneStyle.real)\n\n toggleSecurityOperation.apply(this)\n },\n}\n\nconst handleUnit = function () {\n // 围栏\n const wall = new WallManage(this, { visible: false })\n wall.generateWall()\n this.wall = wall\n\n // 圆柱\n const cylinder = new CylinderManage(this, {\n visible: false,\n })\n cylinder.generateCylinder()\n\n this.cylinder = cylinder\n\n // POI\n const poi = new PoiManage(this)\n poi.generatePoi()\n this.poi = poi\n\n // people\n const circle = new CircleManage(this)\n this.circle = circle\n\n const districtLine = new DistrictLineManage(this)\n this.districtLine = districtLine\n\n emitter.on('peoplemanagement-camera-enter', (data: any) => {\n sendToMessage(MessageType.Event, 'onClick', EMessageStatus.Success, undefined, {\n type: 'Bar',\n ...data,\n })\n this.circle.generateCircle(data?.belongTo)\n })\n\n emitter.on('peoplemanagement-person-click', (data: any) => {\n sendToMessage(MessageType.Event, 'onClick', EMessageStatus.Success, undefined, {\n type: 'POI',\n ...data,\n })\n })\n\n // boundingBox\n const areaBoundingBox = new AreaBoundingBoxManage()\n areaBoundingBox.generateBoundingBox()\n this.areaBoundingBox = areaBoundingBox\n\n const inspection = new Inspection(this)\n this.inspection = inspection\n\n const cameraPoi = new CameraPoi(this)\n this.cameraPoi = cameraPoi\n\n // some global events handle\n this.addEventListener('peoplemanagement-camera-out', (args) => {\n if (this.tag !== SceneTag['people-management'])\n return\n cylinder.cylinderMesh.forEach((item) => {\n item.visible = true\n })\n this.circle.remove()\n })\n\n emitter.on('peoplemanagement-control-maxDistance', () => {\n sendToMessage(MessageType.Event, 'onCancel', EMessageStatus.Success, undefined, { })\n })\n}\n\nexport default handleUnit\n"],"mappings":";;;;;;;AAAA,SAASA,KAAK,QAAQ,eAAe;AACrC,SAASC,UAAU,EAAEC,QAAQ;AAE7B,SAASC,WAAW,EAAEC,aAAa;AACnC,SAASC,cAAc;AACvB,OAAOC,UAAU;AACjB,OAAOC,cAAc;AACrB,OAAOC,SAAS;AAChB,OAAOC,YAAY;AACnB,OAAOC,qBAAqB;AAC5B,OAAOC,UAAU;AACjB,OAAOC,SAAS;AAChB,OAAOC,kBAAkB;AAEzB,IAAQC,OAAO,GAAKd,KAAK,CAAjBc,OAAO;;AAEf;;AAEA,IAAMC,YAAY,GAAG,SAAfA,YAAY,GAAe;EAC/B,IAAI,CAACC,GAAG,CAACC,WAAW,EAAE;AACxB,CAAC;AAED,IAAMC,aAAa,GAAG,SAAhBA,aAAa,GAAe;EAChC,IAAI,CAACC,IAAI,CAACC,QAAQ,CAACC,OAAO,CAAC,UAACC,IAAI,EAAK;IACnCA,IAAI,CAACC,OAAO,GAAG,KAAK;EACtB,CAAC,CAAC;EAEF,IAAI,CAACP,GAAG,CAACQ,MAAM,EAAE;AACnB,CAAC;AAED,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAmB,GAAe;EACtC,IAAI,CAACC,QAAQ,CAACC,YAAY,CAACN,OAAO,CAAC,UAACC,IAAI,EAAK;IAC3CA,IAAI,CAACC,OAAO,GAAG,IAAI;EACrB,CAAC,CAAC;EACF,IAAI,CAACK,YAAY,CAACC,YAAY,EAAE;AAClC,CAAC;AAED,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoB,GAAe;EACvC,IAAI,CAACJ,QAAQ,CAACC,YAAY,CAACN,OAAO,CAAC,UAACC,IAAI,EAAK;IAC3CA,IAAI,CAACC,OAAO,GAAG,KAAK;EACtB,CAAC,CAAC;EACF,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,IAAI,EACP;EACJ,CAAC,CAAC;;EAEF;EACA,IAAMO,eAAe,GAAG,IAAIrD,qBAAqB,EAAE;EACnDqD,eAAe,CAACC,mBAAmB,EAAE;EACrC,IAAI,CAACD,eAAe,GAAGA,eAAe;EAEtC,IAAM9B,UAAU,GAAG,IAAItB,UAAU,CAAC,IAAI,CAAC;EACvC,IAAI,CAACsB,UAAU,GAAGA,UAAU;EAE5B,IAAMK,SAAS,GAAG,IAAI1B,SAAS,CAAC,IAAI,CAAC;EACrC,IAAI,CAAC0B,SAAS,GAAGA,SAAS;;EAE1B;EACA,IAAI,CAAC2B,gBAAgB,CAAC,6BAA6B,EAAE,UAACC,IAAI,EAAK;IAC7D,IAAI,KAAI,CAAClB,GAAG,KAAK9C,QAAQ,CAAC,mBAAmB,CAAC,EAC5C;IACFwB,QAAQ,CAACC,YAAY,CAACN,OAAO,CAAC,UAAC8C,IAAI,EAAK;MACtCA,IAAI,CAAC5C,OAAO,GAAG,IAAI;IACrB,CAAC,CAAC;IACF,KAAI,CAACQ,MAAM,CAACP,MAAM,EAAE;EACtB,CAAC,CAAC;EAEFV,OAAO,CAACyC,EAAE,CAAC,sCAAsC,EAAE,YAAM;IACvDnD,aAAa,CAACD,WAAW,CAACsD,KAAK,EAAE,UAAU,EAAEpD,cAAc,CAACqD,OAAO,EAAEC,SAAS,EAAE,CAAE,CAAC,CAAC;EACtF,CAAC,CAAC;AACJ,CAAC;AAED,eAAeP,UAAU"}
|
|
@@ -8,15 +8,13 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
8
8
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
10
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
11
|
-
import { Clock, Color, EdgesGeometry, Group, LineBasicMaterial, LineCurve3, LineSegments, Matrix4,
|
|
11
|
+
import { Clock, Color, EdgesGeometry, Group, LineBasicMaterial, LineCurve3, LineSegments, Matrix4, MeshBasicMaterial, ModelLoader, Quaternion, Vector3, use, utils } from '@anov/3d-core';
|
|
12
12
|
import { Css2DPoi, SpritePoi } from '@anov/3d-ability';
|
|
13
13
|
import { Tween } from '@tweenjs/tween.js';
|
|
14
14
|
import { createFinirMaterial } from "../../utils/finirMaterial";
|
|
15
15
|
import { usePath } from "../../3d";
|
|
16
16
|
import { MessageType, sendToMessage } from "../../../utils/messageFn";
|
|
17
17
|
import { EMessageStatus } from "../../../messageStatus";
|
|
18
|
-
import fragmentShader from "../glsl/highway/fragmentShader";
|
|
19
|
-
import vertexShader from "../glsl/highway/vertexShader";
|
|
20
18
|
import { isCheck, targetProgresspoints } from "./lineData";
|
|
21
19
|
var modelLoader = new ModelLoader();
|
|
22
20
|
var InspectionObject = /*#__PURE__*/function () {
|
|
@@ -102,27 +100,32 @@ var InspectionObject = /*#__PURE__*/function () {
|
|
|
102
100
|
_this.checkAnimation(_this.getSportsProgress);
|
|
103
101
|
}
|
|
104
102
|
});
|
|
105
|
-
|
|
106
|
-
// const box = new Mesh(new BoxGeometry(10, 10, 10), new MeshBasicMaterial({ color: 0xFF0000 }))
|
|
107
103
|
group = new Group();
|
|
108
104
|
group.add(glb.scene);
|
|
109
105
|
group.add(poi);
|
|
110
106
|
group.add(this.inspection.minCamera);
|
|
111
|
-
|
|
112
|
-
// box.scale.set(0.1, 0.1, 0.1)
|
|
113
|
-
|
|
114
107
|
this.inspection.minCamera.position.copy(glb.scene.position);
|
|
115
108
|
this.inspection.minCamera.position.z -= 5;
|
|
116
109
|
this.inspection.minCamera.position.y += 5;
|
|
117
110
|
this.inspection.minCamera.rotateY(Math.PI);
|
|
118
111
|
this.model = group;
|
|
112
|
+
this.inspection.gobal.interactionManager.add(poi);
|
|
113
|
+
|
|
114
|
+
// poi.addEventListener('click', () => {
|
|
115
|
+
// css2d.visible = true
|
|
116
|
+
// })
|
|
117
|
+
|
|
118
|
+
// css2d.addEventListener('click', () => {
|
|
119
|
+
// css2d.visible = false
|
|
120
|
+
// })
|
|
121
|
+
|
|
119
122
|
glb.scene.scale.set(5, 5, 5);
|
|
120
123
|
glb.scene.traverse(function (child) {
|
|
121
124
|
child.layers.enable(2);
|
|
122
125
|
});
|
|
123
126
|
this.inspection.gobal.scene.add(this.model);
|
|
124
127
|
this.inspection.gobal.scene.add(css2d);
|
|
125
|
-
case
|
|
128
|
+
case 46:
|
|
126
129
|
case "end":
|
|
127
130
|
return _context.stop();
|
|
128
131
|
}
|
|
@@ -138,7 +141,6 @@ var InspectionObject = /*#__PURE__*/function () {
|
|
|
138
141
|
value: function () {
|
|
139
142
|
var _startMove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(curve) {
|
|
140
143
|
var _this2 = this;
|
|
141
|
-
var walkCurve, walkCurveMesh;
|
|
142
144
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
143
145
|
while (1) switch (_context2.prev = _context2.next) {
|
|
144
146
|
case 0:
|
|
@@ -152,48 +154,12 @@ var InspectionObject = /*#__PURE__*/function () {
|
|
|
152
154
|
this.control = utils.moveWithLine(this.model, curve, 10, {
|
|
153
155
|
groundCurve: this.inspection.groundCurve
|
|
154
156
|
});
|
|
155
|
-
walkCurve = this.control.getWalkCurve();
|
|
156
157
|
use.useframe(function () {
|
|
157
|
-
if (!_this2.inspection.isHide) {
|
|
158
|
-
walkCurve = _this2.control.getWalkCurve();
|
|
159
|
-
if (walkCurveMesh) {
|
|
160
|
-
if (walkCurve && walkCurve.points.length > 2) {
|
|
161
|
-
walkCurveMesh.removeFromParent();
|
|
162
|
-
walkCurveMesh.geometry.dispose();
|
|
163
|
-
walkCurveMesh.geometry = new TubeGeometry(walkCurve, 10000, 3, 2, false);
|
|
164
|
-
_this2.inspection.gobal.scene.add(walkCurveMesh);
|
|
165
|
-
} else {
|
|
166
|
-
walkCurveMesh.removeFromParent();
|
|
167
|
-
walkCurveMesh.geometry.dispose();
|
|
168
|
-
}
|
|
169
|
-
} else {
|
|
170
|
-
if (walkCurve.points.length > 2) {
|
|
171
|
-
var tube = new TubeGeometry(walkCurve, 10000, 3, 2, false);
|
|
172
|
-
walkCurveMesh = new Mesh(tube, new ShaderMaterial({
|
|
173
|
-
transparent: true,
|
|
174
|
-
uniforms: {
|
|
175
|
-
alpha: {
|
|
176
|
-
value: 0.9
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
vertexShader: vertexShader,
|
|
180
|
-
fragmentShader: fragmentShader
|
|
181
|
-
}));
|
|
182
|
-
_this2.walkCurveMesh = walkCurveMesh;
|
|
183
|
-
_this2.inspection.gobal.scene.add(walkCurveMesh);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
} else {
|
|
187
|
-
if (walkCurveMesh) {
|
|
188
|
-
walkCurveMesh.removeFromParent();
|
|
189
|
-
walkCurveMesh.geometry.dispose();
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
158
|
sendToMessage(MessageType.Event, 'onInspectProgress', EMessageStatus.Success, undefined, {
|
|
193
159
|
percentage: _this2.getSportsProgress
|
|
194
160
|
});
|
|
195
161
|
});
|
|
196
|
-
case
|
|
162
|
+
case 5:
|
|
197
163
|
case "end":
|
|
198
164
|
return _context2.stop();
|
|
199
165
|
}
|
|
@@ -440,6 +406,10 @@ var InspectionObject = /*#__PURE__*/function () {
|
|
|
440
406
|
if (this.control) this.control.contine();
|
|
441
407
|
utils.emitter.emit('continue', true);
|
|
442
408
|
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* todo: now temporarily not implemented
|
|
412
|
+
*/
|
|
443
413
|
}, {
|
|
444
414
|
key: "dispose",
|
|
445
415
|
value: function dispose() {}
|