@anov/3d 0.0.13 → 0.0.15

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.
Files changed (49) hide show
  1. package/dist/factory/3d.d.ts +23 -14
  2. package/dist/factory/3d.js +143 -55
  3. package/dist/factory/3d.js.map +1 -1
  4. package/dist/factory/regionData.d.ts +8 -0
  5. package/dist/factory/regionData.js +59 -6
  6. package/dist/factory/regionData.js.map +1 -1
  7. package/dist/factory/unit/CameraPoi.d.ts +52 -4
  8. package/dist/factory/unit/CameraPoi.js +701 -55
  9. package/dist/factory/unit/CameraPoi.js.map +1 -1
  10. package/dist/factory/unit/glsl/heat/frag.d.ts +2 -0
  11. package/dist/factory/unit/glsl/heat/frag.glsl +37 -0
  12. package/dist/factory/unit/glsl/heat/frag.js +3 -0
  13. package/dist/factory/unit/glsl/heat/frag.js.map +1 -0
  14. package/dist/factory/unit/glsl/heat/ver.d.ts +2 -0
  15. package/dist/factory/unit/glsl/heat/ver.glsl +15 -0
  16. package/dist/factory/unit/glsl/heat/ver.js +3 -0
  17. package/dist/factory/unit/glsl/heat/ver.js.map +1 -0
  18. package/dist/factory/unit/handle.d.ts +4 -0
  19. package/dist/factory/unit/handle.js +20 -14
  20. package/dist/factory/unit/handle.js.map +1 -1
  21. package/dist/factory/unit/index.js +23 -13
  22. package/dist/factory/unit/index.js.map +1 -1
  23. package/dist/factory/unit/inspection/InspectionObject.d.ts +26 -0
  24. package/dist/factory/unit/{inspection.js → inspection/InspectionObject.js} +275 -133
  25. package/dist/factory/unit/inspection/InspectionObject.js.map +1 -0
  26. package/dist/factory/unit/{inspection.d.ts → inspection/index.d.ts} +8 -9
  27. package/dist/factory/unit/inspection/index.js +160 -0
  28. package/dist/factory/unit/inspection/index.js.map +1 -0
  29. package/dist/factory/unit/inspection/lineData.d.ts +21 -0
  30. package/dist/factory/unit/inspection/lineData.js +32 -0
  31. package/dist/factory/unit/inspection/lineData.js.map +1 -0
  32. package/dist/factory/unit/poi.d.ts +1 -0
  33. package/dist/factory/unit/poi.js +28 -14
  34. package/dist/factory/unit/poi.js.map +1 -1
  35. package/dist/factory/utils/constant.d.ts +0 -1
  36. package/dist/factory/utils/constant.js +0 -1
  37. package/dist/factory/utils/constant.js.map +1 -1
  38. package/dist/factory/utils/finirMaterial.d.ts +1 -0
  39. package/dist/factory/utils/finirMaterial.js +19 -1
  40. package/dist/factory/utils/finirMaterial.js.map +1 -1
  41. package/dist/index.js +1 -1
  42. package/dist/index.js.map +1 -1
  43. package/dist/module/environment/time/index.d.ts +1 -1
  44. package/dist/utils/index.d.ts +1 -1
  45. package/package.json +4 -3
  46. package/dist/factory/unit/inspection.js.map +0 -1
  47. package/dist/factory/unit/poi copy.d.ts +0 -15
  48. package/dist/factory/unit/poi copy.js +0 -144
  49. package/dist/factory/unit/poi copy.js.map +0 -1
@@ -1,10 +1,4 @@
1
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
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; }
9
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); } }
10
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); }); }; }
@@ -14,39 +8,116 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
14
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; }
15
9
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
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); }
17
- import { CatmullRomCurve3, Color, CurvePath, LineCurve3, ModelLoader, PerspectiveCamera, Vector3, lib, use, utils } from '@anov/3d-core';
18
- var Line2 = lib.Line2,
19
- LineGeometry = lib.LineGeometry,
20
- LineMaterial = lib.LineMaterial;
11
+ import { Clock, EdgesGeometry, Group, LineBasicMaterial, LineCurve3, LineSegments, Matrix4, ModelLoader, Quaternion, Vector3, use, utils } from '@anov/3d-core';
12
+ import { Css2DPoi, SpritePoi } from '@anov/3d-ability';
13
+ import { Tween } from '@tweenjs/tween.js';
14
+ import { createFinirMaterial } from "../../utils/finirMaterial";
15
+ import { usePath } from "../../3d";
16
+ import { isCheck, targetProgresspoints } from "./lineData";
21
17
  var modelLoader = new ModelLoader();
