@anov/3d-ability 0.0.4 → 0.0.6
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/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/line/round-curve.d.ts +1 -0
- package/dist/line/round-curve.js +6 -3
- package/dist/line/round-curve.js.map +1 -1
- package/dist/poi/2D/index.d.ts +12 -0
- package/dist/poi/{core/Css2D.js → 2D/index.js} +117 -118
- package/dist/poi/2D/index.js.map +1 -0
- package/dist/{poiBack → poi/3D}/index.d.ts +2 -2
- package/dist/{poiBack → poi/3D}/index.js +3 -4
- package/dist/poi/3D/index.js.map +1 -0
- package/dist/poi/3D/type.js.map +1 -0
- package/dist/poi/Poi.d.ts +12 -0
- package/dist/poi/{core/SpriteBase.js → Poi.js} +31 -34
- package/dist/poi/Poi.js.map +1 -0
- package/dist/poi/Sprite/index.d.ts +22 -0
- package/dist/poi/Sprite/index.js +271 -0
- package/dist/poi/Sprite/index.js.map +1 -0
- package/dist/poi/Sprite/index2.d.ts +14 -0
- package/dist/poi/{core/Sprite.js → Sprite/index2.js} +93 -54
- package/dist/poi/Sprite/index2.js.map +1 -0
- package/dist/poi/index.d.ts +4 -12
- package/dist/poi/index.js +4 -28
- package/dist/poi/index.js.map +1 -1
- package/dist/poi/utils/element.d.ts +5 -0
- package/dist/poi/utils/element.js +96 -0
- package/dist/poi/utils/element.js.map +1 -0
- package/dist/poi/utils/type.d.ts +13 -22
- package/dist/poi/utils/type.js +4 -16
- package/dist/poi/utils/type.js.map +1 -1
- package/package.json +3 -3
- package/dist/poi/core/Base.d.ts +0 -7
- package/dist/poi/core/Base.js +0 -24
- package/dist/poi/core/Base.js.map +0 -1
- package/dist/poi/core/Css2D.js.map +0 -1
- package/dist/poi/core/Css3D.d.ts +0 -1
- package/dist/poi/core/Css3D.js +0 -24
- package/dist/poi/core/Css3D.js.map +0 -1
- package/dist/poi/core/Sprite.d.ts +0 -12
- package/dist/poi/core/Sprite.js.map +0 -1
- package/dist/poi/core/SpriteBase.d.ts +0 -11
- package/dist/poi/core/SpriteBase.js.map +0 -1
- package/dist/poi/utils/base64.d.ts +0 -3
- package/dist/poi/utils/base64.js +0 -4
- package/dist/poi/utils/base64.js.map +0 -1
- package/dist/poi/utils/css.d.ts +0 -35
- package/dist/poi/utils/css.js +0 -45
- package/dist/poi/utils/css.js.map +0 -1
- package/dist/poiBack/assets.d.ts +0 -2
- package/dist/poiBack/assets.js +0 -3
- package/dist/poiBack/assets.js.map +0 -1
- package/dist/poiBack/dom.d.ts +0 -2
- package/dist/poiBack/dom.js +0 -36
- package/dist/poiBack/dom.js.map +0 -1
- package/dist/poiBack/index.js.map +0 -1
- package/dist/poiBack/type.js.map +0 -1
- /package/dist/{poiBack → poi/3D}/type.d.ts +0 -0
- /package/dist/{poiBack → poi/3D}/type.js +0 -0
|
@@ -12,47 +12,44 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
12
12
|
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; }
|
|
13
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
14
14
|
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); }
|
|
15
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
var _super = _createSuper(AnovSprite);
|
|
21
|
-
function AnovSprite(type, data, option) {
|
|
15
|
+
import { Object3D } from '@anov/3d-core';
|
|
16
|
+
var Poi = /*#__PURE__*/function (_Object3D) {
|
|
17
|
+
_inherits(Poi, _Object3D);
|
|
18
|
+
var _super = _createSuper(Poi);
|
|
19
|
+
function Poi(data, option) {
|
|
22
20
|
var _this;
|
|
23
|
-
_classCallCheck(this,
|
|
24
|
-
_this = _super.call(this
|
|
25
|
-
_defineProperty(_assertThisInitialized(_this), "poiType", void 0);
|
|
21
|
+
_classCallCheck(this, Poi);
|
|
22
|
+
_this = _super.call(this);
|
|
26
23
|
_defineProperty(_assertThisInitialized(_this), "data", void 0);
|
|
27
24
|
_defineProperty(_assertThisInitialized(_this), "option", void 0);
|
|
28
|
-
_this
|
|
25
|
+
_defineProperty(_assertThisInitialized(_this), "animation", []);
|
|
29
26
|
_this.data = data;
|
|
30
|
-
_this.
|
|
27
|
+
_this.option = option;
|
|
31
28
|
return _this;
|
|
32
29
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// 精灵的锚点
|
|
41
|
-
this.center = new Vector2(0.5, 0);
|
|
42
|
-
this.scale.setX(scale);
|
|
43
|
-
this.scale.setZ(scale);
|
|
44
|
-
this.visible = false;
|
|
45
|
-
this.dom2Canvas();
|
|
30
|
+
|
|
31
|
+
// 设置动画属性
|
|
32
|
+
_createClass(Poi, [{
|
|
33
|
+
key: "setAnimation",
|
|
34
|
+
value: function setAnimation(animation) {
|
|
35
|
+
if (!animation) return;
|
|
36
|
+
if (Array.isArray(animation)) this.animation = animation;else this.animation = [animation];
|
|
46
37
|
}
|
|
38
|
+
|
|
39
|
+
// 播放动画
|
|
47
40
|
}, {
|
|
48
|
-
key: "
|
|
49
|
-
value: function
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
key: "play",
|
|
42
|
+
value: function play() {}
|
|
43
|
+
|
|
44
|
+
// 销毁
|
|
45
|
+
}, {
|
|
46
|
+
key: "destroy",
|
|
47
|
+
value: function destroy() {
|
|
48
|
+
this.remove();
|
|
49
|
+
this.removeFromParent();
|
|
53
50
|
}
|
|
54
51
|
}]);
|
|
55
|
-
return
|
|
56
|
-
}(
|
|
57
|
-
export default
|
|
58
|
-
//# sourceMappingURL=
|
|
52
|
+
return Poi;
|
|
53
|
+
}(Object3D);
|
|
54
|
+
export default Poi;
|
|
55
|
+
//# sourceMappingURL=Poi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Object3D","Poi","data","option","animation","Array","isArray","remove","removeFromParent"],"sources":["../../src/poi/Poi.ts"],"sourcesContent":["import { Object3D } from '@anov/3d-core'\nimport type { IOption } from './utils/type'\n\nclass Poi extends Object3D {\n data!: any\n option!: IOption\n animation: Array<any> = []\n\n constructor(data: any, option: IOption) {\n super()\n this.data = data\n this.option = option\n }\n\n // 设置动画属性\n setAnimation(animation: object | Array<any>) {\n if (!animation)\n return\n if (Array.isArray(animation))\n this.animation = animation\n else\n this.animation = [animation]\n }\n\n // 播放动画\n play() {}\n\n // 销毁\n destroy() {\n this.remove()\n this.removeFromParent()\n }\n}\n\nexport default Poi"],"mappings":";;;;;;;;;;;;;;AAAA,SAASA,QAAQ,QAAQ,eAAe;AAAA,IAGlCC,GAAG;EAAA;EAAA;EAKP,aAAYC,IAAS,EAAEC,MAAe,EAAE;IAAA;IAAA;IACtC;IAAO;IAAA;IAAA,4DAHe,EAAE;IAIxB,MAAKD,IAAI,GAAGA,IAAI;IAChB,MAAKC,MAAM,GAAGA,MAAM;IAAA;EACtB;;EAEA;EAAA;IAAA;IAAA,OACA,sBAAaC,SAA8B,EAAE;MAC3C,IAAI,CAACA,SAAS,EACZ;MACF,IAAIC,KAAK,CAACC,OAAO,CAACF,SAAS,CAAC,EAC1B,IAAI,CAACA,SAAS,GAAGA,SAAS,MAE1B,IAAI,CAACA,SAAS,GAAG,CAACA,SAAS,CAAC;IAChC;;IAEA;EAAA;IAAA;IAAA,OACA,gBAAO,CAAC;;IAER;EAAA;IAAA;IAAA,OACA,mBAAU;MACR,IAAI,CAACG,MAAM,EAAE;MACb,IAAI,CAACC,gBAAgB,EAAE;IACzB;EAAC;EAAA;AAAA,EA5BeR,QAAQ;AA+B1B,eAAeC,GAAG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Raycaster } from '@anov/3d-core';
|
|
2
|
+
import { BufferGeometry, SpriteMaterial, Vector2 } from '@anov/3d-core';
|
|
3
|
+
import type { IOption } from '../utils/type';
|
|
4
|
+
import Poi from '../Poi';
|
|
5
|
+
declare class SpritePoi extends Poi {
|
|
6
|
+
geometry: BufferGeometry;
|
|
7
|
+
center: Vector2;
|
|
8
|
+
material: SpriteMaterial;
|
|
9
|
+
isSprite: boolean;
|
|
10
|
+
type: string;
|
|
11
|
+
data: any;
|
|
12
|
+
option: IOption;
|
|
13
|
+
animation: Array<any>;
|
|
14
|
+
constructor(data: any, option: IOption);
|
|
15
|
+
private getGeometry;
|
|
16
|
+
private setMaterial;
|
|
17
|
+
setAnimation(animation: object | Array<any>): void;
|
|
18
|
+
play(): void;
|
|
19
|
+
addEventListener(type: string, cb: any): () => void;
|
|
20
|
+
raycast(raycaster: Raycaster, intersects: any): void;
|
|
21
|
+
}
|
|
22
|
+
export default SpritePoi;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
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; }
|
|
2
|
+
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); }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
9
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
|
+
function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
|
|
11
|
+
function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
|
|
12
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
13
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
14
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
15
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
16
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
17
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
|
+
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); }
|
|
22
|
+
import { BufferGeometry, InterleavedBuffer, InterleavedBufferAttribute, Matrix4, SpriteMaterial, Triangle, Vector2, Vector3, utils } from '@anov/3d-core';
|
|
23
|
+
import gsap from 'gsap';
|
|
24
|
+
import { EAnimationType } from "../utils/type";
|
|
25
|
+
import { createContentElement, createTitleElement } from "../utils/element";
|
|
26
|
+
import Poi from "../Poi";
|
|
27
|
+
var _default = {
|
|
28
|
+
scale: 15,
|
|
29
|
+
animation: {
|
|
30
|
+
type: EAnimationType.grow,
|
|
31
|
+
duration: 0.3
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
var _viewWorldMatrix = new Matrix4();
|
|
35
|
+
var createDomTexture = utils.createDomTexture;
|
|
36
|
+
var SpritePoi = /*#__PURE__*/function (_Poi) {
|
|
37
|
+
_inherits(SpritePoi, _Poi);
|
|
38
|
+
var _super = _createSuper(SpritePoi);
|
|
39
|
+
function SpritePoi(data, option) {
|
|
40
|
+
var _this;
|
|
41
|
+
_classCallCheck(this, SpritePoi);
|
|
42
|
+
_this = _super.call(this, data, option);
|
|
43
|
+
_defineProperty(_assertThisInitialized(_this), "geometry", void 0);
|
|
44
|
+
_defineProperty(_assertThisInitialized(_this), "center", void 0);
|
|
45
|
+
_defineProperty(_assertThisInitialized(_this), "material", void 0);
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "isSprite", void 0);
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "type", void 0);
|
|
48
|
+
_defineProperty(_assertThisInitialized(_this), "data", void 0);
|
|
49
|
+
_defineProperty(_assertThisInitialized(_this), "option", void 0);
|
|
50
|
+
_defineProperty(_assertThisInitialized(_this), "animation", []);
|
|
51
|
+
_this.data = data;
|
|
52
|
+
_this.option = _objectSpread(_objectSpread({}, _default), option);
|
|
53
|
+
_this.isSprite = true;
|
|
54
|
+
_this.type = 'Sprite';
|
|
55
|
+
_this.geometry = _this.getGeometry();
|
|
56
|
+
// 创建Sprite
|
|
57
|
+
_this.setMaterial();
|
|
58
|
+
_this.option.animation && _this.setAnimation(_this.option.animation);
|
|
59
|
+
// 执行动画
|
|
60
|
+
_this.play();
|
|
61
|
+
return _this;
|
|
62
|
+
}
|
|
63
|
+
_createClass(SpritePoi, [{
|
|
64
|
+
key: "getGeometry",
|
|
65
|
+
value: function getGeometry() {
|
|
66
|
+
var _geometry = new BufferGeometry();
|
|
67
|
+
var float32Array = new Float32Array([-0.5, -0.5, 0, 0, 0, 0.5, -0.5, 0, 1, 0, 0.5, 0.5, 0, 1, 1, -0.5, 0.5, 0, 0, 1]);
|
|
68
|
+
var interleavedBuffer = new InterleavedBuffer(float32Array, 5);
|
|
69
|
+
_geometry.setIndex([0, 1, 2, 0, 2, 3]);
|
|
70
|
+
_geometry.setAttribute('position', new InterleavedBufferAttribute(interleavedBuffer, 3, 0, false));
|
|
71
|
+
_geometry.setAttribute('uv', new InterleavedBufferAttribute(interleavedBuffer, 2, 3, false));
|
|
72
|
+
return _geometry;
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "setMaterial",
|
|
76
|
+
value: function setMaterial() {
|
|
77
|
+
var _this2 = this;
|
|
78
|
+
var _this$option = this.option,
|
|
79
|
+
animation = _this$option.animation,
|
|
80
|
+
width = _this$option.width,
|
|
81
|
+
height = _this$option.height;
|
|
82
|
+
// 精灵的锚点
|
|
83
|
+
this.center = new Vector2(0.5, 0);
|
|
84
|
+
this.visible = false;
|
|
85
|
+
// 异步生成材质
|
|
86
|
+
var initMaterial = /*#__PURE__*/function () {
|
|
87
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
88
|
+
var element, _this2$data, title, content, texture, isFadeOrAppearAnimation, opacity;
|
|
89
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
90
|
+
while (1) switch (_context.prev = _context.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
// 生成精灵模型
|
|
93
|
+
|
|
94
|
+
// 直接传递DOM元素
|
|
95
|
+
if (_this2.data instanceof HTMLElement) {
|
|
96
|
+
element = _this2.data;
|
|
97
|
+
} else {
|
|
98
|
+
if (typeof _this2.data === 'string') {
|
|
99
|
+
element = createTitleElement(_this2.data, _this2.option);
|
|
100
|
+
} else if (_typeof(_this2.data) === 'object') {
|
|
101
|
+
_this2$data = _this2.data, title = _this2$data.title, content = _this2$data.content;
|
|
102
|
+
if (title && content) element = createContentElement(_this2.data, _this2.option);else if (title) element = createTitleElement(title, _this2.option);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
_context.next = 3;
|
|
106
|
+
return createDomTexture(element, {
|
|
107
|
+
width: width,
|
|
108
|
+
height: height
|
|
109
|
+
});
|
|
110
|
+
case 3:
|
|
111
|
+
texture = _context.sent;
|
|
112
|
+
// 判断条件
|
|
113
|
+
isFadeOrAppearAnimation = (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.fadeIn || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear; // 根据条件设置 opacity 的值
|
|
114
|
+
opacity = isFadeOrAppearAnimation ? 0 : 1;
|
|
115
|
+
texture.needsUpdate = true;
|
|
116
|
+
_this2.material = new SpriteMaterial({
|
|
117
|
+
map: texture,
|
|
118
|
+
opacity: opacity
|
|
119
|
+
});
|
|
120
|
+
_this2.visible = true;
|
|
121
|
+
case 9:
|
|
122
|
+
case "end":
|
|
123
|
+
return _context.stop();
|
|
124
|
+
}
|
|
125
|
+
}, _callee);
|
|
126
|
+
}));
|
|
127
|
+
return function initMaterial() {
|
|
128
|
+
return _ref.apply(this, arguments);
|
|
129
|
+
};
|
|
130
|
+
}();
|
|
131
|
+
initMaterial();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// 设置动画属性
|
|
135
|
+
}, {
|
|
136
|
+
key: "setAnimation",
|
|
137
|
+
value: function setAnimation(animation) {
|
|
138
|
+
if (!animation) return;
|
|
139
|
+
if (Array.isArray(animation)) this.animation = animation;else this.animation = [animation];
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// 播放动画
|
|
143
|
+
}, {
|
|
144
|
+
key: "play",
|
|
145
|
+
value: function play() {
|
|
146
|
+
var _this3 = this;
|
|
147
|
+
var hasExecuted = false;
|
|
148
|
+
var isGrow = false;
|
|
149
|
+
var scale = this.option.scale;
|
|
150
|
+
// 执行渐显、打印内容等操作
|
|
151
|
+
this.onAfterRender = function () {
|
|
152
|
+
if (hasExecuted) return;
|
|
153
|
+
_this3.animation.forEach(function (item) {
|
|
154
|
+
switch (item.type) {
|
|
155
|
+
case EAnimationType.fadeIn:
|
|
156
|
+
gsap.to(_this3.material, _objectSpread(_objectSpread({
|
|
157
|
+
opacity: 1
|
|
158
|
+
}, item), {}, {
|
|
159
|
+
repeat: 0,
|
|
160
|
+
ease: 'none'
|
|
161
|
+
}));
|
|
162
|
+
break;
|
|
163
|
+
case EAnimationType.grow:
|
|
164
|
+
isGrow = true;
|
|
165
|
+
if (scale) {
|
|
166
|
+
var tween = gsap.to({
|
|
167
|
+
scale: 1
|
|
168
|
+
}, _objectSpread(_objectSpread({
|
|
169
|
+
scale: scale
|
|
170
|
+
}, item), {}, {
|
|
171
|
+
repeat: 0,
|
|
172
|
+
ease: 'power2.out',
|
|
173
|
+
onUpdateParams: ['x'],
|
|
174
|
+
onUpdate: function onUpdate() {
|
|
175
|
+
// 通过 tween 对象获取当前动画的进度
|
|
176
|
+
var progress = tween.progress();
|
|
177
|
+
_this3.scale.setScalar(progress * scale);
|
|
178
|
+
}
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
if (!isGrow && scale) _this3.scale.setScalar(scale);
|
|
185
|
+
hasExecuted = true;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
}, {
|
|
189
|
+
key: "addEventListener",
|
|
190
|
+
value: function addEventListener(type, cb) {
|
|
191
|
+
var _this4 = this;
|
|
192
|
+
_get(_getPrototypeOf(SpritePoi.prototype), "addEventListener", this).call(this, type, cb);
|
|
193
|
+
return function () {
|
|
194
|
+
return _get(_getPrototypeOf(SpritePoi.prototype), "removeEventListener", _this4).call(_this4, type, cb);
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}, {
|
|
198
|
+
key: "raycast",
|
|
199
|
+
value: function raycast(raycaster, intersects) {
|
|
200
|
+
if (raycaster.camera === null) console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.');
|
|
201
|
+
var _worldScale = /* @__PURE__ */new Vector3();
|
|
202
|
+
var _mvPosition = /* @__PURE__ */new Vector3();
|
|
203
|
+
_worldScale.setFromMatrixScale(this.matrixWorld);
|
|
204
|
+
_viewWorldMatrix.copy(raycaster.camera.matrixWorld);
|
|
205
|
+
this.modelViewMatrix.multiplyMatrices(raycaster.camera.matrixWorldInverse, this.matrixWorld);
|
|
206
|
+
_mvPosition.setFromMatrixPosition(this.modelViewMatrix);
|
|
207
|
+
if (raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false) _worldScale.multiplyScalar(-_mvPosition.z);
|
|
208
|
+
var rotation = this.material.rotation;
|
|
209
|
+
var sin, cos;
|
|
210
|
+
if (rotation !== 0) {
|
|
211
|
+
cos = Math.cos(rotation);
|
|
212
|
+
sin = Math.sin(rotation);
|
|
213
|
+
}
|
|
214
|
+
var center = this.center;
|
|
215
|
+
var _vA = /* @__PURE__ */new Vector3();
|
|
216
|
+
var _vB = /* @__PURE__ */new Vector3();
|
|
217
|
+
var _vC = /* @__PURE__ */new Vector3();
|
|
218
|
+
var _uvA = /* @__PURE__ */new Vector2();
|
|
219
|
+
var _uvB = /* @__PURE__ */new Vector2();
|
|
220
|
+
var _uvC = /* @__PURE__ */new Vector2();
|
|
221
|
+
transformVertex(_vA.set(-0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos);
|
|
222
|
+
transformVertex(_vB.set(0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos);
|
|
223
|
+
transformVertex(_vC.set(0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos);
|
|
224
|
+
_uvA.set(0, 0);
|
|
225
|
+
_uvB.set(1, 0);
|
|
226
|
+
_uvC.set(1, 1);
|
|
227
|
+
var _intersectPoint = /* @__PURE__ */new Vector3();
|
|
228
|
+
// check first triangle
|
|
229
|
+
var intersect = raycaster.ray.intersectTriangle(_vA, _vB, _vC, false, _intersectPoint);
|
|
230
|
+
if (intersect === null) {
|
|
231
|
+
// check second triangle
|
|
232
|
+
transformVertex(_vB.set(-0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos);
|
|
233
|
+
_uvB.set(0, 1);
|
|
234
|
+
intersect = raycaster.ray.intersectTriangle(_vA, _vC, _vB, false, _intersectPoint);
|
|
235
|
+
if (intersect === null) return;
|
|
236
|
+
}
|
|
237
|
+
var distance = raycaster.ray.origin.distanceTo(_intersectPoint);
|
|
238
|
+
if (distance < raycaster.near || distance > raycaster.far) return;
|
|
239
|
+
intersects.push({
|
|
240
|
+
distance: distance,
|
|
241
|
+
point: _intersectPoint.clone(),
|
|
242
|
+
uv: Triangle.getInterpolation(_intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2()),
|
|
243
|
+
face: null,
|
|
244
|
+
object: this
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}]);
|
|
248
|
+
return SpritePoi;
|
|
249
|
+
}(Poi);
|
|
250
|
+
function transformVertex(vertexPosition, mvPosition, center, scale, sin, cos) {
|
|
251
|
+
var _alignedPosition = /* @__PURE__ */new Vector2();
|
|
252
|
+
var _rotatedPosition = /* @__PURE__ */new Vector2();
|
|
253
|
+
// compute position in camera space
|
|
254
|
+
_alignedPosition.subVectors(new Vector2(vertexPosition.x, vertexPosition.y), center).addScalar(0.5).multiply(new Vector2(scale.x, scale.y));
|
|
255
|
+
|
|
256
|
+
// to check if rotation is not zero
|
|
257
|
+
if (sin !== undefined && cos !== undefined) {
|
|
258
|
+
_rotatedPosition.x = cos * _alignedPosition.x - sin * _alignedPosition.y;
|
|
259
|
+
_rotatedPosition.y = sin * _alignedPosition.x + cos * _alignedPosition.y;
|
|
260
|
+
} else {
|
|
261
|
+
_rotatedPosition.copy(_alignedPosition);
|
|
262
|
+
}
|
|
263
|
+
vertexPosition.copy(mvPosition);
|
|
264
|
+
vertexPosition.x += _rotatedPosition.x;
|
|
265
|
+
vertexPosition.y += _rotatedPosition.y;
|
|
266
|
+
|
|
267
|
+
// transform to world space
|
|
268
|
+
vertexPosition.applyMatrix4(_viewWorldMatrix);
|
|
269
|
+
}
|
|
270
|
+
export default SpritePoi;
|
|
271
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BufferGeometry","InterleavedBuffer","InterleavedBufferAttribute","Matrix4","SpriteMaterial","Triangle","Vector2","Vector3","utils","gsap","EAnimationType","createContentElement","createTitleElement","Poi","_default","scale","animation","type","grow","duration","_viewWorldMatrix","createDomTexture","SpritePoi","data","option","isSprite","geometry","getGeometry","setMaterial","setAnimation","play","_geometry","float32Array","Float32Array","interleavedBuffer","setIndex","setAttribute","width","height","center","visible","initMaterial","HTMLElement","element","title","content","texture","isFadeOrAppearAnimation","fadeIn","appear","opacity","needsUpdate","material","map","Array","isArray","hasExecuted","isGrow","onAfterRender","forEach","item","to","repeat","ease","tween","onUpdateParams","onUpdate","progress","setScalar","cb","raycaster","intersects","camera","console","error","_worldScale","_mvPosition","setFromMatrixScale","matrixWorld","copy","modelViewMatrix","multiplyMatrices","matrixWorldInverse","setFromMatrixPosition","isPerspectiveCamera","sizeAttenuation","multiplyScalar","z","rotation","sin","cos","Math","_vA","_vB","_vC","_uvA","_uvB","_uvC","transformVertex","set","_intersectPoint","intersect","ray","intersectTriangle","distance","origin","distanceTo","near","far","push","point","clone","uv","getInterpolation","face","object","vertexPosition","mvPosition","_alignedPosition","_rotatedPosition","subVectors","x","y","addScalar","multiply","undefined","applyMatrix4"],"sources":["../../../src/poi/Sprite/index.ts"],"sourcesContent":["import type { Raycaster } from '@anov/3d-core'\nimport { BufferGeometry, InterleavedBuffer, InterleavedBufferAttribute, Matrix4, SpriteMaterial, Triangle, Vector2, Vector3, utils } from '@anov/3d-core'\nimport gsap from 'gsap'\nimport { EAnimationType } from '../utils/type'\nimport type { IOption } from '../utils/type'\nimport { createContentElement, createTitleElement } from '../utils/element'\nimport Poi from '../Poi'\n\nconst _default = {\n scale: 15,\n animation: {\n type: EAnimationType.grow,\n duration: 0.3,\n },\n}\n\nconst _viewWorldMatrix = new Matrix4()\nconst { createDomTexture } = utils\n\nclass SpritePoi extends Poi {\n geometry!: BufferGeometry\n center!: Vector2\n material!: SpriteMaterial\n isSprite: boolean\n type: string\n\n data!: any\n option!: IOption\n animation: Array<any> = []\n\n constructor(data: any, option: IOption) {\n super(data, option)\n this.data = data\n this.option = { ..._default, ...option }\n\n this.isSprite = true\n this.type = 'Sprite'\n\n this.geometry = this.getGeometry()\n // 创建Sprite\n this.setMaterial()\n\n this.option.animation && this.setAnimation(this.option.animation)\n // 执行动画\n this.play()\n }\n\n private getGeometry() {\n const _geometry = new BufferGeometry()\n const float32Array = new Float32Array([\n -0.5, -0.5, 0, 0, 0,\n 0.5, -0.5, 0, 1, 0,\n 0.5, 0.5, 0, 1, 1,\n -0.5, 0.5, 0, 0, 1,\n ])\n\n const interleavedBuffer = new InterleavedBuffer(float32Array, 5)\n\n _geometry.setIndex([0, 1, 2, 0, 2, 3])\n _geometry.setAttribute('position', new InterleavedBufferAttribute(interleavedBuffer, 3, 0, false))\n _geometry.setAttribute('uv', new InterleavedBufferAttribute(interleavedBuffer, 2, 3, false))\n\n return _geometry\n }\n\n private setMaterial() {\n const { animation, width, height } = this.option\n // 精灵的锚点\n this.center = new Vector2(0.5, 0)\n\n this.visible = false\n // 异步生成材质\n const initMaterial = async () => {\n // 生成精灵模型\n let element!: HTMLElement\n // 直接传递DOM元素\n if (this.data instanceof HTMLElement) {\n element = this.data\n }\n else {\n if (typeof this.data === 'string') {\n element = createTitleElement(this.data, this.option)\n }\n else if (typeof this.data === 'object') {\n const { title, content } = this.data\n if (title && content)\n element = createContentElement(this.data, this.option)\n\n else if (title)\n element = createTitleElement(title, this.option)\n }\n }\n\n const texture = await createDomTexture(element, { width, height })\n // 判断条件\n const isFadeOrAppearAnimation = animation?.type === EAnimationType.fadeIn || animation?.type === EAnimationType.appear\n // 根据条件设置 opacity 的值\n const opacity = isFadeOrAppearAnimation ? 0 : 1\n\n texture.needsUpdate = true\n this.material = new SpriteMaterial({ map: texture, opacity })\n this.visible = true\n }\n initMaterial()\n }\n\n // 设置动画属性\n setAnimation(animation: object | Array<any>) {\n if (!animation)\n return\n if (Array.isArray(animation))\n this.animation = animation\n else\n this.animation = [animation]\n }\n\n // 播放动画\n play() {\n let hasExecuted = false\n let isGrow = false\n const { scale } = this.option\n // 执行渐显、打印内容等操作\n this.onAfterRender = () => {\n if (hasExecuted)\n return\n this.animation.forEach((item) => {\n switch (item.type) {\n case EAnimationType.fadeIn:\n gsap.to(this.material, {\n opacity: 1,\n ...item,\n repeat: 0,\n ease: 'none',\n })\n break\n case EAnimationType.grow:\n isGrow = true\n if (scale) {\n const tween = gsap.to({ scale: 1 }, {\n scale,\n ...item,\n repeat: 0,\n ease: 'power2.out',\n onUpdateParams: ['x'],\n onUpdate: () => {\n // 通过 tween 对象获取当前动画的进度\n const progress = tween.progress()\n this.scale.setScalar(progress * scale)\n },\n })\n }\n break\n }\n })\n if (!isGrow && scale)\n this.scale.setScalar(scale)\n\n hasExecuted = true\n }\n }\n\n addEventListener(type: string, cb: any) {\n super.addEventListener(type, cb)\n return () => super.removeEventListener(type, cb)\n }\n\n raycast(raycaster: Raycaster, intersects: any) {\n if (raycaster.camera === null)\n console.error('THREE.Sprite: \"Raycaster.camera\" needs to be set in order to raycast against sprites.')\n\n const _worldScale = /* @__PURE__ */ new Vector3()\n const _mvPosition = /* @__PURE__ */ new Vector3()\n _worldScale.setFromMatrixScale(this.matrixWorld)\n\n _viewWorldMatrix.copy(raycaster.camera.matrixWorld)\n this.modelViewMatrix.multiplyMatrices(raycaster.camera.matrixWorldInverse, this.matrixWorld)\n\n _mvPosition.setFromMatrixPosition(this.modelViewMatrix)\n\n if (raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false)\n\n _worldScale.multiplyScalar(-_mvPosition.z)\n\n const rotation = this.material.rotation\n let sin, cos\n\n if (rotation !== 0) {\n cos = Math.cos(rotation)\n sin = Math.sin(rotation)\n }\n\n const center = this.center\n const _vA = /* @__PURE__ */ new Vector3()\n const _vB = /* @__PURE__ */ new Vector3()\n const _vC = /* @__PURE__ */ new Vector3()\n\n const _uvA = /* @__PURE__ */ new Vector2()\n const _uvB = /* @__PURE__ */ new Vector2()\n const _uvC = /* @__PURE__ */ new Vector2()\n transformVertex(_vA.set(-0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos)\n transformVertex(_vB.set(0.5, -0.5, 0), _mvPosition, center, _worldScale, sin, cos)\n transformVertex(_vC.set(0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos)\n\n _uvA.set(0, 0)\n _uvB.set(1, 0)\n _uvC.set(1, 1)\n\n const _intersectPoint = /* @__PURE__ */ new Vector3()\n // check first triangle\n let intersect = raycaster.ray.intersectTriangle(_vA, _vB, _vC, false, _intersectPoint)\n\n if (intersect === null) {\n // check second triangle\n transformVertex(_vB.set(-0.5, 0.5, 0), _mvPosition, center, _worldScale, sin, cos)\n _uvB.set(0, 1)\n\n intersect = raycaster.ray.intersectTriangle(_vA, _vC, _vB, false, _intersectPoint)\n if (intersect === null)\n\n return\n }\n\n const distance = raycaster.ray.origin.distanceTo(_intersectPoint)\n\n if (distance < raycaster.near || distance > raycaster.far)\n return\n\n intersects.push({\n distance,\n point: _intersectPoint.clone(),\n uv: Triangle.getInterpolation(_intersectPoint, _vA, _vB, _vC, _uvA, _uvB, _uvC, new Vector2()),\n face: null,\n object: this,\n\n })\n }\n}\n\nfunction transformVertex(vertexPosition: Vector3, mvPosition: Vector3, center: Vector2, scale: Vector3, sin: number | undefined, cos: number | undefined) {\n const _alignedPosition = /* @__PURE__ */ new Vector2()\n const _rotatedPosition = /* @__PURE__ */ new Vector2()\n // compute position in camera space\n _alignedPosition.subVectors(new Vector2(vertexPosition.x, vertexPosition.y), center).addScalar(0.5).multiply(new Vector2(scale.x, scale.y))\n\n // to check if rotation is not zero\n if (sin !== undefined && cos !== undefined) {\n _rotatedPosition.x = (cos * _alignedPosition.x) - (sin * _alignedPosition.y)\n _rotatedPosition.y = (sin * _alignedPosition.x) + (cos * _alignedPosition.y)\n }\n else {\n _rotatedPosition.copy(_alignedPosition)\n }\n\n vertexPosition.copy(mvPosition)\n vertexPosition.x += _rotatedPosition.x\n vertexPosition.y += _rotatedPosition.y\n\n // transform to world space\n vertexPosition.applyMatrix4(_viewWorldMatrix)\n}\n\nexport default SpritePoi"],"mappings":"+CACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAASA,cAAc,EAAEC,iBAAiB,EAAEC,0BAA0B,EAAEC,OAAO,EAAEC,cAAc,EAAEC,QAAQ,EAAEC,OAAO,EAAEC,OAAO,EAAEC,KAAK,QAAQ,eAAe;AACzJ,OAAOC,IAAI,MAAM,MAAM;AACvB,SAASC,cAAc;AAEvB,SAASC,oBAAoB,EAAEC,kBAAkB;AACjD,OAAOC,GAAG;AAEV,IAAMC,QAAQ,GAAG;EACfC,KAAK,EAAE,EAAE;EACTC,SAAS,EAAE;IACTC,IAAI,EAAEP,cAAc,CAACQ,IAAI;IACzBC,QAAQ,EAAE;EACZ;AACF,CAAC;AAED,IAAMC,gBAAgB,GAAG,IAAIjB,OAAO,EAAE;AACtC,IAAQkB,gBAAgB,GAAKb,KAA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K/B,GAAG,GAAG4B,gBAAgB,CAACI,CAAE;EAC9E,CAAC,MACI;IACHH,gBAAgB,CAACxC,IAAI,CAACuC,gBAAgB,CAAC;EACzC;EAEAF,cAAc,CAACrC,IAAI,CAACsC,UAAU,CAAC;EAC/BD,cAAc,CAACK,CAAC,IAAIF,gBAAgB,CAACE,CAAC;EACtCL,cAAc,CAACM,CAAC,IAAIH,gBAAgB,CAACG,CAAC;;EAEtC;EACAN,cAAc,CAACU,YAAY,CAAC1G,gBAAgB,CAAC;AAC/C;AAEA,eAAeE,SAAS"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Sprite } from '@anov/3d-core';
|
|
2
|
+
import type { IOption } from '../utils/type';
|
|
3
|
+
declare class SpritePoi extends Sprite {
|
|
4
|
+
data: any;
|
|
5
|
+
option: IOption;
|
|
6
|
+
animation: Array<any>;
|
|
7
|
+
vScale: [number, number, number];
|
|
8
|
+
constructor(data: any, option: IOption);
|
|
9
|
+
private create;
|
|
10
|
+
setAnimation(animation: object | Array<any>): void;
|
|
11
|
+
play(): void;
|
|
12
|
+
addEventListener(type: string, cb: any): () => void;
|
|
13
|
+
}
|
|
14
|
+
export default SpritePoi;
|