@anov/3d 0.0.47 → 0.0.49
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/applicationApi.d.ts
CHANGED
package/dist/applicationApi.js
CHANGED
|
@@ -13,6 +13,7 @@ import { MessageType, sendToMessage } from "./utils/messageFn";
|
|
|
13
13
|
import { EMessageStatus } from "./messageStatus";
|
|
14
14
|
import Factory3D from "./factory/3d";
|
|
15
15
|
import Anov3D, { defaultCameraParams } from "./index";
|
|
16
|
+
var storeManagement = utils.storeManagement;
|
|
16
17
|
var Application = /*#__PURE__*/function () {
|
|
17
18
|
function Application(opts) {
|
|
18
19
|
_classCallCheck(this, Application);
|
|
@@ -54,6 +55,7 @@ var Application = /*#__PURE__*/function () {
|
|
|
54
55
|
});
|
|
55
56
|
this.iEngine = anov3D;
|
|
56
57
|
this.iEngine.zoomRatio = (_set$zoomRatio = set === null || set === void 0 ? void 0 : set.zoomRatio) !== null && _set$zoomRatio !== void 0 ? _set$zoomRatio : 1;
|
|
58
|
+
storeManagement.set('container', this.container);
|
|
57
59
|
var caseInstance = this.loadCase(anov3D, params);
|
|
58
60
|
|
|
59
61
|
// @ts-ignore
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["utils","getFnByFnkey","MessageType","sendToMessage","EMessageStatus","Factory3D","Anov3D","defaultCameraParams","Application","opts","container","el","Api","Success","params","id","camera","set","cameraParams","fov","near","far","position","target","anov3D","model","case","size","width","clientWidth","height","clientHeight","environment","weather","time","controls","iEngine","zoomRatio","caseInstance","loadCase","loadingManager","onLoad","onProgress","_","loaded","total","progress","Event","undefined","error","EventHandleFailed","console","req","name","init","Error","fn","res","Promise","resolve","then","failMessage","message","eventName","cb","
|
|
1
|
+
{"version":3,"names":["utils","getFnByFnkey","MessageType","sendToMessage","EMessageStatus","Factory3D","Anov3D","defaultCameraParams","storeManagement","Application","opts","container","el","Api","Success","params","id","camera","set","cameraParams","fov","near","far","position","target","anov3D","model","case","size","width","clientWidth","height","clientHeight","environment","weather","time","controls","iEngine","zoomRatio","caseInstance","loadCase","loadingManager","onLoad","onProgress","_","loaded","total","progress","Event","undefined","error","EventHandleFailed","console","req","name","init","Error","fn","res","Promise","resolve","then","failMessage","message","eventName","cb","option","factory","envMaps","imgBox","decoderPath","renderScene","sceneControl","createInstance"],"sources":["../src/applicationApi.ts"],"sourcesContent":["import { utils } from '@anov/3d-core'\nimport { getFnByFnkey } from './utils/index'\nimport { MessageType, sendToMessage } from './utils/messageFn'\nimport { EMessageStatus } from './messageStatus'\nimport Factory3D from './factory/3d'\nimport Anov3D, { defaultCameraParams } from './index'\n\nconst { storeManagement } = utils\n\ntype ApplicationOptions = {\n el: HTMLElement\n}\n\nexport type InitOptions = {\n case?: string // 案例名称,用于兼容init直接加载项目\n camera?: {\n fov?: number\n near?: number\n far?: number\n position?: [\n number,\n number,\n number,\n ]\n target?: [\n number,\n number,\n number,\n ]\n }\n model?: string\n decoderPath?: string // DRACO压缩 资源文件路径\n size?: {\n width: number\n height: number\n }\n environment?: {\n weather?: string\n time?: number\n }\n envMaps: {\n use?: boolean\n imgBox?: Array<string> | string\n }\n controls: {\n // 相机缩放范围\n minDistance?: number\n maxDistance?: number\n // 上下旋转范围\n minPolarAngle?: number// 默认值0\n maxPolarAngle?: number\n // 左右旋转范围\n minAzimuthAngle?: number\n maxAzimuthAngle?: number\n }\n set?: {\n zoomRatio?: number\n }\n}\n\nclass Application {\n container: HTMLElement\n iEngine: Anov3D | undefined\n\n constructor(opts: ApplicationOptions) {\n this.container = opts.el\n\n sendToMessage(MessageType.Api, 'engineReady', EMessageStatus.Success)\n }\n\n private init(params: InitOptions, id: string) {\n try {\n const { camera = {}, set } = params || {}\n\n const cameraParams = {\n fov: camera.fov ?? defaultCameraParams.fov,\n near: camera.near ?? defaultCameraParams.near,\n far: camera.far ?? defaultCameraParams.far,\n position: camera.position,\n target: camera.target,\n }\n\n const anov3D = new Anov3D({\n container: this.container,\n model: params.case ? '' : params?.model, // temporary solution by LM\n size: {\n width: params?.size?.width ?? this.container.clientWidth,\n height: params?.size?.height ?? this.container.clientHeight,\n },\n camera: {\n ...cameraParams,\n },\n environment: {\n weather: params?.environment?.weather,\n time: params?.environment?.time,\n },\n controls: params.controls,\n })\n\n this.iEngine = anov3D\n this.iEngine.zoomRatio = set?.zoomRatio ?? 1\n\n storeManagement.set('container', this.container)\n const caseInstance = this.loadCase(anov3D, params)\n\n // @ts-ignore\n this.iEngine.caseInstance = caseInstance\n\n caseInstance.loadingManager.onLoad = () => {\n sendToMessage(MessageType.Api, 'core.init', EMessageStatus.Success, id)\n }\n\n caseInstance.loadingManager.onProgress = (_, loaded, total) => {\n const progress = loaded / total\n\n sendToMessage(MessageType.Event, 'onInitProgress', EMessageStatus.Success, undefined, {\n progress,\n })\n }\n }\n catch (error) {\n sendToMessage(MessageType.Api, 'core.init', EMessageStatus.EventHandleFailed)\n console.error(error)\n }\n }\n\n sendMessage(req: { name: string; id: string; params: any }) {\n if (req.name === 'Core.init' || req.name === 'core.init') {\n this.init(req.params, req.id)\n return\n }\n\n if (!this.iEngine)\n throw new Error('please init first!')\n\n const fn = getFnByFnkey(this.iEngine, req.name, req.id) as any\n\n try {\n const res = fn(req.params)\n\n Promise.resolve(res).then((res) => {\n sendToMessage(MessageType.Api, req.name, EMessageStatus.Success, req.id, res)\n })\n }\n catch (error: any) {\n sendToMessage(MessageType.Api, req.name, EMessageStatus.EventHandleFailed, req.id, {\n failMessage: error.message,\n })\n }\n }\n\n receiveMessage(eventName: string, cb: (params: any) => void) {\n utils.storeManagement.set(eventName, cb)\n }\n\n // 此方法 用于直接加载案例\n private loadCase(anov3D: Anov3D, option: InitOptions) {\n switch (option.case) {\n case 'factory':\n\n // eslint-disable-next-line no-case-declarations\n const factory = new Factory3D({ model: option.model, environment: option.envMaps.imgBox as string, decoderPath: option.decoderPath, controls: option.controls })\n factory.renderScene(anov3D.sceneControl)\n return factory\n }\n }\n}\n\n/**\n * createInstance\n * @returns\n */\nexport const createInstance = (opts: ApplicationOptions): Application => {\n return new Application(opts)\n}\n"],"mappings":";;;;;;;;;AAAA,SAASA,KAAK,QAAQ,eAAe;AACrC,SAASC,YAAY;AACrB,SAASC,WAAW,EAAEC,aAAa;AACnC,SAASC,cAAc;AACvB,OAAOC,SAAS;AAChB,OAAOC,MAAM,IAAIC,mBAAmB;AAEpC,IAAQC,eAAe,GAAKR,KAAK,CAAzBQ,eAAe;AAAU,IAqD3BC,WAAW;EAIf,qBAAYC,IAAwB,EAAE;IAAA;IAAA;IAAA;IACpC,IAAI,CAACC,SAAS,GAAGD,IAAI,CAACE,EAAE;IAExBT,aAAa,CAACD,WAAW,CAACW,GAAG,EAAE,aAAa,EAAET,cAAc,CAACU,OAAO,CAAC;EACvE;EAAC;IAAA;IAAA,OAED,cAAaC,MAAmB,EAAEC,EAAU,EAAE;MAC5C,IAAI;QAAA;QACF,WAA6BD,MAAM,IAAI,CAAC,CAAC;UAAA,mBAAjCE,MAAM;UAANA,MAAM,4BAAG,CAAC,CAAC;UAAEC,GAAG,QAAHA,GAAG;QAExB,IAAMC,YAAY,GAAG;UACnBC,GAAG,iBAAEH,MAAM,CAACG,GAAG,qDAAIb,mBAAmB,CAACa,GAAG;UAC1CC,IAAI,kBAAEJ,MAAM,CAACI,IAAI,uDAAId,mBAAmB,CAACc,IAAI;UAC7CC,GAAG,iBAAEL,MAAM,CAACK,GAAG,qDAAIf,mBAAmB,CAACe,GAAG;UAC1CC,QAAQ,EAAEN,MAAM,CAACM,QAAQ;UACzBC,MAAM,EAAEP,MAAM,CAACO;QACjB,CAAC;QAED,IAAMC,MAAM,GAAG,IAAInB,MAAM,CAAC;UACxBK,SAAS,EAAE,IAAI,CAACA,SAAS;UACzBe,KAAK,EAAEX,MAAM,CAACY,IAAI,GAAG,EAAE,GAAGZ,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEW,KAAK;UAAE;UACzCE,IAAI,EAAE;YACJC,KAAK,wBAAEd,MAAM,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F;EAAC;IAAA;IAAA,OAED,wBAAeC,SAAiB,EAAEC,EAAyB,EAAE;MAC3DjE,KAAK,CAACQ,eAAe,CAACU,GAAG,CAAC8C,SAAS,EAAEC,EAAE,CAAC;IAC1C;;IAEA;EAAA;IAAA;IAAA,OACA,kBAAiBxC,MAAc,EAAEyC,MAAmB,EAAE;MACpD,QAAQA,MAAM,CAACvC,IAAI;QACjB,KAAK,SAAS;UAEZ;UACA,IAAMwC,OAAO,GAAG,IAAI9D,SAAS,CAAC;YAAEqB,KAAK,EAAEwC,MAAM,CAACxC,KAAK;YAAEO,WAAW,EAAEiC,MAAM,CAACE,OAAO,CAACC,MAAgB;YAAEC,WAAW,EAAEJ,MAAM,CAACI,WAAW;YAAElC,QAAQ,EAAE8B,MAAM,CAAC9B;UAAS,CAAC,CAAC;UAChK+B,OAAO,CAACI,WAAW,CAAC9C,MAAM,CAAC+C,YAAY,CAAC;UACxC,OAAOL,OAAO;MAAA;IAEpB;EAAC;EAAA;AAAA;AAGH;AACA;AACA;AACA;AACA,OAAO,IAAMM,cAAc,GAAG,SAAjBA,cAAc,CAAI/D,IAAwB,EAAkB;EACvE,OAAO,IAAID,WAAW,CAACC,IAAI,CAAC;AAC9B,CAAC"}
|
|
@@ -5,12 +5,13 @@ 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, CylinderGeometry, Group, Mesh, MeshBasicMaterial, PerspectiveCamera, ShaderMaterial, TubeGeometry, use } from '@anov/3d-core';
|
|
8
|
+
import { Color, CylinderGeometry, Group, Mesh, MeshBasicMaterial, PerspectiveCamera, ShaderMaterial, TubeGeometry, use, utils } from '@anov/3d-core';
|
|
9
9
|
import { RoundLineGeometry, initPostEffects } from '@anov/3d-ability';
|
|
10
10
|
import fragmentShader from "../glsl/highway/fragmentShader";
|
|
11
11
|
import vertexShader from "../glsl/highway/vertexShader";
|
|
12
12
|
import { flyLinePoints, groundLinePoints, targetProgresspoints } from "./lineData";
|
|
13
13
|
import InspectionObject from "./InspectionObject";
|
|
14
|
+
var storeManagement = utils.storeManagement;
|
|
14
15
|
var Inspection = /*#__PURE__*/function () {
|
|
15
16
|
function Inspection(gobal) {
|
|
16
17
|
var _this = this;
|
|
@@ -34,12 +35,14 @@ var Inspection = /*#__PURE__*/function () {
|
|
|
34
35
|
this.inspectionObject = new InspectionObject(this);
|
|
35
36
|
this.startInspection(this.curve);
|
|
36
37
|
this.hide();
|
|
38
|
+
var container = storeManagement.get('container');
|
|
37
39
|
var viewElement = document.createElement('div');
|
|
38
40
|
viewElement.style.position = 'absolute';
|
|
39
|
-
viewElement.style.width = '
|
|
41
|
+
viewElement.style.width = '500px';
|
|
40
42
|
viewElement.style.height = '200px';
|
|
41
|
-
viewElement.style.top = '100px';
|
|
42
43
|
viewElement.style.cursor = 'pointer';
|
|
44
|
+
viewElement.style.top = "".concat(container.offsetTop, "px");
|
|
45
|
+
viewElement.style.left = "".concat(container.offsetLeft, "px");
|
|
43
46
|
viewElement.addEventListener('click', function () {
|
|
44
47
|
_this.gobal.toggleView();
|
|
45
48
|
});
|
|
@@ -131,6 +134,7 @@ var Inspection = /*#__PURE__*/function () {
|
|
|
131
134
|
}, {
|
|
132
135
|
key: "setInspectionCamera",
|
|
133
136
|
value: function setInspectionCamera() {
|
|
137
|
+
var _app$envServer$scaleR, _window, _window$app, _window$app$envServer;
|
|
134
138
|
var minCamera;
|
|
135
139
|
if (this.minCamera) {
|
|
136
140
|
minCamera = this.minCamera;
|
|
@@ -138,11 +142,12 @@ var Inspection = /*#__PURE__*/function () {
|
|
|
138
142
|
minCamera = new PerspectiveCamera(60, window.innerWidth / window.innerHeight, 0.1, 1000);
|
|
139
143
|
}
|
|
140
144
|
this.gobal.scene.cutoutCamera = minCamera;
|
|
145
|
+
var scale = (_app$envServer$scaleR = (_window = window) === null || _window === void 0 ? void 0 : (_window$app = _window.app) === null || _window$app === void 0 ? void 0 : (_window$app$envServer = _window$app.envServer) === null || _window$app$envServer === void 0 ? void 0 : _window$app$envServer.scaleRatio) !== null && _app$envServer$scaleR !== void 0 ? _app$envServer$scaleR : 1;
|
|
141
146
|
this.gobal.scene.cutoutArea = {
|
|
142
|
-
x:
|
|
143
|
-
y:
|
|
144
|
-
width:
|
|
145
|
-
height: 200
|
|
147
|
+
x: 40 / scale,
|
|
148
|
+
y: 100 / scale,
|
|
149
|
+
width: 500 / scale,
|
|
150
|
+
height: 200 / scale
|
|
146
151
|
};
|
|
147
152
|
this.gobal.scene.add(minCamera);
|
|
148
153
|
this.minCamera = minCamera;
|
|
@@ -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","groundMaterial","transparent","uniforms","u_time","value","alpha","centerColor","sideColor","otherColor","mesh2","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 groundMaterial\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 groundMaterial = new ShaderMaterial({\n transparent: true,\n uniforms: {\n u_time: {\n value: 0,\n },\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 const mesh2 = new Mesh(tube, groundMaterial)\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 this.groundMaterial = groundMaterial\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;EAcd,oBAAYC,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,IAAI,CAAClF,KAAK,CAACwC,KAAK,CAACwC,QAAQ,CAAC;MACnD,IAAI,CAACzC,IAAI,CAACoC,OAAO,GAAG,KAAK;MACzB,IAAI,CAACjC,WAAW,CAACiC,OAAO,GAAG,KAAK;;MAEhC;MACA,IAAMQ,KAAK,GAAG7F,GAAG,CAAC8F,QAAQ,CAAC,YAAM;QAC/B,IAAI,MAAI,CAAC/E,gBAAgB,CAACuE,KAAK,EAAE;UAC/B,MAAI,CAACvE,gBAAgB,CAACuE,KAAK,CAACD,OAAO,GAAG,KAAK;UAC3CQ,KAAK,EAAE;QACT;MACF,CAAC,CAAC;IACJ;EAAC;EAAA;AAAA;AAGH,eAAepF,UAAU"}
|
|
1
|
+
{"version":3,"names":["Color","CylinderGeometry","Group","Mesh","MeshBasicMaterial","PerspectiveCamera","ShaderMaterial","TubeGeometry","use","utils","RoundLineGeometry","initPostEffects","fragmentShader","vertexShader","flyLinePoints","groundLinePoints","targetProgresspoints","InspectionObject","storeManagement","Inspection","gobal","Map","generateInspectionPath","makeGroundRoad","setInspectionCamera","inspectionObject","startInspection","curve","hide","container","get","viewElement","document","createElement","style","position","width","height","cursor","top","offsetTop","left","offsetLeft","addEventListener","toggleView","flyLine","radius","close","groundLine","tube","groundMaterial","transparent","uniforms","u_time","value","alpha","centerColor","sideColor","otherColor","mesh2","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","scale","app","envServer","scaleRatio","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, PlaneGeometry, RepeatWrapping, ShaderChunk, ShaderMaterial, TextureLoader, TubeGeometry, lib, use, utils } 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\nconst { storeManagement } = utils\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 groundMaterial\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 container = storeManagement.get<HTMLElement>('container')\n\n const viewElement = document.createElement('div')\n viewElement.style.position = 'absolute'\n viewElement.style.width = '500px'\n viewElement.style.height = '200px'\n viewElement.style.cursor = 'pointer'\n viewElement.style.top = `${container.offsetTop}px`\n viewElement.style.left = `${container.offsetLeft}px`\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 groundMaterial = new ShaderMaterial({\n transparent: true,\n uniforms: {\n u_time: {\n value: 0,\n },\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 const mesh2 = new Mesh(tube, groundMaterial)\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 this.groundMaterial = groundMaterial\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\n const scale = (window as any)?.app?.envServer?.scaleRatio ?? 1\n\n this.gobal.scene.cutoutArea = { x: 40 / scale, y: 100 / scale, width: 500 / scale, height: 200 / scale }\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,EAA8CC,cAAc,EAAiBC,YAAY,EAAOC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AAC5O,SAASC,iBAAiB,EAAoEC,eAAe,QAAQ,kBAAkB;AAGvI,OAAOC,cAAc;AACrB,OAAOC,YAAY;AACnB,SAASC,aAAa,EAAEC,gBAAgB,EAAEC,oBAAoB;AAC9D,OAAOC,gBAAgB;AAEvB,IAAQC,eAAe,GAAKT,KAAK,CAAzBS,eAAe;AAAU,IAE3BC,UAAU;EAcd,oBAAYC,KAAgB,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA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KAAK,EAAE,IAAI,CAAC7C,KAAK,CAAC6C,KAAK,CAAC4C,QAAQ,EAAE,IAAI,CAACzF,KAAK,CAAC6C,KAAK,CAACuB,YAAY,EAAE;UAChGsB,IAAI,EAAE;QACR,CAAC,CAAC;MACJ;MAEA,IAAI,CAAC1F,KAAK,CAAC6C,KAAK,CAACsC,MAAM,GAAG,KAAK;MAC/B,IAAI,CAACnF,KAAK,CAAC6C,KAAK,CAAC8C,OAAO,CAAC,IAAI,CAAC3F,KAAK,CAAC6C,KAAK,CAAC4C,QAAQ,CAAC;MACnD,IAAI,CAAC7C,IAAI,CAACwC,OAAO,GAAG,KAAK;MACzB,IAAI,CAACrC,WAAW,CAACqC,OAAO,GAAG,KAAK;;MAEhC;MACA,IAAMQ,KAAK,GAAGxG,GAAG,CAACyG,QAAQ,CAAC,YAAM;QAC/B,IAAI,MAAI,CAACxF,gBAAgB,CAACgF,KAAK,EAAE;UAC/B,MAAI,CAAChF,gBAAgB,CAACgF,KAAK,CAACD,OAAO,GAAG,KAAK;UAC3CQ,KAAK,EAAE;QACT;MACF,CAAC,CAAC;IACJ;EAAC;EAAA;AAAA;AAGH,eAAe7F,UAAU"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anov/3d",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.49",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"localforage": "^1.10.0",
|
|
23
23
|
"uuid": "^9.0.1",
|
|
24
24
|
"@anov/3d-ability": "^0.0.13",
|
|
25
|
-
"@anov/3d-core": "^0.0.
|
|
25
|
+
"@anov/3d-core": "^0.0.12"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/uuid": "^9.0.7"
|