@anov/3d-ability 0.0.6 → 0.0.7
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/camera/index.d.ts +11 -7
- package/dist/camera/index.js +48 -45
- package/dist/camera/index.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/poi/2D/index.d.ts +1 -0
- package/dist/poi/2D/index.js +10 -0
- package/dist/poi/2D/index.js.map +1 -1
- package/dist/poi/3D/index.d.ts +12 -18
- package/dist/poi/3D/index.js +159 -123
- package/dist/poi/3D/index.js.map +1 -1
- package/dist/poi/3D/index1.d.ts +19 -0
- package/dist/poi/3D/index1.js +144 -0
- package/dist/poi/3D/index1.js.map +1 -0
- package/dist/poi/Sprite/index.js +44 -51
- package/dist/poi/Sprite/index.js.map +1 -1
- package/dist/poi/index.d.ts +2 -1
- package/dist/poi/index.js +2 -1
- package/dist/poi/index.js.map +1 -1
- package/dist/poi/utils/type.d.ts +4 -4
- package/dist/poi/utils/type.js +2 -1
- package/dist/poi/utils/type.js.map +1 -1
- package/dist/postEffects/addACESFilmicToneMappingPass.d.ts +4 -0
- package/dist/postEffects/addACESFilmicToneMappingPass.js +28 -0
- package/dist/postEffects/addACESFilmicToneMappingPass.js.map +1 -0
- package/dist/postEffects/addBrightnessContrastPass.d.ts +4 -0
- package/dist/postEffects/addBrightnessContrastPass.js +28 -0
- package/dist/postEffects/addBrightnessContrastPass.js.map +1 -0
- package/dist/postEffects/bloomPass.d.ts +2 -2
- package/dist/postEffects/bloomPass.js +14 -19
- package/dist/postEffects/bloomPass.js.map +1 -1
- package/dist/postEffects/colorifyPass.d.ts +6 -0
- package/dist/postEffects/colorifyPass.js +33 -0
- package/dist/postEffects/colorifyPass.js.map +1 -0
- package/dist/postEffects/index.d.ts +7 -1
- package/dist/postEffects/index.js +16 -5
- package/dist/postEffects/index.js.map +1 -1
- package/dist/postEffects/shader/colorify.d.ts +17 -0
- package/dist/postEffects/shader/colorify.js +19 -0
- package/dist/postEffects/shader/colorify.js.map +1 -0
- package/dist/postEffects/shader/gammaCorrectionShader.d.ts +15 -0
- package/dist/postEffects/shader/gammaCorrectionShader.js +18 -0
- package/dist/postEffects/shader/gammaCorrectionShader.js.map +1 -0
- package/dist/postEffects/shader/mapping.d.ts +19 -0
- package/dist/postEffects/shader/mapping.js +22 -0
- package/dist/postEffects/shader/mapping.js.map +1 -0
- package/dist/postEffects/shader/thermalMaging.d.ts +17 -0
- package/dist/postEffects/shader/thermalMaging.js +18 -0
- package/dist/postEffects/shader/thermalMaging.js.map +1 -0
- package/package.json +3 -3
package/dist/poi/Sprite/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
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
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
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; }
|
|
@@ -19,13 +19,11 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
19
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
20
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
21
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';
|
|
22
|
+
import { BufferGeometry, InterleavedBuffer, InterleavedBufferAttribute, Matrix4, SpriteMaterial, TextureLoader, Triangle, Vector2, Vector3, utils } from '@anov/3d-core';
|
|
23
23
|
import gsap from 'gsap';
|
|
24
24
|
import { EAnimationType } from "../utils/type";
|
|
25
|
-
import { createContentElement, createTitleElement } from "../utils/element";
|
|
26
25
|
import Poi from "../Poi";
|
|
27
26
|
var _default = {
|
|
28
|
-
scale: 15,
|
|
29
27
|
animation: {
|
|
30
28
|
type: EAnimationType.grow,
|
|
31
29
|
duration: 0.3
|
|
@@ -75,49 +73,50 @@ var SpritePoi = /*#__PURE__*/function (_Poi) {
|
|
|
75
73
|
key: "setMaterial",
|
|
76
74
|
value: function setMaterial() {
|
|
77
75
|
var _this2 = this;
|
|
78
|
-
var
|
|
79
|
-
animation =
|
|
80
|
-
width =
|
|
81
|
-
height =
|
|
76
|
+
var _ref = this.option,
|
|
77
|
+
animation = _ref.animation,
|
|
78
|
+
width = _ref.width,
|
|
79
|
+
height = _ref.height;
|
|
82
80
|
// 精灵的锚点
|
|
83
81
|
this.center = new Vector2(0.5, 0);
|
|
84
82
|
this.visible = false;
|
|
85
83
|
// 异步生成材质
|
|
86
84
|
var initMaterial = /*#__PURE__*/function () {
|
|
87
|
-
var
|
|
88
|
-
var
|
|
85
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
86
|
+
var texture, element, isFadeOrAppearAnimation, opacity;
|
|
89
87
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
90
88
|
while (1) switch (_context.prev = _context.next) {
|
|
91
89
|
case 0:
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
}
|
|
90
|
+
if (!(_this2.data instanceof HTMLElement)) {
|
|
91
|
+
_context.next = 7;
|
|
92
|
+
break;
|
|
104
93
|
}
|
|
105
|
-
|
|
94
|
+
element = _this2.data;
|
|
95
|
+
_context.next = 4;
|
|
106
96
|
return createDomTexture(element, {
|
|
107
97
|
width: width,
|
|
108
98
|
height: height
|
|
109
99
|
});
|
|
110
|
-
case
|
|
100
|
+
case 4:
|
|
111
101
|
texture = _context.sent;
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
102
|
+
_context.next = 8;
|
|
103
|
+
break;
|
|
104
|
+
case 7:
|
|
105
|
+
if (typeof _this2.data === 'string') {
|
|
106
|
+
texture = new TextureLoader().load(_this2.data);
|
|
107
|
+
}
|
|
108
|
+
case 8:
|
|
109
|
+
if (texture) {
|
|
110
|
+
// 判断条件
|
|
111
|
+
isFadeOrAppearAnimation = animation.type === EAnimationType.fadeIn || (animation === null || animation === void 0 ? void 0 : animation.type) === EAnimationType.appear; // 根据条件设置 opacity 的值
|
|
112
|
+
opacity = isFadeOrAppearAnimation ? 0 : 1;
|
|
113
|
+
texture.needsUpdate = true;
|
|
114
|
+
_this2.material = new SpriteMaterial({
|
|
115
|
+
map: texture,
|
|
116
|
+
opacity: opacity
|
|
117
|
+
});
|
|
118
|
+
_this2.visible = true;
|
|
119
|
+
}
|
|
121
120
|
case 9:
|
|
122
121
|
case "end":
|
|
123
122
|
return _context.stop();
|
|
@@ -125,7 +124,7 @@ var SpritePoi = /*#__PURE__*/function (_Poi) {
|
|
|
125
124
|
}, _callee);
|
|
126
125
|
}));
|
|
127
126
|
return function initMaterial() {
|
|
128
|
-
return
|
|
127
|
+
return _ref2.apply(this, arguments);
|
|
129
128
|
};
|
|
130
129
|
}();
|
|
131
130
|
initMaterial();
|
|
@@ -162,26 +161,20 @@ var SpritePoi = /*#__PURE__*/function (_Poi) {
|
|
|
162
161
|
break;
|
|
163
162
|
case EAnimationType.grow:
|
|
164
163
|
isGrow = true;
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
// 通过 tween 对象获取当前动画的进度
|
|
176
|
-
var progress = tween.progress();
|
|
177
|
-
_this3.scale.setScalar(progress * scale);
|
|
178
|
-
}
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
164
|
+
var initScale = scale ? new Vector3().fromArray(scale) : _this3.scale.clone();
|
|
165
|
+
_this3.scale.setScalar(0);
|
|
166
|
+
gsap.to(_this3.scale, _objectSpread(_objectSpread({
|
|
167
|
+
x: initScale.x,
|
|
168
|
+
y: initScale.y,
|
|
169
|
+
z: initScale.z
|
|
170
|
+
}, item), {}, {
|
|
171
|
+
repeat: 0,
|
|
172
|
+
ease: 'power2.out'
|
|
173
|
+
}));
|
|
181
174
|
break;
|
|
182
175
|
}
|
|
183
176
|
});
|
|
184
|
-
if (!isGrow && scale) _this3.scale.
|
|
177
|
+
if (!isGrow && scale) _this3.scale.copy(new Vector3().fromArray(scale));
|
|
185
178
|
hasExecuted = true;
|
|
186
179
|
};
|
|
187
180
|
}
|
|
@@ -1 +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(_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xJ,IAAM4B,gBAAgB,GAAG,eAAgB,IAAIhH,OAAO,EAAE;EACtD,IAAMiH,gBAAgB,GAAG,eAAgB,IAAIjH,OAAO,EAAE;EACtD;EACAgH,gBAAgB,CAACE,UAAU,CAAC,IAAIlH,OAAO,CAAC8G,cAAc,CAACK,CAAC,EAAEL,cAAc,CAACM,CAAC,CAAC,EAAEnF,MAAM,CAAC,CAACoF,SAAS,CAAC,GAAG,CAAC,CAACC,QAAQ,CAAC,IAAItH,OAAO,CAACS,KAAK,CAAC0G,CAAC,EAAE1G,KAAK,CAAC2G,CAAC,CAAC,CAAC;;EAE3I;EACA,IAAIjC,GAAG,KAAKoC,SAAS,IAAInC,GAAG,KAAKmC,SAAS,EAAE;IAC1CN,gBAAgB,CAACE,CAAC,GAAI/B,GAAG,GAAG4B,gBAAgB,CAACG,CAAC,GAAKhC,GAAG,GAAG6B,gBAAgB,CAACI,CAAE;IAC5EH,gBAAgB,CAACG,CAAC,GAAIjC,GAAG,GAAG6B,gBAAgB,CAACG,CAAC,GAAK/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"}
|
|
1
|
+
{"version":3,"names":["BufferGeometry","InterleavedBuffer","InterleavedBufferAttribute","Matrix4","SpriteMaterial","TextureLoader","Triangle","Vector2","Vector3","utils","gsap","EAnimationType","Poi","_default","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","texture","load","isFadeOrAppearAnimation","fadeIn","appear","opacity","needsUpdate","material","map","Array","isArray","hasExecuted","isGrow","scale","onAfterRender","forEach","item","to","repeat","ease","initScale","fromArray","clone","setScalar","x","y","z","copy","cb","raycaster","intersects","camera","console","error","_worldScale","_mvPosition","setFromMatrixScale","matrixWorld","modelViewMatrix","multiplyMatrices","matrixWorldInverse","setFromMatrixPosition","isPerspectiveCamera","sizeAttenuation","multiplyScalar","rotation","sin","cos","Math","_vA","_vB","_vC","_uvA","_uvB","_uvC","transformVertex","set","_intersectPoint","intersect","ray","intersectTriangle","distance","origin","distanceTo","near","far","push","point","uv","getInterpolation","face","object","vertexPosition","mvPosition","_alignedPosition","_rotatedPosition","subVectors","addScalar","multiply","undefined","applyMatrix4"],"sources":["../../../src/poi/Sprite/index.ts"],"sourcesContent":["import type { PerspectiveCamera, Raycaster } from '@anov/3d-core'\nimport { BufferGeometry, InterleavedBuffer, InterleavedBufferAttribute, Matrix4, SpriteMaterial, TextureLoader, Triangle, Vector2, Vector3, utils } from '@anov/3d-core'\nimport gsap from 'gsap'\nimport { EAnimationType } from '../utils/type'\nimport type { IAnimation, IOption } from '../utils/type'\nimport { createContentElement, createTitleElement } from '../utils/element'\nimport Poi from '../Poi'\n\nconst _default = {\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 as {\n animation: IAnimation\n width: number\n height: number\n }\n // 精灵的锚点\n this.center = new Vector2(0.5, 0)\n\n this.visible = false\n // 异步生成材质\n const initMaterial = async () => {\n let texture\n // 直接传递DOM元素\n if (this.data instanceof HTMLElement) {\n const element: HTMLElement = this.data\n texture = await createDomTexture(element, { width, height })\n }\n else if (typeof this.data === 'string') {\n texture = new TextureLoader().load(this.data)\n }\n\n if (texture) {\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 }\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 const initScale = scale ? new Vector3().fromArray(scale) : this.scale.clone()\n this.scale.setScalar(0)\n gsap.to(this.scale, {\n x: initScale.x,\n y: initScale.y,\n z: initScale.z,\n ...item,\n repeat: 0,\n ease: 'power2.out',\n })\n break\n }\n })\n if (!isGrow && scale)\n this.scale.copy(new Vector3().fromArray(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 as PerspectiveCamera & { isPerspectiveCamera: boolean }).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,SAASA,cAAc,EAAEC,iBAAiB,EAAEC,0BAA0B,EAAEC,OAAO,EAAEC,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qB,GAAG,GAAG4B,gBAAgB,CAAClD,CAAC,GAAKuB,GAAG,GAAG2B,gBAAgB,CAACjD,CAAE;EAC9E,CAAC,MACI;IACHkD,gBAAgB,CAAChD,IAAI,CAAC+C,gBAAgB,CAAC;EACzC;EAEAF,cAAc,CAAC7C,IAAI,CAAC8C,UAAU,CAAC;EAC/BD,cAAc,CAAChD,CAAC,IAAImD,gBAAgB,CAACnD,CAAC;EACtCgD,cAAc,CAAC/C,CAAC,IAAIkD,gBAAgB,CAAClD,CAAC;;EAEtC;EACA+C,cAAc,CAACQ,YAAY,CAACxG,gBAAgB,CAAC;AAC/C;AAEA,eAAeE,SAAS"}
|
package/dist/poi/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Css2DPoi from './2D/index';
|
|
2
|
+
import Css3DPoi from './3D/index';
|
|
2
3
|
import SpritePoi from './Sprite/index';
|
|
3
4
|
import { EAnimationType } from './utils/type';
|
|
4
|
-
export { Css2DPoi, SpritePoi, EAnimationType };
|
|
5
|
+
export { Css2DPoi, Css3DPoi, SpritePoi, EAnimationType };
|
package/dist/poi/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Css2DPoi from "./2D/index";
|
|
2
|
+
import Css3DPoi from "./3D/index";
|
|
2
3
|
import SpritePoi from "./Sprite/index";
|
|
3
4
|
import { EAnimationType } from "./utils/type";
|
|
4
|
-
export { Css2DPoi, SpritePoi, EAnimationType };
|
|
5
|
+
export { Css2DPoi, Css3DPoi, SpritePoi, EAnimationType };
|
|
5
6
|
//# sourceMappingURL=index.js.map
|
package/dist/poi/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Css2DPoi","SpritePoi","EAnimationType"],"sources":["../../src/poi/index.ts"],"sourcesContent":["import Css2DPoi from './2D/index'\nimport SpritePoi from './Sprite/index'\nimport { EAnimationType } from './utils/type'\n\nexport { Css2DPoi, SpritePoi, EAnimationType }"],"mappings":"AAAA,OAAOA,QAAQ;AACf,OAAOC,SAAS;AAChB,SAASC,cAAc;AAEvB,
|
|
1
|
+
{"version":3,"names":["Css2DPoi","Css3DPoi","SpritePoi","EAnimationType"],"sources":["../../src/poi/index.ts"],"sourcesContent":["import Css2DPoi from './2D/index'\nimport Css3DPoi from './3D/index'\nimport SpritePoi from './Sprite/index'\nimport { EAnimationType } from './utils/type'\n\nexport { Css2DPoi, Css3DPoi, SpritePoi, EAnimationType }"],"mappings":"AAAA,OAAOA,QAAQ;AACf,OAAOC,QAAQ;AACf,OAAOC,SAAS;AAChB,SAASC,cAAc;AAEvB,SAASH,QAAQ,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,cAAc"}
|
package/dist/poi/utils/type.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ export interface IOption {
|
|
|
2
2
|
width?: number;
|
|
3
3
|
height?: number;
|
|
4
4
|
img?: string;
|
|
5
|
-
scale?: number;
|
|
5
|
+
scale?: number[];
|
|
6
6
|
style?: object;
|
|
7
7
|
animation?: IAnimation | Array<IAnimation>;
|
|
8
8
|
}
|
|
9
|
-
interface IAnimation {
|
|
9
|
+
export interface IAnimation {
|
|
10
10
|
type?: EAnimationType;
|
|
11
11
|
duration?: number;
|
|
12
12
|
repeat?: number;
|
|
@@ -16,11 +16,11 @@ interface IAnimation {
|
|
|
16
16
|
export declare enum EAnimationType {
|
|
17
17
|
fadeIn = "fadeIn",
|
|
18
18
|
grow = "grow",
|
|
19
|
-
print = "print"
|
|
19
|
+
print = "print",
|
|
20
|
+
appear = "appear"
|
|
20
21
|
}
|
|
21
22
|
export declare type IEventType = {
|
|
22
23
|
name: string;
|
|
23
24
|
orbitControls: boolean;
|
|
24
25
|
};
|
|
25
26
|
export declare const EventType: Array<IEventType>;
|
|
26
|
-
export {};
|
package/dist/poi/utils/type.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export var EAnimationType;
|
|
1
|
+
export var EAnimationType;
|
|
2
2
|
(function (EAnimationType) {
|
|
3
3
|
EAnimationType["fadeIn"] = "fadeIn";
|
|
4
4
|
EAnimationType["grow"] = "grow";
|
|
5
5
|
EAnimationType["print"] = "print";
|
|
6
|
+
EAnimationType["appear"] = "appear";
|
|
6
7
|
})(EAnimationType || (EAnimationType = {}));
|
|
7
8
|
// 事件类型
|
|
8
9
|
export var EventType = [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["EAnimationType","EventType","name","orbitControls"],"sources":["../../../src/poi/utils/type.ts"],"sourcesContent":["export interface IOption {\n width?: number\n height?: number\n img?: string\n scale?: number\n style?: object // 支持所有CSS样式\n animation?: IAnimation | Array<IAnimation>\n}\
|
|
1
|
+
{"version":3,"names":["EAnimationType","EventType","name","orbitControls"],"sources":["../../../src/poi/utils/type.ts"],"sourcesContent":["export interface IOption {\n width?: number\n height?: number\n img?: string\n scale?: number[]\n style?: object // 支持所有CSS样式\n animation?: IAnimation | Array<IAnimation>\n}\nexport interface IAnimation {\n type?: EAnimationType\n duration?: number\n repeat?: number\n ease?: string\n yoyo?: boolean\n}\n\nexport enum EAnimationType {\n fadeIn = 'fadeIn', // 渐显\n grow = 'grow', // 生长\n print = 'print', // 打印(用于文字)\n appear = 'appear',\n}\n\nexport type IEventType = {\n name: string\n orbitControls: boolean\n}\n\n// 事件类型\nexport const EventType: Array<IEventType> = [\n { name: 'click', orbitControls: false },\n { name: 'dbclick', orbitControls: true },\n { name: 'mouseover', orbitControls: false },\n { name: 'mouseout', orbitControls: true },\n { name: 'mouseup', orbitControls: true },\n { name: 'mousedown', orbitControls: false },\n]"],"mappings":"AAgBA,WAAYA,cAAc;AAKzB,WALWA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,KAAdA,cAAc;AAY1B;AACA,OAAO,IAAMC,SAA4B,GAAG,CAC1C;EAAEC,IAAI,EAAE,OAAO;EAAEC,aAAa,EAAE;AAAM,CAAC,EACvC;EAAED,IAAI,EAAE,SAAS;EAAEC,aAAa,EAAE;AAAK,CAAC,EACxC;EAAED,IAAI,EAAE,WAAW;EAAEC,aAAa,EAAE;AAAM,CAAC,EAC3C;EAAED,IAAI,EAAE,UAAU;EAAEC,aAAa,EAAE;AAAK,CAAC,EACzC;EAAED,IAAI,EAAE,SAAS;EAAEC,aAAa,EAAE;AAAK,CAAC,EACxC;EAAED,IAAI,EAAE,WAAW;EAAEC,aAAa,EAAE;AAAM,CAAC,CAC5C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { lib, use, utils } from '@anov/3d-core';
|
|
2
|
+
import ACESFilmicToneMappingShader from "./shader/mapping";
|
|
3
|
+
var storeManagement = utils.storeManagement;
|
|
4
|
+
var CopyShader = lib.CopyShader,
|
|
5
|
+
ShaderPass = lib.ShaderPass;
|
|
6
|
+
var addmappingExposurePass = function addmappingExposurePass() {
|
|
7
|
+
var exposure = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
|
|
8
|
+
var _use$useScene = use.useScene(),
|
|
9
|
+
scene = _use$useScene.scene,
|
|
10
|
+
camera = _use$useScene.camera;
|
|
11
|
+
var composer = storeManagement.get('composer');
|
|
12
|
+
if (!scene || !camera) throw new Error('scene or camera is not defined,');
|
|
13
|
+
if (!composer) throw new Error('composer is not defined, please initPostEffects first');
|
|
14
|
+
var effectCopy = new ShaderPass(CopyShader);
|
|
15
|
+
effectCopy.renderToScreen = true;
|
|
16
|
+
ACESFilmicToneMappingShader.uniforms.exposure.value = exposure;
|
|
17
|
+
var mappingExposurePass = new ShaderPass(ACESFilmicToneMappingShader);
|
|
18
|
+
composer.addPass(effectCopy);
|
|
19
|
+
composer.addPass(mappingExposurePass);
|
|
20
|
+
return {
|
|
21
|
+
clean: function clean() {
|
|
22
|
+
composer.removePass(effectCopy);
|
|
23
|
+
composer.removePass(mappingExposurePass);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default addmappingExposurePass;
|
|
28
|
+
//# sourceMappingURL=addACESFilmicToneMappingPass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["lib","use","utils","ACESFilmicToneMappingShader","storeManagement","CopyShader","ShaderPass","addmappingExposurePass","exposure","useScene","scene","camera","composer","get","Error","effectCopy","renderToScreen","uniforms","value","mappingExposurePass","addPass","clean","removePass"],"sources":["../../src/postEffects/addACESFilmicToneMappingPass.ts"],"sourcesContent":["import { lib, use, utils } from '@anov/3d-core'\nimport ACESFilmicToneMappingShader from './shader/mapping'\n\nconst { storeManagement } = utils\nconst { CopyShader, ShaderPass } = lib\n\nconst addmappingExposurePass = (exposure = 0.5) => {\n const { scene, camera } = use.useScene()\n const composer = storeManagement.get('composer') as lib.EffectComposer | undefined\n\n if (!scene || !camera)\n throw new Error('scene or camera is not defined,')\n\n if (!composer)\n throw new Error('composer is not defined, please initPostEffects first')\n\n const effectCopy = new ShaderPass(CopyShader)\n effectCopy.renderToScreen = true\n\n ACESFilmicToneMappingShader.uniforms.exposure.value = exposure\n\n const mappingExposurePass = new ShaderPass(ACESFilmicToneMappingShader)\n\n composer.addPass(effectCopy)\n composer.addPass(mappingExposurePass)\n\n return {\n clean: () => {\n composer.removePass(effectCopy)\n composer.removePass(mappingExposurePass)\n },\n\n }\n}\n\nexport default addmappingExposurePass"],"mappings":"AAAA,SAASA,GAAG,EAAEC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AAC/C,OAAOC,2BAA2B;AAElC,IAAQC,eAAe,GAAKF,KAAK,CAAzBE,eAAe;AACvB,IAAQC,UAAU,GAAiBL,GAAG,CAA9BK,UAAU;EAAEC,UAAU,GAAKN,GAAG,CAAlBM,UAAU;AAE9B,IAAMC,sBAAsB,GAAG,SAAzBA,sBAAsB,GAAuB;EAAA,IAAnBC,QAAQ,uEAAG,GAAG;EAC5C,oBAA0BP,GAAG,CAACQ,QAAQ,EAAE;IAAhCC,KAAK,iBAALA,KAAK;IAAEC,MAAM,iBAANA,MAAM;EACrB,IAAMC,QAAQ,GAAGR,eAAe,CAACS,GAAG,CAAC,UAAU,CAAmC;EAElF,IAAI,CAACH,KAAK,IAAI,CAACC,MAAM,EACnB,MAAM,IAAIG,KAAK,CAAC,iCAAiC,CAAC;EAEpD,IAAI,CAACF,QAAQ,EACX,MAAM,IAAIE,KAAK,CAAC,uDAAuD,CAAC;EAE1E,IAAMC,UAAU,GAAG,IAAIT,UAAU,CAACD,UAAU,CAAC;EAC7CU,UAAU,CAACC,cAAc,GAAG,IAAI;EAEhCb,2BAA2B,CAACc,QAAQ,CAACT,QAAQ,CAACU,KAAK,GAAGV,QAAQ;EAE9D,IAAMW,mBAAmB,GAAG,IAAIb,UAAU,CAACH,2BAA2B,CAAC;EAEvES,QAAQ,CAACQ,OAAO,CAACL,UAAU,CAAC;EAC5BH,QAAQ,CAACQ,OAAO,CAACD,mBAAmB,CAAC;EAErC,OAAO;IACLE,KAAK,EAAE,iBAAM;MACXT,QAAQ,CAACU,UAAU,CAACP,UAAU,CAAC;MAC/BH,QAAQ,CAACU,UAAU,CAACH,mBAAmB,CAAC;IAC1C;EAEF,CAAC;AACH,CAAC;AAED,eAAeZ,sBAAsB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { lib, use, utils } from '@anov/3d-core';
|
|
2
|
+
var storeManagement = utils.storeManagement;
|
|
3
|
+
var CopyShader = lib.CopyShader,
|
|
4
|
+
ShaderPass = lib.ShaderPass,
|
|
5
|
+
BrightnessContrastShader = lib.BrightnessContrastShader;
|
|
6
|
+
var addBrightnessContrastPass = function addBrightnessContrastPass() {
|
|
7
|
+
var brightness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.5;
|
|
8
|
+
var _use$useScene = use.useScene(),
|
|
9
|
+
scene = _use$useScene.scene,
|
|
10
|
+
camera = _use$useScene.camera;
|
|
11
|
+
var composer = storeManagement.get('composer');
|
|
12
|
+
if (!scene || !camera) throw new Error('scene or camera is not defined,');
|
|
13
|
+
if (!composer) throw new Error('composer is not defined, please initPostEffects first');
|
|
14
|
+
var effectCopy = new ShaderPass(CopyShader);
|
|
15
|
+
effectCopy.renderToScreen = true;
|
|
16
|
+
BrightnessContrastShader.uniforms.brightness.value = brightness;
|
|
17
|
+
var brightnessContrastPass = new ShaderPass(BrightnessContrastShader);
|
|
18
|
+
composer.addPass(effectCopy);
|
|
19
|
+
composer.addPass(brightnessContrastPass);
|
|
20
|
+
return {
|
|
21
|
+
clean: function clean() {
|
|
22
|
+
composer.removePass(effectCopy);
|
|
23
|
+
composer.removePass(brightnessContrastPass);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export default addBrightnessContrastPass;
|
|
28
|
+
//# sourceMappingURL=addBrightnessContrastPass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["lib","use","utils","storeManagement","CopyShader","ShaderPass","BrightnessContrastShader","addBrightnessContrastPass","brightness","useScene","scene","camera","composer","get","Error","effectCopy","renderToScreen","uniforms","value","brightnessContrastPass","addPass","clean","removePass"],"sources":["../../src/postEffects/addBrightnessContrastPass.ts"],"sourcesContent":["import { lib, use, utils } from '@anov/3d-core'\n\nconst { storeManagement } = utils\nconst { CopyShader, ShaderPass, BrightnessContrastShader } = lib\n\nconst addBrightnessContrastPass = (brightness = 0.5) => {\n const { scene, camera } = use.useScene()\n const composer = storeManagement.get('composer') as lib.EffectComposer | undefined\n\n if (!scene || !camera)\n throw new Error('scene or camera is not defined,')\n\n if (!composer)\n throw new Error('composer is not defined, please initPostEffects first')\n\n const effectCopy = new ShaderPass(CopyShader)\n effectCopy.renderToScreen = true\n\n BrightnessContrastShader.uniforms.brightness.value = brightness\n\n const brightnessContrastPass = new ShaderPass(BrightnessContrastShader)\n\n composer.addPass(effectCopy)\n composer.addPass(brightnessContrastPass)\n\n return {\n clean: () => {\n composer.removePass(effectCopy)\n composer.removePass(brightnessContrastPass)\n },\n\n }\n}\n\nexport default addBrightnessContrastPass"],"mappings":"AAAA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agement;
|
|
1
|
+
import { use } from '@anov/3d-core';
|
|
2
|
+
import { BloomEffect, EffectComposer, EffectPass, RenderPass } from 'postprocessing';
|
|
4
3
|
var useScene = use.useScene;
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* create bloom selected
|
|
8
7
|
*/
|
|
9
|
-
var
|
|
8
|
+
var addBloomSelected = function addBloomSelected() {
|
|
10
9
|
var _useScene = useScene(),
|
|
11
10
|
scene = _useScene.scene,
|
|
12
|
-
camera = _useScene.camera
|
|
13
|
-
|
|
11
|
+
camera = _useScene.camera,
|
|
12
|
+
renderer = _useScene.renderer;
|
|
14
13
|
if (!scene || !camera) throw new Error('scene or camera is not defined,');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
height: 480
|
|
14
|
+
var composer = new EffectComposer(renderer);
|
|
15
|
+
composer.addPass(new RenderPass(scene, camera));
|
|
16
|
+
composer.addPass(new EffectPass(camera, new BloomEffect({
|
|
17
|
+
intensity: 1,
|
|
18
|
+
luminanceThreshold: 0
|
|
19
|
+
})));
|
|
20
|
+
use.useframeAfter(function () {
|
|
21
|
+
composer.render();
|
|
24
22
|
});
|
|
25
|
-
bloomEffect.inverted = true;
|
|
26
|
-
var effectPass = new EffectPass(camera, bloomEffect);
|
|
27
|
-
composer.addPass(effectPass);
|
|
28
23
|
return function () {};
|
|
29
24
|
};
|
|
30
|
-
export default
|
|
25
|
+
export default addBloomSelected;
|
|
31
26
|
//# sourceMappingURL=bloomPass.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["use","BloomEffect","EffectComposer","EffectPass","RenderPass","useScene","addBloomSelected","scene","camera","renderer","Error","composer","addPass","intensity","luminanceThreshold","useframeAfter","render"],"sources":["../../src/postEffects/bloomPass.ts"],"sourcesContent":["import { use } from '@anov/3d-core'\nimport { BlendFunction, BloomEffect, EffectComposer, EffectPass, RenderPass, SelectiveBloomEffect } from 'postprocessing'\n\nconst { useScene } = use\n\n/**\n * create bloom selected\n */\nconst addBloomSelected = () => {\n const { scene, camera, renderer } = useScene()\n\n if (!scene || !camera)\n throw new Error('scene or camera is not defined,')\n\n const composer = new EffectComposer(renderer!)\n\n composer.addPass(new RenderPass(scene, camera))\n composer.addPass(new EffectPass(camera, new BloomEffect({\n intensity: 1,\n luminanceThreshold: 0,\n })))\n\n use.useframeAfter(() => {\n composer.render()\n })\n\n return () => {\n\n }\n}\n\nexport default addBloomSelected"],"mappings":"AAAA,SAASA,GAAG,QAAQ,eAAe;AACnC,SAAwBC,WAAW,EAAEC,cAAc,EAAEC,UAAU,EAAEC,UAAU,QAA8B,gBAAgB;AAEzH,IAAQC,QAAQ,GAAKL,GAAG,CAAhBK,QAAQ;;AAEhB;AACA;AACA;AACA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgB,GAAS;EAC7B,gBAAoCD,QAAQ,EAAE;IAAtCE,KAAK,aAALA,KAAK;IAAEC,MAAM,aAANA,MAAM;IAAEC,QAAQ,aAARA,QAAQ;EAE/B,IAAI,CAACF,KAAK,IAAI,CAACC,MAAM,EACnB,MAAM,IAAIE,KAAK,CAAC,iCAAiC,CAAC;EAEpD,IAAMC,QAAQ,GAAG,IAAIT,cAAc,CAACO,QAAQ,CAAE;EAE9CE,QAAQ,CAACC,OAAO,CAAC,IAAIR,UAAU,CAACG,KAAK,EAAEC,MAAM,CAAC,CAAC;EAC/CG,QAAQ,CAACC,OAAO,CAAC,IAAIT,UAAU,CAACK,MAAM,EAAE,IAAIP,WAAW,CAAC;IACtDY,SAAS,EAAE,CAAC;IACZC,kBAAkB,EAAE;EACtB,CAAC,CAAC,CAAC,CAAC;EAEJd,GAAG,CAACe,aAAa,CAAC,YAAM;IACtBJ,QAAQ,CAACK,MAAM,EAAE;EACnB,CAAC,CAAC;EAEF,OAAO,YAAM,CAEb,CAAC;AACH,CAAC;AAED,eAAeV,gBAAgB"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { lib, use, utils } from '@anov/3d-core';
|
|
2
|
+
import ColorifyShader from "./shader/colorify";
|
|
3
|
+
var storeManagement = utils.storeManagement;
|
|
4
|
+
var CopyShader = lib.CopyShader,
|
|
5
|
+
ShaderPass = lib.ShaderPass;
|
|
6
|
+
var addColorifyPass = function addColorifyPass(color) {
|
|
7
|
+
var alpha = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0.5;
|
|
8
|
+
var _use$useScene = use.useScene(),
|
|
9
|
+
scene = _use$useScene.scene,
|
|
10
|
+
camera = _use$useScene.camera;
|
|
11
|
+
var composer = storeManagement.get('composer');
|
|
12
|
+
if (!scene || !camera) throw new Error('scene or camera is not defined,');
|
|
13
|
+
if (!composer) throw new Error('composer is not defined, please initPostEffects first');
|
|
14
|
+
var effectCopy = new ShaderPass(CopyShader);
|
|
15
|
+
effectCopy.renderToScreen = true;
|
|
16
|
+
var colorify = new ShaderPass(ColorifyShader);
|
|
17
|
+
colorify.enabled = true;
|
|
18
|
+
colorify.uniforms.color.value = color;
|
|
19
|
+
colorify.uniforms.alpha.value = alpha;
|
|
20
|
+
composer.addPass(effectCopy);
|
|
21
|
+
composer.addPass(colorify);
|
|
22
|
+
return {
|
|
23
|
+
clean: function clean() {
|
|
24
|
+
composer.removePass(effectCopy);
|
|
25
|
+
composer.removePass(colorify);
|
|
26
|
+
},
|
|
27
|
+
setColor: function setColor(color) {
|
|
28
|
+
colorify.uniforms.color.value = color;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default addColorifyPass;
|
|
33
|
+
//# sourceMappingURL=colorifyPass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["lib","use","utils","ColorifyShader","storeManagement","CopyShader","ShaderPass","addColorifyPass","color","alpha","useScene","scene","camera","composer","get","Error","effectCopy","renderToScreen","colorify","enabled","uniforms","value","addPass","clean","removePass","setColor"],"sources":["../../src/postEffects/colorifyPass.ts"],"sourcesContent":["import type { Color } from '@anov/3d-core'\nimport { lib, use, utils } from '@anov/3d-core'\nimport ColorifyShader from './shader/colorify'\n\nconst { storeManagement } = utils\nconst { CopyShader, ShaderPass } = lib\n\nconst addColorifyPass = (color: Color, alpha = 0.5) => {\n const { scene, camera } = use.useScene()\n const composer = storeManagement.get('composer') as lib.EffectComposer | undefined\n\n if (!scene || !camera)\n throw new Error('scene or camera is not defined,')\n\n if (!composer)\n throw new Error('composer is not defined, please initPostEffects first')\n\n const effectCopy = new ShaderPass(CopyShader)\n effectCopy.renderToScreen = true\n\n const colorify = new ShaderPass(ColorifyShader)\n colorify.enabled = true\n\n colorify.uniforms.color.value = color\n colorify.uniforms.alpha.value = alpha\n\n composer.addPass(effectCopy)\n composer.addPass(colorify)\n\n return {\n clean: () => {\n composer.removePass(effectCopy)\n composer.removePass(colorify)\n },\n setColor: (color: Color) => {\n colorify.uniforms.color.value = color\n },\n }\n}\n\nexport default addColorifyPass"],"mappings":"AACA,SAASA,GAAG,EAAEC,GAAG,EAAEC,KAAK,QAAQ,eAAe;AAC/C,OAAOC,cAAc;AAErB,IAAQC,eAAe,GAAKF,KAAK,CAAzBE,eAAe;AACvB,IAAQC,UAAU,GAAiBL,GAAG,CAA9BK,UAAU;EAAEC,UAAU,GAAKN,GAAG,CAAlBM,UAAU;AAE9B,IAAMC,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAY,EAAkB;EAAA,IAAhBC,KAAK,uEAAG,GAAG;EAChD,oBAA0BR,GAAG,CAACS,QAAQ,EAAE;IAAhCC,KAAK,iBAALA,KAAK;IAAEC,MAAM,iBAANA,MAAM;EACrB,IAAMC,QAAQ,GAAGT,eAAe,CAACU,GAAG,CAAC,UAAU,CAAmC;EAElF,IAAI,CAACH,KAAK,IAAI,CAACC,MAAM,EACnB,MAAM,IAAIG,KAAK,CAAC,iCAAiC,CAAC;EAEpD,IAAI,CAACF,QAAQ,EACX,MAAM,IAAIE,KAAK,CAAC,uDAAuD,CAAC;EAE1E,IAAMC,UAAU,GAAG,IAAIV,UAAU,CAACD,UAAU,CAAC;EAC7CW,UAAU,CAACC,cAAc,GAAG,IAAI;EAEhC,IAAMC,QAAQ,GAAG,IAAIZ,UAAU,CAACH,cAAc,CAAC;EAC/Ce,QAAQ,CAACC,OAAO,GAAG,IAAI;EAEvBD,QAAQ,CAACE,QAAQ,CAACZ,KAAK,CAACa,KAAK,GAAGb,KAAK;EACrCU,QAAQ,CAACE,QAAQ,CAACX,KAAK,CAACY,KAAK,GAAGZ,KAAK;EAErCI,QAAQ,CAACS,OAAO,CAACN,UAAU,CAAC;EAC5BH,QAAQ,CAACS,OAAO,CAACJ,QAAQ,CAAC;EAE1B,OAAO;IACLK,KAAK,EAAE,iBAAM;MACXV,QAAQ,CAACW,UAAU,CAACR,UAAU,CAAC;MAC/BH,QAAQ,CAACW,UAAU,CAACN,QAAQ,CAAC;IAC/B,CAAC;IACDO,QAAQ,EAAE,kBAACjB,KAAY,EAAK;MAC1BU,QAAQ,CAACE,QAAQ,CAACZ,KAAK,CAACa,KAAK,GAAGb,KAAK;IACvC;EACF,CAAC;AACH,CAAC;AAED,eAAeD,eAAe"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { Camera, Scene, WebGLRenderer } from '@anov/3d-core';
|
|
2
|
+
declare type InitPostEffectsOptions = {
|
|
3
|
+
type: 'main' | 'sub';
|
|
4
|
+
beforehooks?: () => void;
|
|
5
|
+
afterhooks?: () => void;
|
|
6
|
+
};
|
|
2
7
|
/**
|
|
3
8
|
* init post effects
|
|
4
9
|
* @param scene
|
|
@@ -8,4 +13,5 @@ import type { Camera, Scene, WebGLRenderer } from '@anov/3d-core';
|
|
|
8
13
|
* @param afterhooks composer render after hook
|
|
9
14
|
* @returns
|
|
10
15
|
*/
|
|
11
|
-
export declare const initPostEffects: (scene: Scene, renderer: WebGLRenderer, camera: Camera,
|
|
16
|
+
export declare const initPostEffects: (scene: Scene, renderer: WebGLRenderer, camera: Camera, options?: InitPostEffectsOptions) => () => void;
|
|
17
|
+
export {};
|