22
- var linePosition = [[-487.02, 0, -53.20], [-145.39, 0, -50.51], [-146.27, 0, 119.63], [21.13, 0, 125.23], [24.59, 0, -53.50], [321.58, 0, -50.13], [331.35, 0, 228.17]];
23
18
  var InspectionObject = /*#__PURE__*/function () {
24
19
  function InspectionObject(inspection) {
25
20
  _classCallCheck(this, InspectionObject);
26
21
  _defineProperty(this, "model", void 0);
27
22
  _defineProperty(this, "inspection", void 0);
28
23
  _defineProperty(this, "control", void 0);
24
+ _defineProperty(this, "tempLine", void 0);
25
+ _defineProperty(this, "isLock", false);
26
+ _defineProperty(this, "isAnimation", false);
27
+ _defineProperty(this, "css2d", void 0);
28
+ _defineProperty(this, "startRotate", function (targetQuaternion, mesh, cb) {
29
+ var clock = new Clock();
30
+ if (mesh.quaternion.equals(targetQuaternion)) return cb();
31
+ var animation = use.useframe(function () {
32
+ var delta = clock.getDelta();
33
+ if (!mesh.quaternion.equals(targetQuaternion)) {
34
+ var step = 1 * delta;
35
+ mesh.quaternion.rotateTowards(targetQuaternion, step);
36
+ } else {
37
+ animation();
38
+ cb();
39
+ }
40
+ });
41
+ });
29
42
  this.inspection = inspection;
30
43
  }
31
44
  _createClass(InspectionObject, [{
32
45
  key: "loadModel",
33
46
  value: function () {
34
47
  var _loadModel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
35
- var glb;
48
+ var _this = this;
49
+ var glb, div, img, span, poi, img2, css2d, fly1, fly2, fly3, fly4, group;
36
50
  return _regeneratorRuntime().wrap(function _callee$(_context) {
37
51
  while (1) switch (_context.prev = _context.next) {
38
52
  case 0:
39
53
  _context.next = 2;
40
- return modelLoader.loadGLTF('./car.glb');
54
+ return modelLoader.loadGLTF("".concat(usePath, "car.glb"), false, true, './draco/');
41
55
  case 2:
42
56
  _context.next = 4;
43
57
  return _context.sent;
44
58
  case 4:
45
59
  glb = _context.sent;
46
- this.model = glb.scene;
47
- glb.scene.scale.set(15, 15, 15);
60
+ div = document.createElement('div');
61
+ div.style.position = 'relative';
62
+ img = document.createElement('img');
63
+ img.src = "".concat(usePath, "aerialVehicle02.png");
64
+ span = document.createElement('span');
65
+ span.innerText = '巡检无人机';
66
+ span.style.position = 'absolute';
67
+ span.style.top = '10px';
68
+ span.style.left = '50%';
69
+ span.style.transform = 'translateX(-30%)';
70
+ span.style.color = 'white';
71
+ span.style.fontSize = '20px';
72
+ span.style.fontWeight = 'bold';
73
+ div.appendChild(img);
74
+ div.appendChild(span);
75
+ poi = new SpritePoi(div, {
76
+ width: 100 * 2,
77
+ height: 40 * 2
78
+ });
79
+ img2 = document.createElement('img');
80
+ img2.src = "".concat(usePath, "aerialVehicle01.png");
81
+ css2d = new Css2DPoi(img2);
82
+ css2d.position.set(0, 0, 0);
83
+ css2d.visible = false;
84
+ poi.scale.set(100, 40, 1);
85
+ fly1 = glb.scene.getObjectByName('fly1');
86
+ fly2 = glb.scene.getObjectByName('fly1_1');
87
+ fly3 = glb.scene.getObjectByName('fly1_2');
88
+ fly4 = glb.scene.getObjectByName('fly1_3');
89
+ use.useframe(function () {
90
+ poi.position.copy(glb.scene.position.clone().add(new Vector3(0, 10, 0)));
91
+ fly1.rotation.z += 1.3;
92
+ fly2.rotation.z += 1.3;
93
+ fly3.rotation.z += 1.3;
94
+ fly4.rotation.z += 1.3;
95
+ if (isCheck(_this.getSportsProgress) && !_this.isLock) {
96
+ _this.stop();
97
+ _this.checkAnimation(_this.getSportsProgress);
98
+ }
99
+ });
100
+
101
+ // const box = new Mesh(new BoxGeometry(10, 10, 10), new MeshBasicMaterial({ color: 0xFF0000 }))
102
+ group = new Group();
103
+ group.add(glb.scene);
104
+ group.add(poi);
105
+ group.add(this.inspection.minCamera);
106
+
107
+ // box.scale.set(0.1, 0.1, 0.1)
108
+
109
+ this.inspection.minCamera.position.copy(glb.scene.position);
110
+ this.inspection.minCamera.position.z -= 5;
111
+ this.inspection.minCamera.position.y += 5;
112
+ this.inspection.minCamera.rotateY(Math.PI);
113
+ this.model = group;
114
+ glb.scene.scale.set(5, 5, 5);
115
+ glb.scene.traverse(function (child) {
116
+ child.layers.enable(2);
117
+ });
48
118
  this.inspection.gobal.scene.add(this.model);
49
- case 8:
119
+ this.inspection.gobal.scene.add(css2d);
120
+ case 45:
50
121
  case "end":
51
122
  return _context.stop();
52
123
  }
@@ -71,7 +142,7 @@ var InspectionObject = /*#__PURE__*/function () {
71
142
  _context2.next = 3;
72
143
  return this.loadModel();
73
144
  case 3:
74
- this.control = utils.moveWithLine(this.model, curve, 1000);
145
+ this.control = utils.moveWithLine(this.model, curve, 10);
75
146
  case 4:
76
147
  case "end":
77
148
  return _context2.stop();
@@ -84,137 +155,208 @@ var InspectionObject = /*#__PURE__*/function () {
84
155
  return startMove;
85
156
  }()
86
157
  }, {
87
- key: "stop",
88
- value: function stop() {
89
- this.control.increaseSpeed(0);
158
+ key: "getSportsProgress",
159
+ get: function get() {
160
+ if (!this.control) return 0;
161
+ return this.control.getProgress();
90
162
  }
91
163
  }, {
92
- key: "contineMove",
93
- value: function contineMove() {
94
- this.control.recoverSpeed();
164
+ key: "getTargetQuaternion",
165
+ value: function getTargetQuaternion(targetMesh) {
166
+ targetMesh.updateMatrixWorld(true);
167
+ var localForward = new Vector3(0, 0, -1);
168
+ var worldForward = localForward.applyQuaternion(targetMesh.quaternion.clone()).normalize();
169
+ var target = targetMesh.position.clone();
170
+ var direction = target.sub(this.model.position).normalize();
171
+ var targetQuaternion = new Quaternion().setFromUnitVectors(worldForward, direction);
172
+ var dotProduct = worldForward.dot(direction);
173
+ var angleRadians = Math.acos(dotProduct);
174
+ var angleDegrees = angleRadians * (180 / Math.PI);
175
+
176
+ // todo: some problem
177
+ if (angleDegrees < 60) {
178
+ var flipQuaternion = new Quaternion();
179
+ flipQuaternion.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI);
180
+ targetQuaternion.multiply(flipQuaternion);
181
+ }
95
182
  }
96
183
  }, {
97
- key: "gotoTarget",
98
- value: function gotoTarget(targetPosition) {}
99
- }]);
100
- return InspectionObject;
101
- }();
102
- var Inspection = /*#__PURE__*/function () {
103
- function Inspection(gobal) {
104
- _classCallCheck(this, Inspection);
105
- _defineProperty(this, "gobal", void 0);
106
- _defineProperty(this, "inspectionObject", void 0);
107
- _defineProperty(this, "curve", void 0);
108
- _defineProperty(this, "line", void 0);
109
- _defineProperty(this, "minCamera", void 0);
110
- _defineProperty(this, "InspectionPathObject", void 0);
111
- this.gobal = gobal;
112
- this.inspectionObject = new InspectionObject(this);
113
- this.generateInspectionPath(linePosition);
114
- this.startInspection(this.curve);
115
- this.hide();
116
- }
117
-
118
- /**
119
- * generate inspection path
120
- * @param linePosition
121
- */
122
- _createClass(Inspection, [{
123
- key: "generateInspectionPath",
124
- value: function generateInspectionPath(linePosition) {
125
- var curve = new CurvePath();
126
- linePosition.reduce(function (prev, current) {
127
- curve.curves.push(new LineCurve3(new Vector3().fromArray(prev), new Vector3().fromArray(current)));
128
- return current;
129
- }, linePosition[0]);
130
- var currentPoints = curve.getPoints();
131
- var lastCurve = new CatmullRomCurve3(_toConsumableArray(currentPoints), false, 'catmullrom', 0);
132
- this.curve = lastCurve;
133
- var geometry = new LineGeometry();
134
- var linePoints = [];
135
- currentPoints.forEach(function (point) {
136
- linePoints.push(point.x, point.y, point.z);
137
- });
138
- geometry.setPositions(linePoints);
139
- var line = new Line2(geometry, new LineMaterial({
140
- color: new Color('yellow').getHex(),
141
- linewidth: 0.005
142
- }));
143
- this.line = line;
144
- var minCamera = new PerspectiveCamera(90, 1, 0.1, 1000);
145
- this.gobal.scene.cutoutCamera = minCamera;
146
- this.minCamera = minCamera;
147
- this.gobal.scene.cutoutArea = {
148
- x: 0,
149
- y: 0,
150
- width: 200,
151
- height: 200
152
- };
153
- this.gobal.scene.add(minCamera);
154
- this.gobal.scene.add(line);
184
+ key: "getTargetQuaternionV2",
185
+ value: function getTargetQuaternionV2(lastFromPositin, currentPositin, targetPosition) {
186
+ var vTo = targetPosition.clone().sub(currentPositin).normalize();
187
+ var vFrom = currentPositin.clone().sub(lastFromPositin).normalize();
188
+ var targetQuaternion = new Quaternion().setFromUnitVectors(vFrom, vTo);
189
+ var flipQuaternion = new Quaternion();
190
+ flipQuaternion.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI);
191
+ targetQuaternion.multiply(flipQuaternion);
192
+ return targetQuaternion;
155
193
  }
156
-
157
- /**
158
- * open inspection camera
159
- */
160
194
  }, {
161
- key: "setInspectionCamera",
162
- value: function setInspectionCamera() {
163
- var _this = this;
164
- var minCamera = new PerspectiveCamera(90, 1, 0.1, 1000);
165
- this.gobal.scene.cutoutCamera = minCamera;
166
- this.gobal.scene.cutoutArea = {
167
- x: 0,
168
- y: 0,
169
- width: 200,
170
- height: 200
171
- };
172
- this.gobal.scene.add(minCamera);
173
- use.useframe(function () {
174
- var car = _this.inspectionObject.model;
175
- car && minCamera.position.set(car.position.x, car.position.y + 30, car.position.z);
176
- car && minCamera.rotation.set(car.rotation.x, car.rotation.y + Math.PI, car.rotation.z);
195
+ key: "checkAnimation",
196
+ value: function checkAnimation(progress) {
197
+ var _this2 = this;
198
+ this.isLock = true;
199
+ this.isAnimation = true;
200
+ var key = Object.keys(targetProgresspoints).find(function (p) {
201
+ var num = parseFloat(p);
202
+ if (progress >= num && progress < num + 0.01) return true;
177
203
  });
178
- }
204
+ var targetMeshId = targetProgresspoints[key].lookAt;
205
+ var targetMesh = null;
206
+ if (targetMeshId === 'GY_GD_guandaofamen_5') targetMesh = this.inspection.gobal.pipeline.getObjectByName(targetMeshId);else targetMesh = this.inspection.gobal.realModl.getObjectByName(targetMeshId);
207
+ if (!targetMesh) {
208
+ this.contineMove();
209
+ this.isAnimation = false;
210
+ setTimeout(function () {
211
+ _this2.isLock = false;
212
+ }, 500);
213
+ return;
214
+ }
215
+ setTimeout(function () {
216
+ var rotationMatrix = new Matrix4();
217
+ var targetQuaternion = new Quaternion();
218
+ var startQuaternion = _this2.model.quaternion.clone();
219
+ rotationMatrix.lookAt(targetMesh.position, _this2.model.position, _this2.model.up);
220
+ targetQuaternion.setFromRotationMatrix(rotationMatrix);
221
+ var forwardTween = new Tween({
222
+ t: 0
223
+ }).to({
224
+ t: 1
225
+ }, 2000).onUpdate(function (obj) {
226
+ _this2.model.quaternion.copy(startQuaternion).slerp(targetQuaternion, obj.t);
227
+ });
228
+ var backwardTween = new Tween({
229
+ t: 1
230
+ }).to({
231
+ t: 0
232
+ }, 2000).onUpdate(function (obj) {
233
+ _this2.model.quaternion.copy(startQuaternion).slerp(targetQuaternion, obj.t);
234
+ });
235
+ forwardTween.onComplete(function () {
236
+ var finirMesh = null;
237
+ if (Number(key) === 0.04 || Number(key) === 0.68) _this2.inspection.minCamera.layers.set(2);
238
+ if (Number(key) === 0.15 || Number(key) === 0.24 || Number(key) === 0.40) {
239
+ _this2.inspection.minCamera.layers.enable(3);
240
+ // @ts-ignore
241
+ if (!targetMesh.finirMesh) {
242
+ finirMesh = targetMesh.clone();
243
+ var finirMaterialV2 = createFinirMaterial('yellow', 5.3);
244
+ finirMesh.traverse(function (child) {
245
+ child.layers.set(3);
246
+ if (child.type === 'Mesh') {
247
+ // @ts-ignore
248
+ child.material = finirMaterialV2;
179
249
 
180
- /**
181
- * start inspection
182
- * @param line
183
- */
250
+ // @ts-ignore
251
+ var lineSegments = new LineSegments(new EdgesGeometry(child.geometry), new LineBasicMaterial({
252
+ color: 'yellow'
253
+ }));
254
+ lineSegments.layers.set(3);
255
+ finirMesh.add(lineSegments);
256
+ }
257
+ });
258
+
259
+ // @ts-ignore
260
+ targetMesh.finirMesh = finirMesh;
261
+ _this2.inspection.gobal.scene.add(finirMesh);
262
+ } else {
263
+ // @ts-ignore
264
+ finirMesh = targetMesh.finirMesh;
265
+ finirMesh.visible = true;
266
+ }
267
+ }
268
+ setTimeout(function () {
269
+ if (Number(key) === 0.04 || Number(key) === 0.68) _this2.inspection.minCamera.layers.set(0);
270
+ if (Number(key) === 0.15 || Number(key) === 0.24 || Number(key) === 0.40) finirMesh.visible = false;
271
+ backwardTween.start();
272
+ }, 5000);
273
+ });
274
+ setTimeout(function () {
275
+ forwardTween.start();
276
+ }, 1000);
277
+ backwardTween.onComplete(function () {
278
+ _this2.isAnimation = false;
279
+ _this2.contineMove();
280
+ setTimeout(function () {
281
+ _this2.isLock = false;
282
+ }, 500);
283
+ });
284
+ }, 1000);
285
+ }
184
286
  }, {
185
- key: "startInspection",
186
- value: function startInspection(line) {
187
- this.inspectionObject.startMove(line);
188
- this.setInspectionCamera();
287
+ key: "generateTempPath",
288
+ value: function generateTempPath(currentPosition, targetPosition) {
289
+ return new LineCurve3(currentPosition, targetPosition);
189
290
  }
190
291
  }, {
191
- key: "goToInspectionTarget",
192
- value: function goToInspectionTarget(targetPosition) {
193
- this.inspectionObject.gotoTarget(targetPosition);
292
+ key: "gotoTarget",
293
+ value: function gotoTarget(targetPosition, targetProgress) {
294
+ var _this3 = this;
295
+ if (this.isAnimation) return;
296
+ this.isAnimation = true;
297
+ this.control.stop();
298
+ var rotationMatrix = new Matrix4();
299
+ var targetQuaternion = new Quaternion();
300
+ rotationMatrix.lookAt(targetPosition, this.model.position, this.model.up);
301
+ targetQuaternion.setFromRotationMatrix(rotationMatrix);
302
+ this.startRotate(targetQuaternion, this.model, function () {
303
+ var currentPosition = _this3.model.position;
304
+ var upCurve = new LineCurve3(currentPosition, new Vector3(currentPosition.x, currentPosition.y + 100, currentPosition.z));
305
+ var upControl = utils.moveWithLine(_this3.model, upCurve, 10, {
306
+ loop: false,
307
+ lookat: targetPosition
308
+ });
309
+ upControl.addEventListener('end', function () {
310
+ var tempCurve = _this3.generateTempPath(currentPosition, new Vector3(targetPosition.x, targetPosition.y + 100, targetPosition.z));
311
+ var tempControl = utils.moveWithLine(_this3.model, tempCurve, 50, {
312
+ loop: false,
313
+ lookat: false
314
+ });
315
+ tempControl.addEventListener('end', function () {
316
+ var lastPosition = _this3.model.position;
317
+ var downCurve = new LineCurve3(lastPosition, new Vector3(lastPosition.x, lastPosition.y - 100, lastPosition.z));
318
+ var downControl = utils.moveWithLine(_this3.model, downCurve, 10, {
319
+ loop: false,
320
+ lookat: false
321
+ });
322
+ downControl.addEventListener('end', function () {
323
+ var rotationMatrix2 = new Matrix4();
324
+ var targetQuaternion2 = new Quaternion();
325
+ var targetPosition2 = _this3.inspection.curve.getPointAt((targetProgress + 0.01) % 1);
326
+ rotationMatrix2.lookAt(targetPosition2, _this3.model.position, _this3.model.up);
327
+ targetQuaternion2.setFromRotationMatrix(rotationMatrix2);
328
+ _this3.startRotate(targetQuaternion2, _this3.model, function () {
329
+ setTimeout(function () {
330
+ _this3.isAnimation = false;
331
+ _this3.control.setProgress(targetProgress);
332
+ _this3.control.contine();
333
+ }, 500);
334
+ });
335
+ });
336
+ });
337
+ });
338
+ });
194
339
  }
195
340
  }, {
196
- key: "show",
197
- value: function show() {
198
- this.gobal.scene.cutout = true;
199
- this.line.visible = true;
200
- this.inspectionObject.model && (this.inspectionObject.model.visible = true);
341
+ key: "setSpeed",
342
+ value: function setSpeed(speed) {
343
+ if (this.control) this.control.setSpeed(speed);
201
344
  }
202
345
  }, {
203
- key: "hide",
204
- value: function hide() {
205
- var _this2 = this;
206
- this.gobal.scene.cutout = false;
207
- this.gobal.scene.cutMain(this.gobal.scene.renderer);
208
- this.line.visible = false;
209
- var check = use.useframe(function () {
210
- if (_this2.inspectionObject.model) {
211
- _this2.inspectionObject.model.visible = false;
212
- check();
213
- }
214
- });
346
+ key: "stop",
347
+ value: function stop() {
348
+ if (this.control) this.control.stop();
215
349
  }
350
+ }, {
351
+ key: "contineMove",
352
+ value: function contineMove() {
353
+ if (this.control) this.control.contine();
354
+ }
355
+ }, {
356
+ key: "dispose",
357
+ value: function dispose() {}
216
358
  }]);
217
- return Inspection;
359
+ return InspectionObject;
218
360
  }();
219
- export default Inspection;
220
- //# sourceMappingURL=inspection.js.map
361
+ export default InspectionObject;
362
+ //# sourceMappingURL=InspectionObject.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Clock","EdgesGeometry","Group","LineBasicMaterial","LineCurve3","LineSegments","Matrix4","ModelLoader","Quaternion","Vector3","use","utils","Css2DPoi","SpritePoi","Tween","createFinirMaterial","usePath","isCheck","targetProgresspoints","modelLoader","InspectionObject","inspection","targetQuaternion","mesh","cb","clock","quaternion","equals","animation","useframe","delta","getDelta","step","rotateTowards","loadGLTF","glb","div","document","createElement","style","position","img","src","span","innerText","top","left","transform","color","fontSize","fontWeight","appendChild","poi","width","height","img2","css2d","set","visible","scale","fly1","scene","getObjectByName","fly2","fly3","fly4","copy","clone","add","rotation","z","getSportsProgress","isLock","stop","checkAnimation","group","minCamera","y","rotateY","Math","PI","model","traverse","child","layers","enable","gobal","curve","loadModel","control","moveWithLine","getProgress","targetMesh","updateMatrixWorld","localForward","worldForward","applyQuaternion","normalize","target","direction","sub","setFromUnitVectors","dotProduct","dot","angleRadians","acos","angleDegrees","flipQuaternion","setFromAxisAngle","multiply","lastFromPositin","currentPositin","targetPosition","vTo","vFrom","progress","isAnimation","key","Object","keys","find","p","num","parseFloat","targetMeshId","lookAt","pipeline","realModl","contineMove","setTimeout","rotationMatrix","startQuaternion","up","setFromRotationMatrix","forwardTween","t","to","onUpdate","obj","slerp","backwardTween","onComplete","finirMesh","Number","finirMaterialV2","type","material","lineSegments","geometry","start","currentPosition","targetProgress","startRotate","upCurve","x","upControl","loop","lookat","addEventListener","tempCurve","generateTempPath","tempControl","lastPosition","downCurve","downControl","rotationMatrix2","targetQuaternion2","targetPosition2","getPointAt","setProgress","contine","speed","setSpeed"],"sources":["../../../../src/factory/unit/inspection/InspectionObject.ts"],"sourcesContent":["import type { Camera, Mesh, ShaderMaterial } from '@anov/3d-core'\nimport { BoxGeometry, Clock, Color, EdgesGeometry, Group, LineBasicMaterial, LineCurve3, LineSegments, Matrix4, MeshBasicMaterial, ModelLoader, Quaternion, Vector3, use, utils } from '@anov/3d-core'\nimport { Css2DPoi, SpritePoi, addColorifyPass, createHighSelectedTool } from '@anov/3d-ability'\nimport { Tween } from '@tweenjs/tween.js'\nimport { createFinirMaterial } from '../../utils/finirMaterial'\nimport { usePath } from '../../3d'\nimport { isCheck, targetProgresspoints } from './lineData'\n\nconst modelLoader = new ModelLoader()\n\nclass InspectionObject {\n model\n private inspection\n private control\n private tempLine\n private isLock = false\n private isAnimation = false\n css2d: Css2DPoi\n\n constructor(inspection) {\n this.inspection = inspection\n }\n\n private async loadModel() {\n const glb = await (await modelLoader.loadGLTF(`${usePath}car.glb`, false, true, './draco/'))\n\n const div = document.createElement('div')\n div.style.position = 'relative'\n\n const img = document.createElement('img')\n img.src = `${usePath}aerialVehicle02.png`\n\n const span = document.createElement('span')\n span.innerText = '巡检无人机'\n span.style.position = 'absolute'\n span.style.top = '10px'\n span.style.left = '50%'\n span.style.transform = 'translateX(-30%)'\n\n span.style.color = 'white'\n span.style.fontSize = '20px'\n span.style.fontWeight = 'bold'\n\n div.appendChild(img)\n div.appendChild(span)\n\n const poi = new SpritePoi(div, {\n width: 100 * 2,\n height: 40 * 2,\n })\n\n const img2 = document.createElement('img')\n img2.src = `${usePath}aerialVehicle01.png`\n const css2d = new Css2DPoi(img2)\n\n css2d.position.set(0, 0, 0)\n css2d.visible = false\n\n poi.scale.set(100, 40, 1)\n\n const fly1 = glb.scene.getObjectByName('fly1')\n const fly2 = glb.scene.getObjectByName('fly1_1')\n const fly3 = glb.scene.getObjectByName('fly1_2')\n const fly4 = glb.scene.getObjectByName('fly1_3')\n\n use.useframe(() => {\n poi.position.copy(glb.scene.position.clone().add(new Vector3(0, 10, 0)))\n\n fly1.rotation.z += 1.3\n fly2.rotation.z += 1.3\n fly3.rotation.z += 1.3\n fly4.rotation.z += 1.3\n\n if (isCheck(this.getSportsProgress)\n && !this.isLock) {\n this.stop()\n this.checkAnimation(this.getSportsProgress)\n }\n })\n\n // const box = new Mesh(new BoxGeometry(10, 10, 10), new MeshBasicMaterial({ color: 0xFF0000 }))\n\n const group = new Group()\n group.add(glb.scene)\n group.add(poi)\n group.add(this.inspection.minCamera)\n\n // box.scale.set(0.1, 0.1, 0.1)\n\n this.inspection.minCamera.position.copy(glb.scene.position)\n this.inspection.minCamera.position.z -= 5\n this.inspection.minCamera.position.y += 5\n this.inspection.minCamera.rotateY(Math.PI)\n\n this.model = group\n\n glb.scene.scale.set(5, 5, 5)\n\n glb.scene.traverse((child) => {\n child.layers.enable(2)\n })\n\n this.inspection.gobal.scene.add(this.model)\n this.inspection.gobal.scene.add(css2d)\n }\n\n async startMove(curve) {\n if (!this.model)\n await this.loadModel()\n\n this.control = utils.moveWithLine(this.model, curve, 10)\n }\n\n get getSportsProgress() {\n if (!this.control)\n return 0\n\n return this.control.getProgress()\n }\n\n private getTargetQuaternion(targetMesh: Group) {\n targetMesh.updateMatrixWorld(true)\n const localForward = new Vector3(0, 0, -1)\n const worldForward = localForward.applyQuaternion(targetMesh.quaternion.clone()).normalize()\n\n const target = targetMesh.position.clone()\n const direction = target.sub(this.model.position).normalize()\n\n const targetQuaternion = new Quaternion().setFromUnitVectors(worldForward, direction)\n\n const dotProduct = worldForward.dot(direction)\n const angleRadians = Math.acos(dotProduct)\n const angleDegrees = angleRadians * (180 / Math.PI)\n\n // todo: some problem\n if (angleDegrees < 60) {\n const flipQuaternion = new Quaternion()\n flipQuaternion.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI)\n targetQuaternion.multiply(flipQuaternion)\n }\n }\n\n private getTargetQuaternionV2(lastFromPositin: Vector3, currentPositin: Vector3, targetPosition: Vector3) {\n const vTo = targetPosition.clone().sub(currentPositin).normalize()\n const vFrom = currentPositin.clone().sub(lastFromPositin).normalize()\n\n const targetQuaternion = new Quaternion().setFromUnitVectors(vFrom, vTo)\n\n const flipQuaternion = new Quaternion()\n flipQuaternion.setFromAxisAngle(new Vector3(0, 1, 0), Math.PI)\n targetQuaternion.multiply(flipQuaternion)\n\n return targetQuaternion\n }\n\n private checkAnimation(progress: number) {\n this.isLock = true\n this.isAnimation = true\n\n const key = Object.keys(targetProgresspoints).find((p) => {\n const num = parseFloat(p)\n if (progress >= num && progress < num + 0.01)\n return true\n })\n\n const targetMeshId = targetProgresspoints[key].lookAt\n\n let targetMesh: Group | null = null\n\n if (targetMeshId === 'GY_GD_guandaofamen_5')\n targetMesh = this.inspection.gobal.pipeline.getObjectByName(targetMeshId) as Group\n\n else\n targetMesh = this.inspection.gobal.realModl.getObjectByName(targetMeshId) as Group\n\n if (!targetMesh) {\n this.contineMove()\n this.isAnimation = false\n setTimeout(() => {\n this.isLock = false\n }, 500)\n return\n }\n\n setTimeout(() => {\n const rotationMatrix = new Matrix4()\n\n const targetQuaternion = new Quaternion()\n const startQuaternion = this.model.quaternion.clone()\n\n rotationMatrix.lookAt(targetMesh.position, this.model.position, this.model.up)\n targetQuaternion.setFromRotationMatrix(rotationMatrix)\n\n const forwardTween = new Tween({ t: 0 })\n .to({ t: 1 }, 2000)\n .onUpdate((obj) => {\n this.model.quaternion.copy(startQuaternion).slerp(targetQuaternion, obj.t)\n })\n\n const backwardTween = new Tween({ t: 1 })\n .to({ t: 0 }, 2000)\n .onUpdate((obj) => {\n this.model.quaternion.copy(startQuaternion).slerp(targetQuaternion, obj.t)\n })\n\n forwardTween.onComplete(() => {\n let finirMesh: Group | null = null\n\n if (Number(key) === 0.04 || Number(key) === 0.68)\n (this.inspection.minCamera as Camera).layers.set(2)\n\n if (Number(key) === 0.15 || Number(key) === 0.24 || Number(key) === 0.40) {\n (this.inspection.minCamera as Camera).layers.enable(3)\n // @ts-ignore\n if (!targetMesh.finirMesh) {\n finirMesh = targetMesh.clone() as any as Group\n\n const finirMaterialV2 = createFinirMaterial('yellow', 5.3)\n\n finirMesh.traverse((child) => {\n child.layers.set(3)\n\n if (child.type === 'Mesh') {\n // @ts-ignore\n child.material = finirMaterialV2\n\n // @ts-ignore\n const lineSegments = new LineSegments(new EdgesGeometry(child.geometry as any), new LineBasicMaterial({ color: 'yellow' }))\n\n lineSegments.layers.set(3)\n finirMesh.add(lineSegments)\n }\n })\n\n // @ts-ignore\n targetMesh.finirMesh = finirMesh\n\n this.inspection.gobal.scene.add(finirMesh)\n }\n else {\n // @ts-ignore\n finirMesh = targetMesh.finirMesh\n\n finirMesh.visible = true\n }\n }\n\n setTimeout(() => {\n if (Number(key) === 0.04 || Number(key) === 0.68)\n (this.inspection.minCamera as Camera).layers.set(0)\n\n if (Number(key) === 0.15 || Number(key) === 0.24 || Number(key) === 0.40)\n\n finirMesh.visible = false\n\n backwardTween.start()\n }, 5000)\n })\n\n setTimeout(() => {\n forwardTween.start()\n }, 1000)\n\n backwardTween.onComplete(() => {\n this.isAnimation = false\n this.contineMove()\n\n setTimeout(() => {\n this.isLock = false\n }, 500)\n })\n }, 1000)\n }\n\n generateTempPath(currentPosition: Vector3, targetPosition: Vector3) {\n return new LineCurve3(currentPosition, targetPosition)\n }\n\n private startRotate = (targetQuaternion: Quaternion, mesh: Group, cb: () => void) => {\n const clock = new Clock()\n\n if (mesh.quaternion.equals(targetQuaternion))\n return cb()\n\n const animation = use.useframe(() => {\n const delta = clock.getDelta()\n if (!mesh.quaternion.equals(targetQuaternion)) {\n const step = 1 * delta\n mesh.quaternion.rotateTowards(targetQuaternion, step)\n }\n else {\n animation()\n cb()\n }\n },\n )\n }\n\n gotoTarget(targetPosition: Vector3, targetProgress: number) {\n if (this.isAnimation)\n return\n\n this.isAnimation = true\n\n this.control.stop()\n\n const rotationMatrix = new Matrix4()\n const targetQuaternion = new Quaternion()\n\n rotationMatrix.lookAt(targetPosition, this.model.position, this.model.up)\n targetQuaternion.setFromRotationMatrix(rotationMatrix)\n\n this.startRotate(targetQuaternion, this.model,\n () => {\n const currentPosition = this.model.position\n const upCurve = new LineCurve3(currentPosition, new Vector3(currentPosition.x, currentPosition.y + 100, currentPosition.z))\n const upControl = utils.moveWithLine(this.model, upCurve, 10, { loop: false, lookat: targetPosition })\n\n upControl.addEventListener('end', () => {\n const tempCurve = this.generateTempPath(currentPosition, new Vector3(targetPosition.x, targetPosition.y + 100, targetPosition.z))\n const tempControl = utils.moveWithLine(this.model, tempCurve, 50, { loop: false, lookat: false })\n\n tempControl.addEventListener('end', () => {\n const lastPosition = this.model.position\n const downCurve = new LineCurve3(lastPosition, new Vector3(lastPosition.x, lastPosition.y - 100, lastPosition.z))\n const downControl = utils.moveWithLine(this.model, downCurve, 10, { loop: false, lookat: false })\n\n downControl.addEventListener('end', () => {\n const rotationMatrix2 = new Matrix4()\n const targetQuaternion2 = new Quaternion()\n\n const targetPosition2 = this.inspection.curve.getPointAt((targetProgress + 0.01) % 1)\n\n rotationMatrix2.lookAt(targetPosition2, this.model.position, this.model.up)\n targetQuaternion2.setFromRotationMatrix(rotationMatrix2)\n\n this.startRotate(targetQuaternion2, this.model, () => {\n setTimeout(() => {\n this.isAnimation = false\n this.control.setProgress(targetProgress)\n this.control.contine()\n }, 500)\n })\n })\n })\n })\n })\n }\n\n setSpeed(speed: number) {\n if (this.control)\n this.control.setSpeed(speed)\n }\n\n stop() {\n if (this.control)\n this.control.stop()\n }\n\n contineMove() {\n if (this.control)\n this.control.contine()\n }\n\n dispose() { }\n}\n\nexport default InspectionObject"],"mappings":";+CACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAsBA,KAAK,EAASC,aAAa,EAAEC,KAAK,EAAEC,iBAAiB,EAAEC,UAAU,EAAEC,YAAY,EAAEC,OAAO,EAAqBC,WAAW,EAAEC,UAAU,EAAEC,OAAO,EAAEC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AACtM,SAASC,QAAQ,EAAEC,SAAS,QAAiD,kBAAkB;AAC/F,SAASC,KAAK,QAAQ,mBAAmB;AACzC,SAASC,mBAAmB;AAC5B,SAASC,OAAO;AAChB,SAASC,OAAO,EAAEC,oBAAoB;AAEtC,IAAMC,WAAW,GAAG,IAAIZ,WAAW,EAAE;AAAA,IAE/Ba,gBAAgB;EASpB,0BAAYC,UAAU,EAAE;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA,gCAJP,KAAK;IAAA,qCACA,KAAK;IAAA;IAAA,qCAsQL,UAACC,gBAA4B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AClF,OAAO,EACd,IAAI,CAACA,OAAO,CAAChB,IAAI,EAAE;IACvB;EAAC;IAAA;IAAA,OAED,uBAAc;MACZ,IAAI,IAAI,CAACgB,OAAO,EACd,IAAI,CAACA,OAAO,CAACiF,OAAO,EAAE;IAC1B;EAAC;IAAA;IAAA,OAED,mBAAU,CAAE;EAAC;EAAA;AAAA;AAGf,eAAetJ,gBAAgB"}
@@ -1,11 +1,12 @@
1
1
  import type { Object3D } from '@anov/3d-core';
2
- import { PerspectiveCamera, Vector3 } from '@anov/3d-core';
3
- import type Factory3D from '../3d';
2
+ import { PerspectiveCamera } from '@anov/3d-core';
3
+ import type Factory3D from '../../3d';
4
4
  declare class Inspection {
5
5
  private gobal;
6
6
  private inspectionObject;
7
7
  private curve;
8
8
  private line;
9
+ private viewElement;
9
10
  minCamera: PerspectiveCamera;
10
11
  InspectionPathObject: Object3D;
11
12
  constructor(gobal: Factory3D);
@@ -15,15 +16,13 @@ declare class Inspection {
15
16
  */
16
17
  private generateInspectionPath;
17
18
  /**
18
- * open inspection camera
19
- */
20
- setInspectionCamera(): void;
21
- /**
22
- * start inspection
23
- * @param line
19
+ * make ground road
24
20
  */
21
+ private makeGroundRoad;
22
+ private setInspectionCamera;
23
+ get getPathLength(): any;
25
24
  startInspection(line: any): void;
26
- goToInspectionTarget(targetPosition: Vector3): void;
25
+ goToInspectionTarget(targetProgress: number): void;
27
26
  show(): void;
28
27
  hide(): void;
29
28
  }