@anov/3d 0.0.39 → 0.0.40
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/factory/3d.js
CHANGED
|
@@ -5,7 +5,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
5
5
|
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; }
|
|
6
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
7
|
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); }
|
|
8
|
-
import { Color, EquirectangularReflectionMapping, InteractionManager, LoadingManager, ModelLoader, SRGBColorSpace, ShaderMaterial, TextureLoader, Vector2, Vector3, lib, use, utils } from '@anov/3d-core';
|
|
8
|
+
import { Color, EquirectangularReflectionMapping, InteractionManager, LoadingManager, ModelLoader, RepeatWrapping, SRGBColorSpace, ShaderChunk, ShaderMaterial, TextureLoader, Vector2, Vector3, Vector4, lib, use, utils } from '@anov/3d-core';
|
|
9
9
|
import { Camera } from '@anov/3d-ability';
|
|
10
10
|
import { finirMaterialV1 } from "./utils/finirMaterial";
|
|
11
11
|
import handleUnit, { toggleTag as _toggleTag } from "./unit";
|
|
@@ -14,6 +14,58 @@ import { SceneStyle, SceneTag } from "./utils/constant";
|
|
|
14
14
|
import factoryGlobalObject from "./globalControl";
|
|
15
15
|
import frag from "./unit/glsl/heat/frag";
|
|
16
16
|
import vert from "./unit/glsl/heat/ver";
|
|
17
|
+
var vertexShader = "\n".concat(ShaderChunk.logdepthbuf_pars_vertex, "\nbool isPerspectiveMatrix(mat4) {\n return true;\n }\n varying vec2 vUv;\n varying vec3 vPosition;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n vec4 worldPosition1 = modelMatrix * vec4(position, 1.0);\n vPosition = worldPosition1.xyz;\n ").concat(ShaderChunk.logdepthbuf_vertex, "\n }\n");
|
|
18
|
+
|
|
19
|
+
// Fragment shader
|
|
20
|
+
var fragmentShader = "\n ".concat(ShaderChunk.logdepthbuf_pars_fragment, " \n uniform sampler2D _Texture;\n uniform vec4 _Texture_ST;\n uniform vec4 _Color;\n uniform float _ColorS;\n uniform sampler2D _TextureMask;\n uniform float _MaskUV;\n uniform vec4 _ColorMask;\n uniform float _ColorMaskS;\n uniform vec4 _Speed;\n uniform float _OP;\n uniform float _Time;\n\n varying vec3 vPosition;\n varying vec2 vUv;\n\n void main() {\n vec3 temp_cast_0 = vec3(0.2);\n vec4 o = vec4(temp_cast_0, 1.0);\n vec2 uv_Texture = vUv * 8.0;\n vec4 tex2DNode1 = texture2D(_Texture, uv_Texture);\n vec2 temp_cast_1 = vec2(_MaskUV);\n vec2 uv_TexCoord7 = vUv * temp_cast_1;\n\n vec2 panner6 = (vec2(1.0) * _Time * _Speed.xy + uv_TexCoord7);\n\n o.rgb = ((_Color * tex2DNode1.r * _ColorS) + (_ColorMask * (tex2DNode1.r * texture2D(_TextureMask, panner6).r) * _ColorMaskS)).rgb;\n o.a = _OP;\n gl_FragColor = o;\n\n if(vPosition.x>-550.0 && vPosition.x<550.0 && vPosition.z>-300.0 && vPosition.z<270.0){\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n\n ").concat(ShaderChunk.logdepthbuf_fragment, "\n }\n");
|
|
21
|
+
var _Texture = new TextureLoader().load('./demo03.jpg');
|
|
22
|
+
_Texture.wrapS = RepeatWrapping;
|
|
23
|
+
_Texture.wrapT = RepeatWrapping;
|
|
24
|
+
var uniforms = {
|
|
25
|
+
_Texture: {
|
|
26
|
+
value: _Texture
|
|
27
|
+
},
|
|
28
|
+
_Texture_ST: {
|
|
29
|
+
value: new Vector4()
|
|
30
|
+
},
|
|
31
|
+
_Color: {
|
|
32
|
+
value: new Vector4(new Color('#red').r, new Color('#fff').g, new Color('#fff').b, 0.1)
|
|
33
|
+
},
|
|
34
|
+
_ColorS: {
|
|
35
|
+
value: 1
|
|
36
|
+
},
|
|
37
|
+
_TextureMask: {
|
|
38
|
+
value: new TextureLoader().load('./demo04.jpg')
|
|
39
|
+
},
|
|
40
|
+
_MaskUV: {
|
|
41
|
+
value: 1
|
|
42
|
+
},
|
|
43
|
+
_ColorMask: {
|
|
44
|
+
value: new Vector4(new Color('#fff').r, new Color('#fff').g, new Color('#fff').b, 0.1)
|
|
45
|
+
},
|
|
46
|
+
_ColorMaskS: {
|
|
47
|
+
value: 1
|
|
48
|
+
},
|
|
49
|
+
_Speed: {
|
|
50
|
+
value: new Vector4(0.0, 1.2, 0, 0)
|
|
51
|
+
},
|
|
52
|
+
_OP: {
|
|
53
|
+
value: 1.0
|
|
54
|
+
},
|
|
55
|
+
_Time: {
|
|
56
|
+
value: 1.0
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
use.useframe(function () {
|
|
60
|
+
if (uniforms._Time.value > 0.3) uniforms._Time.value = 0;
|
|
61
|
+
uniforms._Time.value += 0.001;
|
|
62
|
+
});
|
|
63
|
+
var material = new ShaderMaterial({
|
|
64
|
+
uniforms: uniforms,
|
|
65
|
+
vertexShader: vertexShader,
|
|
66
|
+
fragmentShader: fragmentShader,
|
|
67
|
+
transparent: true
|
|
68
|
+
});
|
|
17
69
|
export var loadingManager = new LoadingManager();
|
|
18
70
|
var load = new ModelLoader(loadingManager);
|
|
19
71
|
var rgbeLoader = new lib.RGBELoader(loadingManager);
|
|
@@ -118,8 +170,14 @@ var Factory3D = /*#__PURE__*/function () {
|
|
|
118
170
|
group.traverse(function (child) {
|
|
119
171
|
// @ts-ignore
|
|
120
172
|
if (child.type === 'Mesh') {
|
|
121
|
-
|
|
122
|
-
|
|
173
|
+
if (child.name === '柱体') {
|
|
174
|
+
// @ts-ignore
|
|
175
|
+
child.material = material;
|
|
176
|
+
child.renderOrder = -1;
|
|
177
|
+
} else {
|
|
178
|
+
// @ts-ignore
|
|
179
|
+
child.material = finirMaterialV1;
|
|
180
|
+
}
|
|
123
181
|
}
|
|
124
182
|
});
|
|
125
183
|
_this2.scene.add(group);
|
package/dist/factory/3d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Color","EquirectangularReflectionMapping","InteractionManager","LoadingManager","ModelLoader","SRGBColorSpace","ShaderMaterial","TextureLoader","Vector2","Vector3","lib","use","utils","Camera","finirMaterialV1","handleUnit","toggleTag","globalEvents","SceneStyle","SceneTag","factoryGlobalObject","frag","vert","loadingManager","load","rgbeLoader","RGBELoader","emitter","resourcePath","resourcePath2","usePath","Factory3D","option","overview","real","Map","globalEventsAgent","setFactory","scene","Promise","resolve","cameraUtil","camera","controls","control","layers","set","loadGLTF","gltf","realTreeModel","add","interactionManager","renderer","domElement","storeManagement","useframe","update","loadModel","onLoad","toneMappingExposure","visible","style","realModl","call","group","traverse","child","type","material","tech","techModel","vertexShader","fragmentShader","uniforms","texture1","value","texture2","uvScale","depthTest","depthWrite","thermaLimaging","pipeline","realGroundModel","setPath","texture","mapping","colorSpace","boxSkeyTexture","environment","background","params","tag","apply","forEach","eventKey","on","args","eventHandleFn","get","fn","cutoutCamera","inspection","minCamera","mainCamera","eventName","handleFn","push"],"sources":["../../src/factory/3d.ts"],"sourcesContent":["import type { DataTexture, Group, OrbitControls, SceneControl } from '@anov/3d-core'\nimport { BoxGeometry, Color, EquirectangularReflectionMapping, InteractionManager, LoadingManager, Mesh, MeshBasicMaterial, ModelLoader, SRGBColorSpace, ShaderMaterial, TextureLoader, Vector2, Vector3, lib, sRGBEncoding, use, utils } from '@anov/3d-core'\nimport { Camera, createBloomSelectedTool, initPostEffects } from '@anov/3d-ability'\nimport { finirMaterialV1 } from './utils/finirMaterial'\nimport handleUnit, { toggleTag } from './unit'\nimport type WallManage from './unit/wall'\nimport type LineManage from './unit/line'\nimport type CylinderManage from './unit/cylinder'\nimport type PoiManage from './unit/poi'\nimport type CircleManage from './unit/circle'\nimport type AreaBoundingBoxManage from './unit/areaBoundingBox'\nimport type Inspection from './unit/inspection'\nimport { globalEvents } from './globalData'\nimport { SceneStyle, SceneTag } from './utils/constant'\nimport switchMaterial from './utils/switchMaterial'\nimport factoryGlobalObject from './globalControl'\nimport { debounce } from './utils'\n\nimport frag from './unit/glsl/heat/frag'\nimport vert from './unit/glsl/heat/ver'\n\ntype factory3dOption = {\n model: string\n environment: string\n decoderPath?: string\n controls?: any\n}\n\nexport const loadingManager = new LoadingManager()\nconst load = new ModelLoader(loadingManager)\nconst rgbeLoader = new lib.RGBELoader(loadingManager)\nconst { emitter } = utils\n\nconst resourcePath = './'\nconst resourcePath2 = 'http://172.16.223.163:9000/anov-prod/anov-3d/factory/example/'\n\nexport const usePath = resourcePath2\n\nclass Factory3D {\n position: Vector3 = new Vector3(0, 0, 0)\n scene: SceneControl\n control: OrbitControls\n cameraUtil: Camera\n\n public loadingManager = loadingManager\n public tag = SceneTag.overview\n public style: SceneStyle = SceneStyle.real\n private option: factory3dOption\n wall: WallManage\n line: LineManage\n cylinder: CylinderManage\n poi: PoiManage\n circle: CircleManage\n areaBoundingBox: AreaBoundingBoxManage\n inspection: Inspection\n\n usePath = usePath\n\n private pipeline: Group\n private realModl: Group\n private techModel: Group\n private realGroundModel: Group\n private realTreeModel: Group\n private thermaLimaging: Group\n private eventHandleFn: Map<string, ((args?: any) => void)[]> = new Map()\n private boxSkeyTexture: DataTexture\n\n interactionManager: InteractionManager\n\n constructor(option: factory3dOption) {\n this.option = option\n this.globalEventsAgent()\n factoryGlobalObject.setFactory(this)\n }\n\n /**\n * render factory 3d scene\n */\n renderScene(scene: SceneControl) {\n return new Promise((resolve) => {\n this.scene = scene\n\n this.cameraUtil = new Camera(scene.camera!, scene.controls!, scene)\n this.control = scene.controls!\n scene.camera.layers.set(0)\n\n load.loadGLTF(`${this.usePath}landScap3.glb`, false, true, './draco/', (gltf) => {\n this.realTreeModel = (gltf.scene) as Group\n\n // this.interactionManager.add(gltf.scene)\n\n // gltf.scene.addEventListener('click', (value) => {\n // this.position = value.point\n // })\n scene.add(this.realTreeModel)\n\n return gltf\n })\n\n const interactionManager = new InteractionManager(\n this.scene.renderer,\n this.scene.camera,\n this.scene.renderer.domElement, // Modified By LM this.scene.cssRenderer.cssRenderer.domElement,\n )\n\n this.interactionManager = interactionManager\n\n utils.storeManagement.set('interactionManager', interactionManager)\n\n use.useframe(() => {\n interactionManager.update()\n })\n\n this.loadModel()\n\n loadingManager.onLoad = () => {\n resolve('success')\n }\n\n scene.renderer.toneMappingExposure = 0.4\n })\n }\n\n private loadModel() {\n // real model\n load.loadGLTF(`${this.usePath}222.glb`, false, true, './draco/', (gltf) => {\n this.scene.add(gltf.scene)\n\n gltf.scene.visible = SceneStyle.real === this.style\n\n this.realModl = gltf.scene as Group\n\n // this.interactionManager.add(gltf.scene)\n\n // gltf.scene.addEventListener('click', (value) => {\n // this.position = value.point\n // })\n\n handleUnit.call(this)\n\n return gltf\n })\n\n // tech model\n load.loadGLTF(`${this.usePath}2222.glb`, false, true, './draco/', (gltf) => {\n const group = gltf.scene\n group.traverse((child) => {\n // @ts-ignore\n if (child.type === 'Mesh') {\n // @ts-ignore\n child.material = finirMaterialV1\n }\n })\n\n this.scene.add(group)\n\n group.visible = SceneStyle.tech === this.style\n this.techModel = group as Group\n\n return gltf\n })\n\n // thermaLimaging model\n load.loadGLTF(`${this.usePath}2222.glb`, false, true, './draco/', (gltf) => {\n const group = gltf.scene\n group.traverse((child) => {\n if (child.type === 'Mesh') {\n // @ts-ignore\n child.material = new ShaderMaterial({\n vertexShader: vert,\n fragmentShader: frag,\n uniforms: {\n texture1: { value: new TextureLoader(this.loadingManager).load(`${this.usePath}test01.jpg`) },\n texture2: { value: new TextureLoader(this.loadingManager).load(`${this.usePath}test02.jpg`) },\n uvScale: { value: new Vector2(1, 1) },\n },\n depthTest: false,\n depthWrite: false,\n })\n\n child.layers.set(2)\n }\n })\n\n this.scene.add(group)\n\n this.thermaLimaging = group as Group\n\n return gltf\n })\n\n load.loadGLTF(`${this.usePath}guandao.glb`, false, true, './draco/', (gltf) => {\n this.scene.add(gltf.scene)\n\n this.pipeline = gltf.scene as Group\n return gltf\n })\n\n // ground\n load.loadGLTF(`${this.usePath}landScap.glb`, false, true, './draco/', (gltf) => {\n this.scene.add(gltf.scene)\n\n // this.interactionManager.add(gltf.scene)\n\n // gltf.scene.addEventListener('click', (value) => {\n // this.position = value.point\n // })\n\n this.realGroundModel = gltf.scene as Group\n return gltf\n })\n rgbeLoader.setPath(`${this.usePath}`).load('demo.hdr', (texture) => {\n texture.mapping = EquirectangularReflectionMapping\n\n texture.colorSpace = SRGBColorSpace\n this.boxSkeyTexture = texture\n this.scene.scene.environment = texture\n this.scene.scene.background = new Color('#ccc')\n })\n }\n\n /**\n * toggle SceneStyle\n * @param params\n */\n toggleSceneStyle(params: SceneStyle) {\n if (this.style === params)\n return\n\n this.style = params\n\n if (this.style === SceneStyle.tech) {\n this.pipeline.visible = false\n this.techModel.visible = true\n this.realModl.visible = false\n this.realTreeModel.visible = false\n this.scene.scene.background = null\n this.realGroundModel && (this.realGroundModel.visible = false)\n\n this.scene.renderer.toneMappingExposure = 0.6\n }\n\n if (params === SceneStyle.real) {\n this.pipeline.visible = true\n this.techModel.visible = false\n this.realModl.visible = true\n this.realGroundModel && (this.realGroundModel.visible = true)\n this.realTreeModel && (this.realTreeModel.visible = true)\n this.scene.scene.background = new Color('#ccc')\n this.scene.scene.environment = this.boxSkeyTexture\n\n this.scene.renderer.toneMappingExposure = 0.4\n }\n }\n\n public toggleTag(tag: SceneTag) {\n if (this.tag === tag)\n return\n toggleTag[tag].apply(this, [this])\n }\n\n private globalEventsAgent() {\n globalEvents.forEach((eventKey) => {\n emitter.on(eventKey, (args) => {\n this.eventHandleFn.get(eventKey)?.forEach((fn) => {\n fn(args)\n })\n })\n })\n }\n\n /**\n * toggle view\n */\n toggleView() {\n if (this.scene.cutoutCamera === this.inspection.minCamera) {\n const cutoutCamera = this.inspection.minCamera\n this.scene.cutoutCamera = this.scene.camera\n this.scene.camera = cutoutCamera\n // initPostEffects(this.scene.scene, this.scene.renderer, cutoutCamera, {\n // type: 'main',\n // })\n }\n else {\n const mainCamera = this.scene.cutoutCamera\n const cutoutCamera = this.inspection.minCamera\n\n this.scene.camera = mainCamera\n this.scene.cutoutCamera = cutoutCamera\n\n // initPostEffects(this.scene.scene, this.scene.renderer, cutoutCamera, {\n // type: 'sub',\n // })\n }\n }\n\n addEventListener(eventName: string, handleFn: (args?: any) => void) {\n if (this.eventHandleFn.get(eventName))\n this.eventHandleFn.get(eventName).push(handleFn)\n\n else\n this.eventHandleFn.set(eventName, [handleFn])\n }\n}\n\nexport default Factory3D"],"mappings":";;;;;;;AACA,SAAsBA,KAAK,EAAEC,gCAAgC,EAAEC,kBAAkB,EAAEC,cAAc,EAA2BC,WAAW,EAAEC,cAAc,EAAEC,cAAc,EAAEC,aAAa,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,EAAgBC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AAC9P,SAASC,MAAM,QAAkD,kBAAkB;AACnF,SAASC,eAAe;AACxB,OAAOC,UAAU,IAAIC,SAAS,IAATA,UAAS;AAQ9B,SAASC,YAAY;AACrB,SAASC,UAAU,EAAEC,QAAQ;AAE7B,OAAOC,mBAAmB;AAG1B,OAAOC,IAAI;AACX,OAAOC,IAAI;AASX,OAAO,IAAMC,cAAc,GAAG,IAAIpB,cAAc,EAAE;AAClD,IAAMqB,IAAI,GAAG,IAAIpB,WAAW,CAACmB,cAAc,CAAC;AAC5C,IAAME,UAAU,GAAG,IAAIf,GAAG,CAACgB,UAAU,CAACH,cAAc,CAAC;AACrD,IAAQI,OAAO,GAAKf,KAAK,CAAjBe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MACF;IACF;EAAC;IAAA;IAAA,OAED,0BAAiBI,SAAiB,EAAEC,QAA8B,EAAE;MAClE,IAAI,IAAI,CAACR,aAAa,CAACC,GAAG,CAACM,SAAS,CAAC,EACnC,IAAI,CAACP,aAAa,CAACC,GAAG,CAACM,SAAS,CAAC,CAACE,IAAI,CAACD,QAAQ,CAAC,MAGhD,IAAI,CAACR,aAAa,CAACnD,GAAG,CAAC0D,SAAS,EAAE,CAACC,QAAQ,CAAC,CAAC;IACjD;EAAC;EAAA;AAAA;AAGH,eAAe1E,SAAS"}
|
|
1
|
+
{"version":3,"names":["Color","EquirectangularReflectionMapping","InteractionManager","LoadingManager","ModelLoader","RepeatWrapping","SRGBColorSpace","ShaderChunk","ShaderMaterial","TextureLoader","Vector2","Vector3","Vector4","lib","use","utils","Camera","finirMaterialV1","handleUnit","toggleTag","globalEvents","SceneStyle","SceneTag","factoryGlobalObject","frag","vert","vertexShader","logdepthbuf_pars_vertex","logdepthbuf_vertex","fragmentShader","logdepthbuf_pars_fragment","logdepthbuf_fragment","_Texture","load","wrapS","wrapT","uniforms","value","_Texture_ST","_Color","r","g","b","_ColorS","_TextureMask","_MaskUV","_ColorMask","_ColorMaskS","_Speed","_OP","_Time","useframe","material","transparent","loadingManager","rgbeLoader","RGBELoader","emitter","resourcePath","resourcePath2","usePath","Factory3D","option","overview","real","Map","globalEventsAgent","setFactory","scene","Promise","resolve","cameraUtil","camera","controls","control","layers","set","loadGLTF","gltf","realTreeModel","add","interactionManager","renderer","domElement","storeManagement","update","loadModel","onLoad","toneMappingExposure","visible","style","realModl","call","group","traverse","child","type","name","renderOrder","tech","techModel","texture1","texture2","uvScale","depthTest","depthWrite","thermaLimaging","pipeline","realGroundModel","setPath","texture","mapping","colorSpace","boxSkeyTexture","environment","background","params","tag","apply","forEach","eventKey","on","args","eventHandleFn","get","fn","cutoutCamera","inspection","minCamera","mainCamera","eventName","handleFn","push"],"sources":["../../src/factory/3d.ts"],"sourcesContent":["import type { DataTexture, Group, OrbitControls, SceneControl } from '@anov/3d-core'\nimport { BoxGeometry, Color, EquirectangularReflectionMapping, InteractionManager, LoadingManager, Mesh, MeshBasicMaterial, ModelLoader, RepeatWrapping, SRGBColorSpace, ShaderChunk, ShaderMaterial, TextureLoader, Vector2, Vector3, Vector4, lib, sRGBEncoding, use, utils } from '@anov/3d-core'\nimport { Camera, createBloomSelectedTool, initPostEffects } from '@anov/3d-ability'\nimport { finirMaterialV1 } from './utils/finirMaterial'\nimport handleUnit, { toggleTag } from './unit'\nimport type WallManage from './unit/wall'\nimport type LineManage from './unit/line'\nimport type CylinderManage from './unit/cylinder'\nimport type PoiManage from './unit/poi'\nimport type CircleManage from './unit/circle'\nimport type AreaBoundingBoxManage from './unit/areaBoundingBox'\nimport type Inspection from './unit/inspection'\nimport { globalEvents } from './globalData'\nimport { SceneStyle, SceneTag } from './utils/constant'\nimport switchMaterial from './utils/switchMaterial'\nimport factoryGlobalObject from './globalControl'\nimport { debounce } from './utils'\n\nimport frag from './unit/glsl/heat/frag'\nimport vert from './unit/glsl/heat/ver'\n\ntype factory3dOption = {\n model: string\n environment: string\n decoderPath?: string\n controls?: any\n}\n\nconst vertexShader = `\n${ShaderChunk.logdepthbuf_pars_vertex}\nbool isPerspectiveMatrix(mat4) {\n return true;\n }\n varying vec2 vUv;\n varying vec3 vPosition;\n\n void main() {\n vUv = uv;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\n vec4 worldPosition1 = modelMatrix * vec4(position, 1.0);\n vPosition = worldPosition1.xyz;\n ${ShaderChunk.logdepthbuf_vertex}\n }\n`\n\n// Fragment shader\nconst fragmentShader = `\n ${ShaderChunk.logdepthbuf_pars_fragment} \n uniform sampler2D _Texture;\n uniform vec4 _Texture_ST;\n uniform vec4 _Color;\n uniform float _ColorS;\n uniform sampler2D _TextureMask;\n uniform float _MaskUV;\n uniform vec4 _ColorMask;\n uniform float _ColorMaskS;\n uniform vec4 _Speed;\n uniform float _OP;\n uniform float _Time;\n\n varying vec3 vPosition;\n varying vec2 vUv;\n\n void main() {\n vec3 temp_cast_0 = vec3(0.2);\n vec4 o = vec4(temp_cast_0, 1.0);\n vec2 uv_Texture = vUv * 8.0;\n vec4 tex2DNode1 = texture2D(_Texture, uv_Texture);\n vec2 temp_cast_1 = vec2(_MaskUV);\n vec2 uv_TexCoord7 = vUv * temp_cast_1;\n\n vec2 panner6 = (vec2(1.0) * _Time * _Speed.xy + uv_TexCoord7);\n\n o.rgb = ((_Color * tex2DNode1.r * _ColorS) + (_ColorMask * (tex2DNode1.r * texture2D(_TextureMask, panner6).r) * _ColorMaskS)).rgb;\n o.a = _OP;\n gl_FragColor = o;\n\n if(vPosition.x>-550.0 && vPosition.x<550.0 && vPosition.z>-300.0 && vPosition.z<270.0){\n gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);\n }\n\n ${ShaderChunk.logdepthbuf_fragment}\n }\n`\n\nconst _Texture = new TextureLoader().load('./demo03.jpg')\n\n_Texture.wrapS = RepeatWrapping\n_Texture.wrapT = RepeatWrapping\n\nconst uniforms = {\n _Texture: { value: _Texture },\n _Texture_ST: { value: new Vector4() },\n _Color: { value: new Vector4(new Color('#red').r, new Color('#fff').g, new Color('#fff').b, 0.1) },\n _ColorS: { value: 1 },\n _TextureMask: { value: new TextureLoader().load('./demo04.jpg') },\n _MaskUV: { value: 1 },\n _ColorMask: { value: new Vector4(new Color('#fff').r, new Color('#fff').g, new Color('#fff').b, 0.1) },\n _ColorMaskS: { value: 1 },\n _Speed: { value: new Vector4(0.0, 1.2, 0, 0) },\n _OP: { value: 1.0 },\n _Time: { value: 1.0 },\n}\n\nuse.useframe(() => {\n if (uniforms._Time.value > 0.3)\n uniforms._Time.value = 0\n\n uniforms._Time.value += 0.001\n})\n\nconst material = new ShaderMaterial({\n uniforms,\n vertexShader,\n fragmentShader,\n transparent: true,\n})\n\nexport const loadingManager = new LoadingManager()\nconst load = new ModelLoader(loadingManager)\nconst rgbeLoader = new lib.RGBELoader(loadingManager)\nconst { emitter } = utils\n\nconst resourcePath = './'\nconst resourcePath2 = 'http://172.16.223.163:9000/anov-prod/anov-3d/factory/example/'\n\nexport const usePath = resourcePath2\n\nclass Factory3D {\n position: Vector3 = new Vector3(0, 0, 0)\n scene: SceneControl\n control: OrbitControls\n cameraUtil: Camera\n\n public loadingManager = loadingManager\n public tag = SceneTag.overview\n public style: SceneStyle = SceneStyle.real\n private option: factory3dOption\n wall: WallManage\n line: LineManage\n cylinder: CylinderManage\n poi: PoiManage\n circle: CircleManage\n areaBoundingBox: AreaBoundingBoxManage\n inspection: Inspection\n\n usePath = usePath\n\n private pipeline: Group\n private realModl: Group\n private techModel: Group\n private realGroundModel: Group\n private realTreeModel: Group\n private thermaLimaging: Group\n private eventHandleFn: Map<string, ((args?: any) => void)[]> = new Map()\n private boxSkeyTexture: DataTexture\n\n interactionManager: InteractionManager\n\n constructor(option: factory3dOption) {\n this.option = option\n this.globalEventsAgent()\n factoryGlobalObject.setFactory(this)\n }\n\n /**\n * render factory 3d scene\n */\n renderScene(scene: SceneControl) {\n return new Promise((resolve) => {\n this.scene = scene\n\n this.cameraUtil = new Camera(scene.camera!, scene.controls!, scene)\n this.control = scene.controls!\n scene.camera.layers.set(0)\n\n load.loadGLTF(`${this.usePath}landScap3.glb`, false, true, './draco/', (gltf) => {\n this.realTreeModel = (gltf.scene) as Group\n\n // this.interactionManager.add(gltf.scene)\n\n // gltf.scene.addEventListener('click', (value) => {\n // this.position = value.point\n // })\n scene.add(this.realTreeModel)\n\n return gltf\n })\n\n const interactionManager = new InteractionManager(\n this.scene.renderer,\n this.scene.camera,\n this.scene.renderer.domElement, // Modified By LM this.scene.cssRenderer.cssRenderer.domElement,\n )\n\n this.interactionManager = interactionManager\n\n utils.storeManagement.set('interactionManager', interactionManager)\n\n use.useframe(() => {\n interactionManager.update()\n })\n\n this.loadModel()\n\n loadingManager.onLoad = () => {\n resolve('success')\n }\n\n scene.renderer.toneMappingExposure = 0.4\n })\n }\n\n private loadModel() {\n // real model\n load.loadGLTF(`${this.usePath}222.glb`, false, true, './draco/', (gltf) => {\n this.scene.add(gltf.scene)\n\n gltf.scene.visible = SceneStyle.real === this.style\n\n this.realModl = gltf.scene as Group\n\n // this.interactionManager.add(gltf.scene)\n\n // gltf.scene.addEventListener('click', (value) => {\n // this.position = value.point\n // })\n\n handleUnit.call(this)\n\n return gltf\n })\n\n // tech model\n load.loadGLTF(`${this.usePath}2222.glb`, false, true, './draco/', (gltf) => {\n const group = gltf.scene\n group.traverse((child) => {\n // @ts-ignore\n if (child.type === 'Mesh') {\n if (child.name === '柱体') {\n // @ts-ignore\n child.material = material\n child.renderOrder = -1\n }\n\n else {\n // @ts-ignore\n child.material = finirMaterialV1\n }\n }\n })\n\n this.scene.add(group)\n\n group.visible = SceneStyle.tech === this.style\n this.techModel = group as Group\n\n return gltf\n })\n\n // thermaLimaging model\n load.loadGLTF(`${this.usePath}2222.glb`, false, true, './draco/', (gltf) => {\n const group = gltf.scene\n group.traverse((child) => {\n if (child.type === 'Mesh') {\n // @ts-ignore\n child.material = new ShaderMaterial({\n vertexShader: vert,\n fragmentShader: frag,\n uniforms: {\n texture1: { value: new TextureLoader(this.loadingManager).load(`${this.usePath}test01.jpg`) },\n texture2: { value: new TextureLoader(this.loadingManager).load(`${this.usePath}test02.jpg`) },\n uvScale: { value: new Vector2(1, 1) },\n },\n depthTest: false,\n depthWrite: false,\n })\n\n child.layers.set(2)\n }\n })\n\n this.scene.add(group)\n\n this.thermaLimaging = group as Group\n\n return gltf\n })\n\n load.loadGLTF(`${this.usePath}guandao.glb`, false, true, './draco/', (gltf) => {\n this.scene.add(gltf.scene)\n\n this.pipeline = gltf.scene as Group\n return gltf\n })\n\n // ground\n load.loadGLTF(`${this.usePath}landScap.glb`, false, true, './draco/', (gltf) => {\n this.scene.add(gltf.scene)\n\n // this.interactionManager.add(gltf.scene)\n\n // gltf.scene.addEventListener('click', (value) => {\n // this.position = value.point\n // })\n\n this.realGroundModel = gltf.scene as Group\n return gltf\n })\n rgbeLoader.setPath(`${this.usePath}`).load('demo.hdr', (texture) => {\n texture.mapping = EquirectangularReflectionMapping\n\n texture.colorSpace = SRGBColorSpace\n this.boxSkeyTexture = texture\n this.scene.scene.environment = texture\n this.scene.scene.background = new Color('#ccc')\n })\n }\n\n /**\n * toggle SceneStyle\n * @param params\n */\n toggleSceneStyle(params: SceneStyle) {\n if (this.style === params)\n return\n\n this.style = params\n\n if (this.style === SceneStyle.tech) {\n this.pipeline.visible = false\n this.techModel.visible = true\n this.realModl.visible = false\n this.realTreeModel.visible = false\n this.scene.scene.background = null\n this.realGroundModel && (this.realGroundModel.visible = false)\n\n this.scene.renderer.toneMappingExposure = 0.6\n }\n\n if (params === SceneStyle.real) {\n this.pipeline.visible = true\n this.techModel.visible = false\n this.realModl.visible = true\n this.realGroundModel && (this.realGroundModel.visible = true)\n this.realTreeModel && (this.realTreeModel.visible = true)\n this.scene.scene.background = new Color('#ccc')\n this.scene.scene.environment = this.boxSkeyTexture\n\n this.scene.renderer.toneMappingExposure = 0.4\n }\n }\n\n public toggleTag(tag: SceneTag) {\n if (this.tag === tag)\n return\n toggleTag[tag].apply(this, [this])\n }\n\n private globalEventsAgent() {\n globalEvents.forEach((eventKey) => {\n emitter.on(eventKey, (args) => {\n this.eventHandleFn.get(eventKey)?.forEach((fn) => {\n fn(args)\n })\n })\n })\n }\n\n /**\n * toggle view\n */\n toggleView() {\n if (this.scene.cutoutCamera === this.inspection.minCamera) {\n const cutoutCamera = this.inspection.minCamera\n this.scene.cutoutCamera = this.scene.camera\n this.scene.camera = cutoutCamera\n // initPostEffects(this.scene.scene, this.scene.renderer, cutoutCamera, {\n // type: 'main',\n // })\n }\n else {\n const mainCamera = this.scene.cutoutCamera\n const cutoutCamera = this.inspection.minCamera\n\n this.scene.camera = mainCamera\n this.scene.cutoutCamera = cutoutCamera\n\n // initPostEffects(this.scene.scene, this.scene.renderer, cutoutCamera, {\n // type: 'sub',\n // })\n }\n }\n\n addEventListener(eventName: string, handleFn: (args?: any) => void) {\n if (this.eventHandleFn.get(eventName))\n this.eventHandleFn.get(eventName).push(handleFn)\n\n else\n this.eventHandleFn.set(eventName, [handleFn])\n }\n}\n\nexport default Factory3D"],"mappings":";;;;;;;AACA,SAAsBA,KAAK,EAAEC,gCAAgC,EAAEC,kBAAkB,EAAEC,cAAc,EAA2BC,WAAW,EAAEC,cAAc,EAAEC,cAAc,EAAEC,WAAW,EAAEC,cAAc,EAAEC,aAAa,EAAEC,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAEC,GAAG,EAAgBC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AACpS,SAASC,MAAM,QAAkD,kBAAkB;AACnF,SAASC,eAAe;AACxB,OAAOC,UAAU,IAAIC,SAAS,IAATA,UAAS;AAQ9B,SAASC,YAAY;AACrB,SAASC,UAAU,EAAEC,QAAQ;AAE7B,OAAOC,mBAAmB;AAG1B,OAAOC,IAAI;AACX,OAAOC,IAAI;AASX,IAAMC,YAAY,eAChBnB,WAAW,CAACoB,uBAAuB,0WAY1BpB,WAAW,CAACqB,kBAAkB,cAExC;;AAED;AACA,IAAMC,cAAc,iBAChBtB,WAAW,CAACuB,yBAAyB,+lCAkC/BvB,WAAW,CAACwB,oBAAoB,cAEzC;AAED,IAAMC,QAAQ,GAAG,IAAIvB,aAAa,EAAE,CAACwB,IAAI,CAAC,cAAc,CAAC;AAEzDD,QAAQ,CAACE,KAAK,GAAG7B,cAAc;AAC/B2B,QAAQ,CAACG,KAAK,GAAG9B,cAAc;AAE/B,IAAM+B,QAAQ,GAAG;EACfJ,QAAQ,EAAE;IAAEK,KAAK,EAAEL;EAAS,CAAC;EAC7BM,WAAW,EAAE;IAAED,KAAK,EAAE,IAAIzB,OAAO;EAAG,CAAC;EACrC2B,MAAM,EAAE;IAAEF,KAAK,EAAE,IAAIzB,OAAO,CAAC,IAAIZ,KAAK,CAAC,MAAM,CAAC,CAACwC,CAAC,EAAE,IAAIxC,KAAK,CAAC,MAAM,CAAC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IAAI,CAAC1D,KAAK,CAACI,MAAM;QAC3C,IAAI,CAACJ,KAAK,CAACI,MAAM,GAAGsD,YAAY;QAChC;QACA;QACA;MACF,CAAC,MACI;QACH,IAAMG,UAAU,GAAG,IAAI,CAAC7D,KAAK,CAAC0D,YAAY;QAC1C,IAAMA,aAAY,GAAG,IAAI,CAACC,UAAU,CAACC,SAAS;QAE9C,IAAI,CAAC5D,KAAK,CAACI,MAAM,GAAGyD,UAAU;QAC9B,IAAI,CAAC7D,KAAK,CAAC0D,YAAY,GAAGA,aAAY;;QAEtC;QACA;QACA;MACF;IACF;EAAC;IAAA;IAAA,OAED,0BAAiBI,SAAiB,EAAEC,QAA8B,EAAE;MAClE,IAAI,IAAI,CAACR,aAAa,CAACC,GAAG,CAACM,SAAS,CAAC,EACnC,IAAI,CAACP,aAAa,CAACC,GAAG,CAACM,SAAS,CAAC,CAACE,IAAI,CAACD,QAAQ,CAAC,MAGhD,IAAI,CAACR,aAAa,CAAC/C,GAAG,CAACsD,SAAS,EAAE,CAACC,QAAQ,CAAC,CAAC;IACjD;EAAC;EAAA;AAAA;AAGH,eAAetE,SAAS"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Color","CylinderGeometry","Group","Mesh","MeshBasicMaterial","PerspectiveCamera","ShaderMaterial","TubeGeometry","use","RoundLineGeometry","initPostEffects","fragmentShader","vertexShader","flyLinePoints","groundLinePoints","targetProgresspoints","InspectionObject","Inspection","gobal","Map","generateInspectionPath","makeGroundRoad","setInspectionCamera","inspectionObject","startInspection","curve","hide","viewElement","document","createElement","style","position","width","height","top","cursor","addEventListener","toggleView","flyLine","radius","close","groundLine","tube","mesh2","transparent","uniforms","alpha","value","centerColor","sideColor","otherColor","groundGroup","add","y","groundCurve","line","scene","anchorMesh","anchorGroup","Object","keys","forEach","key","demoPoints","getPointAt","Number","singleAnchorGroup","cylinder","color","cylinder1","name","set","x","z","anchorObject","minCamera","window","innerWidth","innerHeight","cutoutCamera","cutoutArea","layers","getLength","startMove","targetProgress","targetPosition","gotoTarget","isHide","body","appendChild","cutout","visible","model","contains","removeChild","camera","renderer","type","cutMain","check","useframe"],"sources":["../../../../src/factory/unit/inspection/index.ts"],"sourcesContent":["import type { Object3D, Vector3 } from '@anov/3d-core'\nimport { Color, CylinderGeometry, Group, Mesh, MeshBasicMaterial, MirroredRepeatWrapping, PerspectiveCamera, RepeatWrapping, ShaderChunk, ShaderMaterial, TextureLoader, TubeGeometry, use } from '@anov/3d-core'\nimport { RoundLineGeometry, addColorifyPass, createBloomSelectedTool, createHighSelectedTool, initPostEffects } from '@anov/3d-ability'\nimport type Factory3D from '../../3d'\nimport { usePath } from '../../3d'\nimport fragmentShader from '../glsl/highway/fragmentShader'\nimport vertexShader from '../glsl/highway/vertexShader'\nimport { flyLinePoints, groundLinePoints, targetProgresspoints } from './lineData'\nimport InspectionObject from './InspectionObject'\n\nclass Inspection {\n gobal: Factory3D\n inspectionObject\n curve\n groundCurve\n line: Group\n viewElement: HTMLDivElement\n isHide = true\n anchorObject: Map<string, Group> = new Map()\n anchorGroup: Group\n minCamera: PerspectiveCamera\n InspectionPathObject: Object3D\n\n constructor(gobal: Factory3D) {\n this.gobal = gobal\n this.generateInspectionPath()\n this.makeGroundRoad()\n this.setInspectionCamera()\n\n this.inspectionObject = new InspectionObject(this)\n\n this.startInspection(this.curve)\n this.hide()\n\n const viewElement = document.createElement('div')\n\n viewElement.style.position = 'absolute'\n viewElement.style.width = '200px'\n viewElement.style.height = '200px'\n viewElement.style.top = '100px'\n viewElement.style.cursor = 'pointer'\n\n viewElement.addEventListener('click', () => {\n this.gobal.toggleView()\n })\n\n this.viewElement = viewElement\n }\n\n /**\n * generate inspection path\n * @param linePosition\n */\n private generateInspectionPath() {\n const flyLine = new RoundLineGeometry(flyLinePoints, {\n radius: 20,\n close: true,\n })\n\n this.curve = flyLine.curve\n }\n\n /**\n * make ground road\n */\n private makeGroundRoad() {\n const groundLine = new RoundLineGeometry(groundLinePoints, {\n radius: 20,\n close: true,\n })\n\n const tube = new TubeGeometry(groundLine.curve, 10000, 4, 2, false)\n const mesh2 = new Mesh(tube, new ShaderMaterial({\n transparent: true,\n uniforms: {\n alpha: {\n value: 0.6,\n },\n centerColor: {\n value: new Color(0xFFFFFF),\n },\n sideColor: {\n value: new Color('#F75332'),\n },\n otherColor: {\n value: new Color('#D23F22'),\n },\n },\n vertexShader,\n fragmentShader,\n }))\n\n const groundGroup = new Group()\n\n groundGroup.add(mesh2)\n groundGroup.position.y = 3\n\n this.groundCurve = groundLine.curve\n this.line = groundGroup\n this.gobal.scene.add(groundGroup)\n\n this.anchorMesh()\n }\n\n private anchorMesh() {\n const anchorGroup = new Group()\n\n Object.keys(targetProgresspoints).forEach((key) => {\n const demoPoints = this.groundCurve.getPointAt(Number(key))\n const singleAnchorGroup = new Group()\n\n const cylinder = new Mesh(new CylinderGeometry(10, 10, 2, 64), new MeshBasicMaterial({ color: new Color('#cdccca') }))\n const cylinder1 = new Mesh(new CylinderGeometry(5, 5, 1, 64), new MeshBasicMaterial({ color: new Color('#fff') }))\n cylinder1.position.y = 2\n\n cylinder.name = 'cylinder'\n cylinder1.name = 'cylinder1'\n\n singleAnchorGroup.add(cylinder, cylinder1)\n singleAnchorGroup.position.set(demoPoints.x, demoPoints.y + 5, demoPoints.z)\n\n this.anchorObject.set(targetProgresspoints[key].name, singleAnchorGroup)\n anchorGroup.add(singleAnchorGroup)\n })\n this.anchorGroup = anchorGroup\n this.gobal.scene.add(anchorGroup)\n }\n\n private setInspectionCamera() {\n let minCamera\n\n if (this.minCamera) {\n minCamera = this.minCamera\n }\n else {\n minCamera = new PerspectiveCamera(60,\n window.innerWidth / window.innerHeight\n , 0.1, 1000)\n }\n\n this.gobal.scene.cutoutCamera = minCamera\n this.gobal.scene.cutoutArea = { x: 0, y: 0, width: 200, height: 200 }\n this.gobal.scene.add(minCamera)\n\n this.minCamera = minCamera\n\n this.minCamera.layers.set(0)\n }\n\n get getPathLength() {\n return this.curve.getLength()\n }\n\n startInspection(line) {\n this.setInspectionCamera()\n this.inspectionObject.startMove(line)\n }\n\n goToInspectionTarget(targetProgress: number) {\n const targetPosition = this.curve.getPointAt(targetProgress)\n this.inspectionObject.gotoTarget(targetPosition, targetProgress)\n }\n\n show() {\n this.isHide = false\n\n document.body.appendChild(this.viewElement)\n this.gobal.scene.cutout = true\n this.anchorGroup.visible = true\n this.line.visible = true\n this.inspectionObject.model && (this.inspectionObject.model.visible = true)\n }\n\n hide() {\n this.isHide = true\n\n if (this.viewElement && document.body.contains(this.viewElement))\n document.body.removeChild(this.viewElement)\n\n if (this.gobal.scene.camera === this.minCamera) {\n this.gobal.scene.camera = this.gobal.scene.cutoutCamera\n this.gobal.scene.cutoutCamera = this.minCamera\n\n initPostEffects(this.gobal.scene.scene, this.gobal.scene.renderer, this.gobal.scene.cutoutCamera, {\n type: 'sub',\n })\n }\n\n this.gobal.scene.cutout = false\n this.gobal.scene.cutMain(this.gobal.scene.renderer)\n this.line.visible = false\n this.anchorGroup.visible = false\n\n // this.addeHighSelected([])\n const check = use.useframe(() => {\n if (this.inspectionObject.model) {\n this.inspectionObject.model.visible = false\n check()\n }\n })\n }\n}\n\nexport default Inspection"],"mappings":";;;;;;;AACA,SAASA,KAAK,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,IAAI,EAAEC,iBAAiB,EAA0BC,iBAAiB,EAA+BC,cAAc,EAAiBC,YAAY,EAAEC,GAAG,QAAQ,eAAe;AACjN,SAASC,iBAAiB,EAAoEC,eAAe,QAAQ,kBAAkB;AAGvI,OAAOC,cAAc;AACrB,OAAOC,YAAY;AACnB,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,oBAAoB;AAC9D,OAAOC,gBAAgB;AAA0B,IAE3CC,UAAU;EAad,oBAAYC,KAAgB,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,gCANrB,IAAI;IAAA,sCACsB,IAAIC,GAAG,EAAE;IAAA;IAAA;IAAA;I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BAAgB,CAACqE,KAAK,EAAE;UAC/B,MAAI,CAACrE,gBAAgB,CAACqE,KAAK,CAACD,OAAO,GAAG,KAAK;UAC3CQ,KAAK,EAAE;QACT;MACF,CAAC,CAAC;IACJ;EAAC;EAAA;AAAA;AAGH,eAAelF,UAAU"}
|
|
1
|
+
{"version":3,"names":["Color","CylinderGeometry","Group","Mesh","MeshBasicMaterial","PerspectiveCamera","ShaderMaterial","TubeGeometry","use","RoundLineGeometry","initPostEffects","fragmentShader","vertexShader","flyLinePoints","groundLinePoints","targetProgresspoints","InspectionObject","Inspection","gobal","Map","generateInspectionPath","makeGroundRoad","setInspectionCamera","inspectionObject","startInspection","curve","hide","viewElement","document","createElement","style","position","width","height","top","cursor","addEventListener","toggleView","flyLine","radius","close","groundLine","tube","mesh2","transparent","uniforms","alpha","value","centerColor","sideColor","otherColor","groundGroup","add","y","groundCurve","line","scene","anchorMesh","anchorGroup","Object","keys","forEach","key","demoPoints","getPointAt","Number","singleAnchorGroup","cylinder","color","cylinder1","name","set","x","z","anchorObject","minCamera","window","innerWidth","innerHeight","cutoutCamera","cutoutArea","layers","getLength","startMove","targetProgress","targetPosition","gotoTarget","isHide","body","appendChild","cutout","visible","model","contains","removeChild","camera","renderer","type","cutMain","check","useframe"],"sources":["../../../../src/factory/unit/inspection/index.ts"],"sourcesContent":["import type { Object3D, Vector3 } from '@anov/3d-core'\nimport { BoxGeometry, Color, CylinderGeometry, Group, Mesh, MeshBasicMaterial, MirroredRepeatWrapping, PerspectiveCamera, PlaneGeometry, RepeatWrapping, ShaderChunk, ShaderMaterial, TextureLoader, TubeGeometry, lib, use } from '@anov/3d-core'\nimport { RoundLineGeometry, addColorifyPass, createBloomSelectedTool, createHighSelectedTool, initPostEffects } from '@anov/3d-ability'\nimport type Factory3D from '../../3d'\nimport { usePath } from '../../3d'\nimport fragmentShader from '../glsl/highway/fragmentShader'\nimport vertexShader from '../glsl/highway/vertexShader'\nimport { flyLinePoints, groundLinePoints, targetProgresspoints } from './lineData'\nimport InspectionObject from './InspectionObject'\n\nclass Inspection {\n gobal: Factory3D\n inspectionObject\n curve\n groundCurve\n line: Group\n viewElement: HTMLDivElement\n isHide = true\n anchorObject: Map<string, Group> = new Map()\n anchorGroup: Group\n minCamera: PerspectiveCamera\n InspectionPathObject: Object3D\n\n constructor(gobal: Factory3D) {\n this.gobal = gobal\n this.generateInspectionPath()\n this.makeGroundRoad()\n this.setInspectionCamera()\n\n this.inspectionObject = new InspectionObject(this)\n\n this.startInspection(this.curve)\n this.hide()\n\n const viewElement = document.createElement('div')\n\n viewElement.style.position = 'absolute'\n viewElement.style.width = '200px'\n viewElement.style.height = '200px'\n viewElement.style.top = '100px'\n viewElement.style.cursor = 'pointer'\n\n viewElement.addEventListener('click', () => {\n this.gobal.toggleView()\n })\n\n this.viewElement = viewElement\n }\n\n /**\n * generate inspection path\n * @param linePosition\n */\n private generateInspectionPath() {\n const flyLine = new RoundLineGeometry(flyLinePoints, {\n radius: 20,\n close: true,\n })\n\n this.curve = flyLine.curve\n }\n\n /**\n * make ground road\n */\n private makeGroundRoad() {\n const groundLine = new RoundLineGeometry(groundLinePoints, {\n radius: 20,\n close: true,\n })\n\n const tube = new TubeGeometry(groundLine.curve, 10000, 4, 2, false)\n\n const mesh2 = new Mesh(tube, new ShaderMaterial({\n transparent: true,\n uniforms: {\n alpha: {\n value: 0.6,\n },\n centerColor: {\n value: new Color(0xFFFFFF),\n },\n sideColor: {\n value: new Color('#F75332'),\n },\n otherColor: {\n value: new Color('#D23F22'),\n },\n },\n vertexShader,\n fragmentShader,\n }))\n\n const groundGroup = new Group()\n\n groundGroup.add(mesh2)\n groundGroup.position.y = 3\n\n this.groundCurve = groundLine.curve\n this.line = groundGroup\n this.gobal.scene.add(groundGroup)\n\n this.anchorMesh()\n }\n\n private anchorMesh() {\n const anchorGroup = new Group()\n\n Object.keys(targetProgresspoints).forEach((key) => {\n const demoPoints = this.groundCurve.getPointAt(Number(key))\n const singleAnchorGroup = new Group()\n\n const cylinder = new Mesh(new CylinderGeometry(10, 10, 2, 64), new MeshBasicMaterial({ color: new Color('#cdccca') }))\n const cylinder1 = new Mesh(new CylinderGeometry(5, 5, 1, 64), new MeshBasicMaterial({ color: new Color('#fff') }))\n cylinder1.position.y = 2\n\n cylinder.name = 'cylinder'\n cylinder1.name = 'cylinder1'\n\n singleAnchorGroup.add(cylinder, cylinder1)\n singleAnchorGroup.position.set(demoPoints.x, demoPoints.y + 5, demoPoints.z)\n\n this.anchorObject.set(targetProgresspoints[key].name, singleAnchorGroup)\n anchorGroup.add(singleAnchorGroup)\n })\n this.anchorGroup = anchorGroup\n this.gobal.scene.add(anchorGroup)\n }\n\n private setInspectionCamera() {\n let minCamera\n\n if (this.minCamera) {\n minCamera = this.minCamera\n }\n else {\n minCamera = new PerspectiveCamera(60,\n window.innerWidth / window.innerHeight\n , 0.1, 1000)\n }\n\n this.gobal.scene.cutoutCamera = minCamera\n this.gobal.scene.cutoutArea = { x: 0, y: 0, width: 200, height: 200 }\n this.gobal.scene.add(minCamera)\n\n this.minCamera = minCamera\n\n this.minCamera.layers.set(0)\n }\n\n get getPathLength() {\n return this.curve.getLength()\n }\n\n startInspection(line) {\n this.setInspectionCamera()\n this.inspectionObject.startMove(line)\n }\n\n goToInspectionTarget(targetProgress: number) {\n const targetPosition = this.curve.getPointAt(targetProgress)\n this.inspectionObject.gotoTarget(targetPosition, targetProgress)\n }\n\n show() {\n this.isHide = false\n\n document.body.appendChild(this.viewElement)\n this.gobal.scene.cutout = true\n this.anchorGroup.visible = true\n this.line.visible = true\n this.inspectionObject.model && (this.inspectionObject.model.visible = true)\n }\n\n hide() {\n this.isHide = true\n\n if (this.viewElement && document.body.contains(this.viewElement))\n document.body.removeChild(this.viewElement)\n\n if (this.gobal.scene.camera === this.minCamera) {\n this.gobal.scene.camera = this.gobal.scene.cutoutCamera\n this.gobal.scene.cutoutCamera = this.minCamera\n\n initPostEffects(this.gobal.scene.scene, this.gobal.scene.renderer, this.gobal.scene.cutoutCamera, {\n type: 'sub',\n })\n }\n\n this.gobal.scene.cutout = false\n this.gobal.scene.cutMain(this.gobal.scene.renderer)\n this.line.visible = false\n this.anchorGroup.visible = false\n\n // this.addeHighSelected([])\n const check = use.useframe(() => {\n if (this.inspectionObject.model) {\n this.inspectionObject.model.visible = false\n check()\n }\n })\n }\n}\n\nexport default Inspection"],"mappings":";;;;;;;AACA,SAAsBA,KAAK,EAAEC,gBAAgB,EAAEC,KAAK,EAAEC,IAAI,EAAEC,iBAAiB,EAA0BC,iBAAiB,EAA8CC,cAAc,EAAiBC,YAAY,EAAOC,GAAG,QAAQ,eAAe;AAClP,SAASC,iBAAiB,EAAoEC,eAAe,QAAQ,kBAAkB;AAGvI,OAAOC,cAAc;AACrB,OAAOC,YAAY;AACnB,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,oBAAoB;AAC9D,OAAOC,gBAAgB;AAA0B,IAE3CC,UAAU;EAad,oBAAYC,KAAgB,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,gCANrB,IAAI;IAAA,sCACsB,IAAIC,GAAG,EAAE;IAAA;IAAA;IAAA;IAM1C,IAAI,CAACD,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACE,sBAAsB,EAAE;IAC7B,IAAI,CAACC,cAAc,EAAE;IACrB,IAAI,CAACC,mBAAmB,EAAE;IAE1B,IAAI,CAACC,gBAAgB,GAAG,IAAIP,gBAAgB,CAAC,IAAI,CAAC;IAElD,IAAI,CAACQ,eAAe,CAAC,IAAI,CAACC,KAAK,CAAC;IAChC,IAAI,CAACC,IAAI,EAAE;IAEX,IAAMC,WAAW,GAAGC,QAAQ,CAACC,aAAa,CAAC,KAAK,CAAC;IAEjDF,WAAW,CAACG,KAAK,CAACC,QAAQ,GAAG,UAAU;IACvCJ,WAAW,CAACG,KAAK,CAACE,KAAK,GAAG,OAAO;IACjCL,WAAW,CAACG,KAAK,CAACG,MAAM,GAAG,OAAO;IAClCN,WAAW,C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AAC7E,KAAK,CAACsC,KAAK,CAACuB,YAAY;QACvD,IAAI,CAAC7D,KAAK,CAACsC,KAAK,CAACuB,YAAY,GAAG,IAAI,CAACJ,SAAS;QAE9CjE,eAAe,CAAC,IAAI,CAACQ,KAAK,CAACsC,KAAK,CAACA,KAAK,EAAE,IAAI,CAACtC,KAAK,CAACsC,KAAK,CAACwC,QAAQ,EAAE,IAAI,CAAC9E,KAAK,CAACsC,KAAK,CAACuB,YAAY,EAAE;UAChGkB,IAAI,EAAE;QACR,CAAC,CAAC;MACJ;MAEA,IAAI,CAAC/E,KAAK,CAACsC,KAAK,CAACkC,MAAM,GAAG,KAAK;MAC/B,IAAI,CAACxE,KAAK,CAACsC,KAAK,CAAC0C,OAAO,CAAC,IAAI,CAAChF,KAAK,CAACsC,KAAK,CAACwC,QAAQ,CAAC;MACnD,IAAI,CAACzC,IAAI,CAACoC,OAAO,GAAG,KAAK;MACzB,IAAI,CAACjC,WAAW,CAACiC,OAAO,GAAG,KAAK;;MAEhC;MACA,IAAMQ,KAAK,GAAG3F,GAAG,CAAC4F,QAAQ,CAAC,YAAM;QAC/B,IAAI,MAAI,CAAC7E,gBAAgB,CAACqE,KAAK,EAAE;UAC/B,MAAI,CAACrE,gBAAgB,CAACqE,KAAK,CAACD,OAAO,GAAG,KAAK;UAC3CQ,KAAK,EAAE;QACT;MACF,CAAC,CAAC;IACJ;EAAC;EAAA;AAAA;AAGH,eAAelF,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anov/3d",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"anov-heat-map": "^0.0.1",
|
|
22
22
|
"localforage": "^1.10.0",
|
|
23
23
|
"uuid": "^9.0.1",
|
|
24
|
-
"@anov/3d-
|
|
25
|
-
"@anov/3d-
|
|
24
|
+
"@anov/3d-ability": "^0.0.13",
|
|
25
|
+
"@anov/3d-core": "^0.0.11"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/uuid": "^9.0.7"
|