gl-draw 0.6.6 → 0.7.0
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/constants.d.ts +0 -1
- package/dist/core/Composer.d.ts +20 -28
- package/dist/core/Pencil.d.ts +9 -28
- package/dist/core/Renderer.d.ts +6 -0
- package/dist/effect/index.d.ts +1 -3
- package/dist/effect/index.js +4 -4
- package/dist/effect/index.module.js +13 -13
- package/dist/index.js +1 -57
- package/dist/index.module.js +1 -57
- package/dist/objects/image/index.d.ts +1 -1
- package/package.json +5 -4
- package/dist/core/pass/bloom/UnrealBloomPass.d.ts +0 -46
- package/dist/core/pass/bloom/index.d.ts +0 -33
- package/dist/core/pass/outline/index.d.ts +0 -37
- package/dist/core/pass/ssr/index.d.ts +0 -38
- package/dist/effect/outline.d.ts +0 -15
- package/dist/effect/ssr.d.ts +0 -15
package/dist/constants.d.ts
CHANGED
package/dist/core/Composer.d.ts
CHANGED
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
2
|
import GUI from 'lil-gui';
|
|
3
|
-
import { EffectComposer } from '
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
3
|
+
import { EffectComposer, CopyPass, EffectPass, SelectiveBloomEffect } from 'postprocessing';
|
|
4
|
+
export interface BloomParams {
|
|
5
|
+
luminanceThreshold: number;
|
|
6
|
+
luminanceSmoothing: number;
|
|
7
|
+
mipmapBlur: boolean;
|
|
8
|
+
intensity: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const defaultBloomParams: {
|
|
11
|
+
luminanceThreshold: number;
|
|
12
|
+
luminanceSmoothing: number;
|
|
13
|
+
mipmapBlur: boolean;
|
|
14
|
+
intensity: number;
|
|
15
|
+
};
|
|
11
16
|
export interface ComposerParams {
|
|
12
17
|
multisampling: number;
|
|
13
18
|
type: THREE.TextureDataType;
|
|
@@ -17,7 +22,6 @@ interface Options {
|
|
|
17
22
|
renderer: THREE.WebGLRenderer;
|
|
18
23
|
scene: THREE.Scene;
|
|
19
24
|
camera: THREE.Camera;
|
|
20
|
-
gui?: GUI;
|
|
21
25
|
composerParams: ComposerParams;
|
|
22
26
|
}
|
|
23
27
|
export default class {
|
|
@@ -25,35 +29,23 @@ export default class {
|
|
|
25
29
|
scene: THREE.Scene;
|
|
26
30
|
camera: THREE.Camera;
|
|
27
31
|
finalComposer: EffectComposer;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
fxaaPass?: ShaderPass;
|
|
33
|
-
ssaaPass?: SSAARenderPass;
|
|
34
|
-
bloomController?: BloomController;
|
|
35
|
-
outlineController?: OutlineController;
|
|
36
|
-
ssrController?: SSRController;
|
|
37
|
-
renderTarget: THREE.WebGLRenderTarget;
|
|
32
|
+
copyPass: CopyPass;
|
|
33
|
+
fxaaPass: EffectPass;
|
|
34
|
+
bloomPass: EffectPass;
|
|
35
|
+
bloomEffect: SelectiveBloomEffect;
|
|
38
36
|
options: Options;
|
|
39
37
|
active: boolean;
|
|
40
38
|
constructor(options: Options);
|
|
41
|
-
createRenderTarget(): THREE.WebGLRenderTarget;
|
|
42
|
-
addRenderPasss(): void;
|
|
43
39
|
addCopyPass(): void;
|
|
44
|
-
addGammaCorrectionPass(): void;
|
|
45
40
|
addFXAAPass(): void;
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
addOutlinePass(outlineParams: OutlineParams): void;
|
|
50
|
-
addSSRPass(ssrParams: SSRParams): void;
|
|
41
|
+
addBloomPass(params: BloomParams): void;
|
|
42
|
+
addBloomGui(gui: GUI): void;
|
|
43
|
+
toggleBloomSelection(obj: THREE.Object3D<THREE.Event>): void;
|
|
51
44
|
getSize(): THREE.Vector2;
|
|
52
45
|
enable(): void;
|
|
53
46
|
disable(): void;
|
|
54
47
|
checkCopyPass(): void;
|
|
55
48
|
setSize(width: number, height: number): void;
|
|
56
|
-
setFXAAPassSize(width: number, height: number): void;
|
|
57
49
|
render(): void;
|
|
58
50
|
dispose(): void;
|
|
59
51
|
}
|
package/dist/core/Pencil.d.ts
CHANGED
|
@@ -8,10 +8,7 @@ import { CameraParams } from '../core/Camera';
|
|
|
8
8
|
import SceneController, { SceneParams } from '../core/Scene';
|
|
9
9
|
import ControlController, { ControlParams } from '../core/Control';
|
|
10
10
|
import CSSRendererController, { CSSRendererParams } from '../core/CSSRenderer';
|
|
11
|
-
import ComposerController from '../core/Composer';
|
|
12
|
-
import { BloomParams } from '../core/pass/bloom';
|
|
13
|
-
import { OutlineParams } from '../core/pass/outline';
|
|
14
|
-
import { SSRParams } from '../core/pass/ssr';
|
|
11
|
+
import ComposerController, { BloomParams } from '../core/Composer';
|
|
15
12
|
declare type DeepRequired<T> = T extends Function | HTMLElement ? T : T extends object ? {
|
|
16
13
|
[P in keyof T]-?: DeepRequired<T[P]>;
|
|
17
14
|
} : T;
|
|
@@ -26,7 +23,7 @@ interface Options {
|
|
|
26
23
|
controlParams?: Partial<ControlParams>;
|
|
27
24
|
resizeObserver?: boolean;
|
|
28
25
|
renderer?: {
|
|
29
|
-
antialias?: false | 'fxaa' | '
|
|
26
|
+
antialias?: false | 'fxaa' | 'msaa';
|
|
30
27
|
} & Omit<Partial<RendererParams>, 'antialias'>;
|
|
31
28
|
multisampling?: number;
|
|
32
29
|
staticRender?: boolean;
|
|
@@ -34,10 +31,6 @@ interface Options {
|
|
|
34
31
|
camera?: Partial<CameraParams> | THREE.PerspectiveCamera;
|
|
35
32
|
bloom?: boolean;
|
|
36
33
|
bloomParams?: Partial<BloomParams>;
|
|
37
|
-
outline?: boolean;
|
|
38
|
-
outlineParams?: Partial<OutlineParams>;
|
|
39
|
-
ssr?: boolean;
|
|
40
|
-
ssrParams?: Partial<SSRParams>;
|
|
41
34
|
css2DRenderer?: boolean;
|
|
42
35
|
css2DRendererParams?: Partial<CSSRendererParams>;
|
|
43
36
|
css3DRenderer?: boolean;
|
|
@@ -80,6 +73,9 @@ export default class Pencil {
|
|
|
80
73
|
logarithmicDepthBuffer: boolean;
|
|
81
74
|
preserveDrawingBuffer: boolean;
|
|
82
75
|
context: null;
|
|
76
|
+
stencil: boolean;
|
|
77
|
+
depth: boolean;
|
|
78
|
+
physicallyCorrectLights: boolean;
|
|
83
79
|
};
|
|
84
80
|
staticRender: boolean;
|
|
85
81
|
multisampling: number;
|
|
@@ -93,27 +89,12 @@ export default class Pencil {
|
|
|
93
89
|
};
|
|
94
90
|
bloom: boolean;
|
|
95
91
|
bloomParams: {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
outline: boolean;
|
|
101
|
-
outlineParams: {
|
|
102
|
-
edgeStrength: number;
|
|
103
|
-
edgeGlow: number;
|
|
104
|
-
edgeThickness: number;
|
|
105
|
-
pulsePeriod: number;
|
|
106
|
-
rotate: boolean;
|
|
107
|
-
usePatternTexture: boolean;
|
|
108
|
-
visibleEdgeColor: string;
|
|
109
|
-
hiddenEdgeColor: string;
|
|
92
|
+
luminanceThreshold: number;
|
|
93
|
+
luminanceSmoothing: number;
|
|
94
|
+
mipmapBlur: boolean;
|
|
95
|
+
intensity: number;
|
|
110
96
|
};
|
|
111
97
|
css2DRenderer: boolean;
|
|
112
|
-
ssr: boolean;
|
|
113
|
-
ssrParams: {
|
|
114
|
-
maxDistance: number;
|
|
115
|
-
selects: boolean;
|
|
116
|
-
};
|
|
117
98
|
css2DRendererParams: {
|
|
118
99
|
zIndex: string;
|
|
119
100
|
};
|
package/dist/core/Renderer.d.ts
CHANGED
|
@@ -18,6 +18,9 @@ export interface RendererParams {
|
|
|
18
18
|
logarithmicDepthBuffer: boolean;
|
|
19
19
|
preserveDrawingBuffer: boolean;
|
|
20
20
|
context: WebGLRenderingContext | undefined;
|
|
21
|
+
stencil: boolean;
|
|
22
|
+
depth: boolean;
|
|
23
|
+
physicallyCorrectLights: boolean;
|
|
21
24
|
}
|
|
22
25
|
export declare const defaultRendererParams: {
|
|
23
26
|
antialias: boolean;
|
|
@@ -30,6 +33,9 @@ export declare const defaultRendererParams: {
|
|
|
30
33
|
logarithmicDepthBuffer: boolean;
|
|
31
34
|
preserveDrawingBuffer: boolean;
|
|
32
35
|
context: null;
|
|
36
|
+
stencil: boolean;
|
|
37
|
+
depth: boolean;
|
|
38
|
+
physicallyCorrectLights: boolean;
|
|
33
39
|
};
|
|
34
40
|
interface Options {
|
|
35
41
|
isdev: boolean;
|
package/dist/effect/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { default as Bloom } from './bloom';
|
|
2
|
-
export { default as Outline } from './outline';
|
|
3
|
-
export { default as SSR } from './ssr';
|
|
4
1
|
export { default as Scan } from './scan';
|
|
5
2
|
export { default as Scan2 } from './scan2';
|
|
3
|
+
export { default as Bloom } from './bloom';
|
package/dist/effect/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){var K={666:function(b){var O=function(m){"use strict";var F=Object.prototype,D=F.hasOwnProperty,M,q=typeof Symbol=="function"?Symbol:{},A=q.iterator||"@@iterator",V=q.asyncIterator||"@@asyncIterator",I=q.toStringTag||"@@toStringTag";function W(r,t,o){return Object.defineProperty(r,t,{value:o,enumerable:!0,configurable:!0,writable:!0}),r[t]}try{W({},"")}catch(r){W=function(t,o,c){return t[o]=c}}function Y(r,t,o,c){var u=t&&t.prototype instanceof H?t:H,y=Object.create(u.prototype),j=new v(c||[]);return y._invoke=i(r,o,j),y}m.wrap=Y;function G(r,t,o){try{return{type:"normal",arg:r.call(t,o)}}catch(c){return{type:"throw",arg:c}}}var R="suspendedStart",J="suspendedYield",L="executing",N="completed",P={};function H(){}function T(){}function E(){}var U={};W(U,A,function(){return this});var p=Object.getPrototypeOf,f=p&&p(p(h([])));f&&f!==F&&D.call(f,A)&&(U=f);var a=E.prototype=H.prototype=Object.create(U);T.prototype=E,W(a,"constructor",E),W(E,"constructor",T),T.displayName=W(E,I,"GeneratorFunction");function n(r){["next","throw","return"].forEach(function(t){W(r,t,function(o){return this._invoke(t,o)})})}m.isGeneratorFunction=function(r){var t=typeof r=="function"&&r.constructor;return t?t===T||(t.displayName||t.name)==="GeneratorFunction":!1},m.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,E):(r.__proto__=E,W(r,I,"GeneratorFunction")),r.prototype=Object.create(a),r},m.awrap=function(r){return{__await:r}};function e(r,t){function o(y,j,x,g){var _=G(r[y],r,j);if(_.type==="throw")g(_.arg);else{var z=_.arg,C=z.value;return C&&typeof C=="object"&&D.call(C,"__await")?t.resolve(C.__await).then(function(k){o("next",k,x,g)},function(k){o("throw",k,x,g)}):t.resolve(C).then(function(k){z.value=k,x(z)},function(k){return o("throw",k,x,g)})}}var c;function u(y,j){function x(){return new t(function(g,_){o(y,j,g,_)})}return c=c?c.then(x,x):x()}this._invoke=u}n(e.prototype),W(e.prototype,V,function(){return this}),m.AsyncIterator=e,m.async=function(r,t,o,c,u){u===void 0&&(u=Promise);var y=new e(Y(r,t,o,c),u);return m.isGeneratorFunction(t)?y:y.next().then(function(j){return j.done?j.value:y.next()})};function i(r,t,o){var c=R;return function(y,j){if(c===L)throw new Error("Generator is already running");if(c===N){if(y==="throw")throw j;return w()}for(o.method=y,o.arg=j;;){var x=o.delegate;if(x){var g=d(x,o);if(g){if(g===P)continue;return g}}if(o.method==="next")o.sent=o._sent=o.arg;else if(o.method==="throw"){if(c===R)throw c=N,o.arg;o.dispatchException(o.arg)}else o.method==="return"&&o.abrupt("return",o.arg);c=L;var _=G(r,t,o);if(_.type==="normal"){if(c=o.done?N:J,_.arg===P)continue;return{value:_.arg,done:o.done}}else _.type==="throw"&&(c=N,o.method="throw",o.arg=_.arg)}}}function d(r,t){var o=r.iterator[t.method];if(o===M){if(t.delegate=null,t.method==="throw"){if(r.iterator.return&&(t.method="return",t.arg=M,d(r,t),t.method==="throw"))return P;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return P}var c=G(o,r.iterator,t.arg);if(c.type==="throw")return t.method="throw",t.arg=c.arg,t.delegate=null,P;var u=c.arg;if(!u)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,P;if(u.done)t[r.resultName]=u.value,t.next=r.nextLoc,t.method!=="return"&&(t.method="next",t.arg=M);else return u;return t.delegate=null,P}n(a),W(a,I,"Generator"),W(a,A,function(){return this}),W(a,"toString",function(){return"[object Generator]"});function s(r){var t={tryLoc:r[0]};1 in r&&(t.catchLoc=r[1]),2 in r&&(t.finallyLoc=r[2],t.afterLoc=r[3]),this.tryEntries.push(t)}function l(r){var t=r.completion||{};t.type="normal",delete t.arg,r.completion=t}function v(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(s,this),this.reset(!0)}m.keys=function(r){var t=[];for(var o in r)t.push(o);return t.reverse(),function c(){for(;t.length;){var u=t.pop();if(u in r)return c.value=u,c.done=!1,c}return c.done=!0,c}};function h(r){if(r){var t=r[A];if(t)return t.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var o=-1,c=function u(){for(;++o<r.length;)if(D.call(r,o))return u.value=r[o],u.done=!1,u;return u.value=M,u.done=!0,u};return c.next=c}}return{next:w}}m.values=h;function w(){return{value:M,done:!0}}return v.prototype={constructor:v,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=M,this.done=!1,this.delegate=null,this.method="next",this.arg=M,this.tryEntries.forEach(l),!r)for(var t in this)t.charAt(0)==="t"&&D.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=M)},stop:function(){this.done=!0;var r=this.tryEntries[0],t=r.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var t=this;function o(g,_){return y.type="throw",y.arg=r,t.next=g,_&&(t.method="next",t.arg=M),!!_}for(var c=this.tryEntries.length-1;c>=0;--c){var u=this.tryEntries[c],y=u.completion;if(u.tryLoc==="root")return o("end");if(u.tryLoc<=this.prev){var j=D.call(u,"catchLoc"),x=D.call(u,"finallyLoc");if(j&&x){if(this.prev<u.catchLoc)return o(u.catchLoc,!0);if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else if(j){if(this.prev<u.catchLoc)return o(u.catchLoc,!0)}else if(x){if(this.prev<u.finallyLoc)return o(u.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,t){for(var o=this.tryEntries.length-1;o>=0;--o){var c=this.tryEntries[o];if(c.tryLoc<=this.prev&&D.call(c,"finallyLoc")&&this.prev<c.finallyLoc){var u=c;break}}u&&(r==="break"||r==="continue")&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var y=u?u.completion:{};return y.type=r,y.arg=t,u?(this.method="next",this.next=u.finallyLoc,P):this.complete(y)},complete:function(r,t){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&t&&(this.next=t),P},finish:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.finallyLoc===r)return this.complete(o.completion,o.afterLoc),l(o),P}},catch:function(r){for(var t=this.tryEntries.length-1;t>=0;--t){var o=this.tryEntries[t];if(o.tryLoc===r){var c=o.completion;if(c.type==="throw"){var u=c.arg;l(o)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(r,t,o){return this.delegate={iterator:h(r),resultName:t,nextLoc:o},this.method==="next"&&(this.arg=M),P}},m}(b.exports);try{regeneratorRuntime=O}catch(m){typeof globalThis=="object"?globalThis.regeneratorRuntime=O:Function("r","regeneratorRuntime = r")(O)}}},Q={};function S(b){var O=Q[b];if(O!==void 0)return O.exports;var m=Q[b]={exports:{}};return K[b](m,m.exports,S),m.exports}(function(){S.n=function(b){var O=b&&b.__esModule?function(){return b.default}:function(){return b};return S.d(O,{a:O}),O}})(),function(){S.d=function(b,O){for(var m in O)S.o(O,m)&&!S.o(b,m)&&Object.defineProperty(b,m,{enumerable:!0,get:O[m]})}}(),function(){S.o=function(b,O){return Object.prototype.hasOwnProperty.call(b,O)}}(),function(){S.r=function(b){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(b,"__esModule",{value:!0})}}();var $={};(function(){"use strict";S.r($),S.d($,{Bloom:function(){return I},Outline:function(){return W},SSR:function(){return Y},Scan:function(){return E},Scan2:function(){return U}});function b(p,f){if(!(p instanceof f))throw new TypeError("Cannot call a class as a function")}function O(p,f,a){return f in p?Object.defineProperty(p,f,{value:a,enumerable:!0,configurable:!0,writable:!0}):p[f]=a,p}function m(p){for(var f=1;f<arguments.length;f++){var a=arguments[f]!=null?arguments[f]:{},n=Object.keys(a);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(a).filter(function(e){return Object.getOwnPropertyDescriptor(a,e).enumerable}))),n.forEach(function(e){O(p,e,a[e])})}return p}var F=function(){try{var p=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&p.getContext("webgl2"))}catch(f){return!1}},D=0,M=1,q=null,A=F()!==!1,V={},I=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;l.enable(),e.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||(h.layers.enable(M),V[h.uuid]=!0)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.bloomController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||(h.layers.disable(M),delete V[h.uuid])}),Object.keys(V).length===0&&(l.disable(),e.event.emit("passcheck","bloom"))}},p}(),W=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;l.enable(),e.event.emit("passcheck","outline"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.outlineController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","outline"))}},p}(),Y=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},n)}var f=p.prototype;return f.check=function(){var n,e=this.object.pencil;return!((n=e.composerController)===null||n===void 0)&&n.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},f.enable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;l.enable(),e.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||h.material&&l.selectedObjects.push(h)})}},f.disable=function(){var n;if(!!this.check()){var e=this.object.pencil,i=this.options,d=i.exclude,s=i.include,l=(n=e.composerController)===null||n===void 0?void 0:n.ssrController;this.object.object3d.traverse(function(v){var h=v;s&&!s.includes(h)||d&&d.includes(h)||!h.material||l.selectedObjects.splice(l.selectedObjects.indexOf(h),1)}),l.selectedObjects.length===0&&(l.disable(),e.event.emit("passcheck","ssr"))}},p}();function G(p,f,a,n,e,i,d){try{var s=p[i](d),l=s.value}catch(v){a(v);return}s.done?f(l):Promise.resolve(l).then(n,e)}function R(p){return function(){var f=this,a=arguments;return new Promise(function(n,e){var i=p.apply(f,a);function d(l){G(i,n,e,d,s,"next",l)}function s(l){G(i,n,e,d,s,"throw",l)}d(void 0)})}}var J=S(666),L=S.n(J),N=require("three"),P=require("popmotion");function H(p){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return p.then(function(a){return m({err:null,res:a},f)}).catch(function(a){return m({err:a,res:void 0},f)})}function T(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a={};return a.promise=new Promise(function(n,e){a.resolve=n,a.reject=e}),p&&(a.promise=H(a.promise,f)),a}var E=function(){"use strict";function p(a){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};b(this,p),this.object=a,this.options=m({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new N.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},n)}var f=p.prototype;return f.initMaterial=function(){var n=this,e=this.options,i=e.color,d=e.lineNum,s=e.lineWidth,l=e.lineHieght,v=e.fade,h=e.fadeType,w=e.radius,r=e.range,t=e.vertical,o=e.step,c=e.opacity,u=e.exclude,y={field:{value:new N.Vector4(0,0,0,0)},color:{value:new N.Color(i)},opacity:{value:c},lineNum:{value:d},lineWidth:{value:s},lineHieght:{value:l},sizeNum:{value:new N.Vector3(w,w,w)},objPos:{value:new N.Vector3(0,0,0)},fade:{value:v},fadeType:{value:h},range:{value:r},angle:{value:0},stepNum:{value:o}};if(!w){var j=this.object.getSize().size;y.sizeNum.value.copy(j)}this.uniforms=y,this.object.object3d.traverse(function(x){var g=x;!g.material||u&&u.includes(g)||(g.userData.materialO?g.material=g.userData.materialO.clone():g.userData.materialO=Array.isArray(g.material)?g.material.map(function(_){return _.clone()}):g.material.clone(),Array.isArray(g.material)?g.material.forEach(function(_){t?n.setVerticalMaterial(_):n.setMaterial(_)}):t?n.setVerticalMaterial(g.material):n.setMaterial(g.material))})},f.setMaterial=function(n){var e=this.uniforms;n.onBeforeCompile=function(i){i.uniforms.field=e.field,i.uniforms.fieldColor=e.color,i.uniforms.fieldOpacity=e.opacity,i.uniforms.lineNum=e.lineNum,i.uniforms.lineWidth=e.lineWidth,i.uniforms.sizeNum=e.sizeNum,i.uniforms.fade=e.fade,i.uniforms.fadeType=e.fadeType,i.uniforms.range=e.range,i.uniforms.stepNum=e.stepNum,i.vertexShader=`
|
|
1
|
+
(function(){var Q={666:function(y){var b=function(h){"use strict";var U=Object.prototype,x=U.hasOwnProperty,C,L=typeof Symbol=="function"?Symbol:{},N=L.iterator||"@@iterator",F=L.asyncIterator||"@@asyncIterator",I=L.toStringTag||"@@toStringTag";function M(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{M({},"")}catch(t){M=function(e,n,a){return e[n]=a}}function q(t,e,n,a){var l=e&&e.prototype instanceof r?e:r,v=Object.create(l.prototype),_=new D(a||[]);return v._invoke=w(t,n,_),v}h.wrap=q;function R(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(a){return{type:"throw",arg:a}}}var B="suspendedStart",m="suspendedYield",s="executing",f="completed",o={};function r(){}function i(){}function d(){}var u={};M(u,N,function(){return this});var c=Object.getPrototypeOf,p=c&&c(c(T([])));p&&p!==U&&x.call(p,N)&&(u=p);var W=d.prototype=r.prototype=Object.create(u);i.prototype=d,M(W,"constructor",d),M(d,"constructor",i),i.displayName=M(d,I,"GeneratorFunction");function g(t){["next","throw","return"].forEach(function(e){M(t,e,function(n){return this._invoke(e,n)})})}h.isGeneratorFunction=function(t){var e=typeof t=="function"&&t.constructor;return e?e===i||(e.displayName||e.name)==="GeneratorFunction":!1},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,M(t,I,"GeneratorFunction")),t.prototype=Object.create(W),t},h.awrap=function(t){return{__await:t}};function O(t,e){function n(v,_,P,j){var S=R(t[v],t,_);if(S.type==="throw")j(S.arg);else{var $=S.arg,H=$.value;return H&&typeof H=="object"&&x.call(H,"__await")?e.resolve(H.__await).then(function(A){n("next",A,P,j)},function(A){n("throw",A,P,j)}):e.resolve(H).then(function(A){$.value=A,P($)},function(A){return n("throw",A,P,j)})}}var a;function l(v,_){function P(){return new e(function(j,S){n(v,_,j,S)})}return a=a?a.then(P,P):P()}this._invoke=l}g(O.prototype),M(O.prototype,F,function(){return this}),h.AsyncIterator=O,h.async=function(t,e,n,a,l){l===void 0&&(l=Promise);var v=new O(q(t,e,n,a),l);return h.isGeneratorFunction(e)?v:v.next().then(function(_){return _.done?_.value:v.next()})};function w(t,e,n){var a=B;return function(v,_){if(a===s)throw new Error("Generator is already running");if(a===f){if(v==="throw")throw _;return E()}for(n.method=v,n.arg=_;;){var P=n.delegate;if(P){var j=V(P,n);if(j){if(j===o)continue;return j}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(a===B)throw a=f,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);a=s;var S=R(t,e,n);if(S.type==="normal"){if(a=n.done?f:m,S.arg===o)continue;return{value:S.arg,done:n.done}}else S.type==="throw"&&(a=f,n.method="throw",n.arg=S.arg)}}}function V(t,e){var n=t.iterator[e.method];if(n===C){if(e.delegate=null,e.method==="throw"){if(t.iterator.return&&(e.method="return",e.arg=C,V(t,e),e.method==="throw"))return o;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return o}var a=R(n,t.iterator,e.arg);if(a.type==="throw")return e.method="throw",e.arg=a.arg,e.delegate=null,o;var l=a.arg;if(!l)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,o;if(l.done)e[t.resultName]=l.value,e.next=t.nextLoc,e.method!=="return"&&(e.method="next",e.arg=C);else return l;return e.delegate=null,o}g(W),M(W,I,"Generator"),M(W,N,function(){return this}),M(W,"toString",function(){return"[object Generator]"});function G(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function k(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function D(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(G,this),this.reset(!0)}h.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function a(){for(;e.length;){var l=e.pop();if(l in t)return a.value=l,a.done=!1,a}return a.done=!0,a}};function T(t){if(t){var e=t[N];if(e)return e.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var n=-1,a=function l(){for(;++n<t.length;)if(x.call(t,n))return l.value=t[n],l.done=!1,l;return l.value=C,l.done=!0,l};return a.next=a}}return{next:E}}h.values=T;function E(){return{value:C,done:!0}}return D.prototype={constructor:D,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(k),!t)for(var e in this)e.charAt(0)==="t"&&x.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=C)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(j,S){return v.type="throw",v.arg=t,e.next=j,S&&(e.method="next",e.arg=C),!!S}for(var a=this.tryEntries.length-1;a>=0;--a){var l=this.tryEntries[a],v=l.completion;if(l.tryLoc==="root")return n("end");if(l.tryLoc<=this.prev){var _=x.call(l,"catchLoc"),P=x.call(l,"finallyLoc");if(_&&P){if(this.prev<l.catchLoc)return n(l.catchLoc,!0);if(this.prev<l.finallyLoc)return n(l.finallyLoc)}else if(_){if(this.prev<l.catchLoc)return n(l.catchLoc,!0)}else if(P){if(this.prev<l.finallyLoc)return n(l.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&x.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var l=a;break}}l&&(t==="break"||t==="continue")&&l.tryLoc<=e&&e<=l.finallyLoc&&(l=null);var v=l?l.completion:{};return v.type=t,v.arg=e,l?(this.method="next",this.next=l.finallyLoc,o):this.complete(v)},complete:function(t,e){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&e&&(this.next=e),o},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),k(n),o}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var a=n.completion;if(a.type==="throw"){var l=a.arg;k(n)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:T(t),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=C),o}},h}(y.exports);try{regeneratorRuntime=b}catch(h){typeof globalThis=="object"?globalThis.regeneratorRuntime=b:Function("r","regeneratorRuntime = r")(b)}}},J={};function z(y){var b=J[y];if(b!==void 0)return b.exports;var h=J[y]={exports:{}};return Q[y](h,h.exports,z),h.exports}(function(){z.n=function(y){var b=y&&y.__esModule?function(){return y.default}:function(){return y};return z.d(b,{a:b}),b}})(),function(){z.d=function(y,b){for(var h in b)z.o(b,h)&&!z.o(y,h)&&Object.defineProperty(y,h,{enumerable:!0,get:b[h]})}}(),function(){z.o=function(y,b){return Object.prototype.hasOwnProperty.call(y,b)}}(),function(){z.r=function(y){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})}}();var Y={};(function(){"use strict";z.r(Y),z.d(Y,{Bloom:function(){return B},Scan:function(){return q},Scan2:function(){return R}});function y(m,s,f,o,r,i,d){try{var u=m[i](d),c=u.value}catch(p){f(p);return}u.done?s(c):Promise.resolve(c).then(o,r)}function b(m){return function(){var s=this,f=arguments;return new Promise(function(o,r){var i=m.apply(s,f);function d(c){y(i,o,r,d,u,"next",c)}function u(c){y(i,o,r,d,u,"throw",c)}d(void 0)})}}function h(m,s){if(!(m instanceof s))throw new TypeError("Cannot call a class as a function")}function U(m,s,f){return s in m?Object.defineProperty(m,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):m[s]=f,m}function x(m){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{},o=Object.keys(f);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(f).filter(function(r){return Object.getOwnPropertyDescriptor(f,r).enumerable}))),o.forEach(function(r){U(m,r,f[r])})}return m}var C=z(666),L=z.n(C),N=require("three"),F=require("popmotion");function I(m){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return m.then(function(f){return x({err:null,res:f},s)}).catch(function(f){return x({err:f,res:void 0},s)})}function M(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f={};return f.promise=new Promise(function(o,r){f.resolve=o,f.reject=r}),m&&(f.promise=I(f.promise,s)),f}var q=function(){"use strict";function m(f){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};h(this,m),this.object=f,this.options=x({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new N.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},o)}var s=m.prototype;return s.initMaterial=function(){var o=this,r=this.options,i=r.color,d=r.lineNum,u=r.lineWidth,c=r.lineHieght,p=r.fade,W=r.fadeType,g=r.radius,O=r.range,w=r.vertical,V=r.step,G=r.opacity,k=r.exclude,D={field:{value:new N.Vector4(0,0,0,0)},color:{value:new N.Color(i)},opacity:{value:G},lineNum:{value:d},lineWidth:{value:u},lineHieght:{value:c},sizeNum:{value:new N.Vector3(g,g,g)},objPos:{value:new N.Vector3(0,0,0)},fade:{value:p},fadeType:{value:W},range:{value:O},angle:{value:0},stepNum:{value:V}};if(!g){var T=this.object.getSize().size;D.sizeNum.value.copy(T)}this.uniforms=D,this.object.object3d.traverse(function(E){var t=E;!t.material||k&&k.includes(t)||(t.userData.materialO?t.material=t.userData.materialO.clone():t.userData.materialO=Array.isArray(t.material)?t.material.map(function(e){return e.clone()}):t.material.clone(),Array.isArray(t.material)?t.material.forEach(function(e){w?o.setVerticalMaterial(e):o.setMaterial(e)}):w?o.setVerticalMaterial(t.material):o.setMaterial(t.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineNum=r.lineNum,i.uniforms.lineWidth=r.lineWidth,i.uniforms.sizeNum=r.sizeNum,i.uniforms.fade=r.fade,i.uniforms.fadeType=r.fadeType,i.uniforms.range=r.range,i.uniforms.stepNum=r.stepNum,i.vertexShader=`
|
|
2
2
|
varying vec4 vWorldPos;
|
|
3
3
|
`.concat(i.vertexShader,`
|
|
4
4
|
`).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`)},
|
|
57
|
+
`)},o.needsUpdate=!0},s.setVerticalMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineNum=r.lineNum,i.uniforms.lineWidth=r.lineWidth,i.uniforms.lineHieght=r.lineHieght,i.uniforms.sizeNum=r.sizeNum,i.uniforms.fade=r.fade,i.uniforms.range=r.range,i.uniforms.angle=r.angle,i.uniforms.objPos=r.objPos,i.vertexShader=`
|
|
58
58
|
varying vec4 vWorldPos;
|
|
59
59
|
`.concat(i.vertexShader,`
|
|
60
60
|
`).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
`)},
|
|
128
|
+
`)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;this.stop();var i=M(!0),d=this,u=d.object,c=d.uniforms,p=x({},this.options,o),W=p.lineNum,g=p.step,O=p.lineWidth,w=p.pos,V=p.duration,G=u.getSize(),k=G.min,D=G.max,T=G.size,E=W,t=O;g>0&&(E=1,t=T.y/g);var e=c.sizeNum.value.y*(E>1?2:1);return this.tween=(0,F.animate)({from:0,to:1,duration:V,onPlay:function(){var n,a=new N.Vector3;w==="bottom"?a.set(k.x-.001,k.y-.001,k.z-.001):w==="top"&&a.set(D.x+.001,D.y+.001,D.z+.001);var l=((n=u.pencil.control)===null||n===void 0?void 0:n.getAzimuthalAngle())||0,v=r.object.object3d.position.clone();if(l){var _=Math.sqrt(Math.pow(T.x,2)+Math.pow(T.z,2))/2;a.x=v.x+_,a.z=v.z+_;var P=new N.Vector3().subVectors(a,v),j=new N.Vector3(0,1,0);P.applyAxisAngle(j,l),a.addVectors(v,P)}c.objPos.value.copy(v),c.field.value.set(a.x,a.y,a.z,0),c.angle.value=l,c.lineNum.value=E,c.lineWidth.value=t},onUpdate:function(n){g>0?c.field.value.w=Math.floor(n*g)/g*e:c.field.value.w=n*e},onStop:function(){c.field.value.w=0,i.reject("stop")},onComplete:function(){i.resolve()}}),i.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return b(L().mark(function i(){var d,u,c,p,W,g;return L().wrap(function(w){for(;;)switch(w.prev=w.next){case 0:return d=x({},r.options,o),u=d.yoyo,c=d.repeat,p=d.pos,c===r.options.repeat&&r.initMaterial(),w.next=4,r.play(o);case 4:if(W=w.sent.err,!W){w.next=8;break}return r.resetMaterial(),w.abrupt("return");case 8:if(!c){w.next=15;break}return g=p,u&&(g=g==="bottom"?"top":"bottom"),w.next=13,r.checkRepeat({pos:g,repeat:c===1/0?-1:c-1});case 13:w.next=16;break;case 15:r.resetMaterial();case 16:case"end":return w.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},m}(),R=function(){"use strict";function m(f){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};h(this,m),this.object=f,this.options=x({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new N.Vector3(0,0,0),duration:5e3,repeat:0},o)}var s=m.prototype;return s.initMaterial=function(){var o=this,r=this.options.exclude,i={field:{value:new N.Vector4(0,0,0,1e-4)},color:{value:new N.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=i,this.object.object3d.traverse(function(d){var u=d;!u.material||r&&r.includes(u)||(u.userData.materialO?u.material=u.userData.materialO:u.userData.materialO=Array.isArray(u.material)?u.material.map(function(c){return c.clone()}):u.material.clone(),Array.isArray(u.material)?u.material.forEach(function(c){o.setMaterial(c)}):o.setMaterial(u.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineWidth=r.lineWidth,i.vertexShader=`
|
|
129
129
|
varying vec4 vWorldPos;
|
|
130
130
|
`.concat(i.vertexShader,`
|
|
131
131
|
`).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
|
|
@@ -157,4 +157,4 @@
|
|
|
157
157
|
}
|
|
158
158
|
gl_FragColor.rgb = mix(gl_FragColor.rgb, fieldColor, fadeout);
|
|
159
159
|
|
|
160
|
-
`)},
|
|
160
|
+
`)},o.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(o){var r=o;r.material&&r.userData.materialO&&(r.material=r.userData.materialO.clone(),r.userData.materialO=void 0)})},s.play=function(){var o=this;this.stop();var r=M(!0),i=this,d=i.object,u=i.uniforms,c=this.options,p=c.position,W=c.duration,g=this.options.radius;if(!g){var O=d.getSize().size;g=Math.max(O.x,O.y,O.z)}return this.tween=(0,F.animate)({from:1e-4,to:1,duration:W,onPlay:function(){u.field.value.set(p.x,p.y,p.z,1e-4),o.options.fade&&(u.opacity.value=o.options.opacity)},onUpdate:function(w){u.field.value.w=w*g,o.options.fade&&(u.opacity.value=(1-w)*o.options.opacity)},onStop:function(){u.field.value.w=0,r.reject("stop")},onComplete:function(){r.resolve()}}),r.promise},s.checkRepeat=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=this;return b(L().mark(function i(){var d,u;return L().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return d=x({},r.options,o).repeat,d===r.options.repeat&&r.initMaterial(),p.next=4,r.play();case 4:if(u=p.sent.err,!u){p.next=8;break}return r.resetMaterial(),p.abrupt("return");case 8:if(!d){p.next=13;break}return p.next=11,r.checkRepeat({repeat:d===1/0?-1:d-1});case 11:p.next=14;break;case 13:r.resetMaterial();case 14:case"end":return p.stop()}},i)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},m}(),B=function(){"use strict";function m(f){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};h(this,m),this.object=f,this.options=x({},o)}var s=m.prototype;return s.check=function(){var o=this.object.pencil;return o.composerController.bloomPass?!0:(console.warn("err:pencil.options.bloom"),!1)},s.enable=function(){if(!!this.check()){var o=this.object.pencil,r=this.options,i=r.exclude,d=r.include,u=o.composerController.bloomPass;u.enabled=!0,o.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(c){var p=c;d&&!d.includes(p)||i&&i.includes(p)||o.composerController.toggleBloomSelection(p)})}},s.disable=function(){if(!!this.check()){var o=this.object.pencil,r=this.options,i=r.exclude,d=r.include,u=o.composerController.bloomPass;this.object.object3d.traverse(function(c){var p=c;d&&!d.includes(p)||i&&i.includes(p)||o.composerController.toggleBloomSelection(p)}),o.composerController.bloomEffect.selection.size||(u.enabled=!1,o.event.emit("passcheck","bloom"))}},m}()})(),module.exports=Y})();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var w=function(v){"use strict";var $=Object.prototype,S=$.hasOwnProperty,C,X=typeof Symbol=="function"?Symbol:{},U=X.iterator||"@@iterator",B=X.asyncIterator||"@@asyncIterator",F=X.toStringTag||"@@toStringTag";function j(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{j({},"")}catch(e){j=function(t,n,a){return t[n]=a}}function J(e,t,n,a){var u=t&&t.prototype instanceof x?t:x,p=Object.create(u.prototype),_=new i(a||[]);return p._invoke=s(e,n,_),p}v.wrap=J;function T(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(a){return{type:"throw",arg:a}}}var H="suspendedStart",Z="suspendedYield",z="executing",A="completed",O={};function x(){}function G(){}function k(){}var V={};j(V,U,function(){return this});var q=Object.getPrototypeOf,L=q&&q(q(d([])));L&&L!==$&&S.call(L,U)&&(V=L);var E=k.prototype=x.prototype=Object.create(V);G.prototype=k,j(E,"constructor",k),j(k,"constructor",G),G.displayName=j(k,F,"GeneratorFunction");function K(e){["next","throw","return"].forEach(function(t){j(e,t,function(n){return this._invoke(t,n)})})}v.isGeneratorFunction=function(e){var t=typeof e=="function"&&e.constructor;return t?t===G||(t.displayName||t.name)==="GeneratorFunction":!1},v.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,k):(e.__proto__=k,j(e,F,"GeneratorFunction")),e.prototype=Object.create(E),e},v.awrap=function(e){return{__await:e}};function c(e,t){function n(p,_,y,b){var g=T(e[p],e,_);if(g.type==="throw")b(g.arg);else{var P=g.arg,N=P.value;return N&&typeof N=="object"&&S.call(N,"__await")?t.resolve(N.__await).then(function(h){n("next",h,y,b)},function(h){n("throw",h,y,b)}):t.resolve(N).then(function(h){P.value=h,y(P)},function(h){return n("throw",h,y,b)})}}var a;function u(p,_){function y(){return new t(function(b,g){n(p,_,b,g)})}return a=a?a.then(y,y):y()}this._invoke=u}K(c.prototype),j(c.prototype,B,function(){return this}),v.AsyncIterator=c,v.async=function(e,t,n,a,u){u===void 0&&(u=Promise);var p=new c(J(e,t,n,a),u);return v.isGeneratorFunction(t)?p:p.next().then(function(_){return _.done?_.value:p.next()})};function s(e,t,n){var a=H;return function(p,_){if(a===z)throw new Error("Generator is already running");if(a===A){if(p==="throw")throw _;return f()}for(n.method=p,n.arg=_;;){var y=n.delegate;if(y){var b=l(y,n);if(b){if(b===O)continue;return b}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(a===H)throw a=A,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);a=z;var g=T(e,t,n);if(g.type==="normal"){if(a=n.done?A:Z,g.arg===O)continue;return{value:g.arg,done:n.done}}else g.type==="throw"&&(a=A,n.method="throw",n.arg=g.arg)}}}function l(e,t){var n=e.iterator[t.method];if(n===C){if(t.delegate=null,t.method==="throw"){if(e.iterator.return&&(t.method="return",t.arg=C,l(e,t),t.method==="throw"))return O;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var a=T(n,e.iterator,t.arg);if(a.type==="throw")return t.method="throw",t.arg=a.arg,t.delegate=null,O;var u=a.arg;if(!u)return t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,O;if(u.done)t[e.resultName]=u.value,t.next=e.nextLoc,t.method!=="return"&&(t.method="next",t.arg=C);else return u;return t.delegate=null,O}K(E),j(E,F,"Generator"),j(E,U,function(){return this}),j(E,"toString",function(){return"[object Generator]"});function o(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function r(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function i(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(o,this),this.reset(!0)}v.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function a(){for(;t.length;){var u=t.pop();if(u in e)return a.value=u,a.done=!1,a}return a.done=!0,a}};function d(e){if(e){var t=e[U];if(t)return t.call(e);if(typeof e.next=="function")return e;if(!isNaN(e.length)){var n=-1,a=function u(){for(;++n<e.length;)if(S.call(e,n))return u.value=e[n],u.done=!1,u;return u.value=C,u.done=!0,u};return a.next=a}}return{next:f}}v.values=d;function f(){return{value:C,done:!0}}return i.prototype={constructor:i,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=C,this.done=!1,this.delegate=null,this.method="next",this.arg=C,this.tryEntries.forEach(r),!e)for(var t in this)t.charAt(0)==="t"&&S.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=C)},stop:function(){this.done=!0;var e=this.tryEntries[0],t=e.completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(b,g){return p.type="throw",p.arg=e,t.next=b,g&&(t.method="next",t.arg=C),!!g}for(var a=this.tryEntries.length-1;a>=0;--a){var u=this.tryEntries[a],p=u.completion;if(u.tryLoc==="root")return n("end");if(u.tryLoc<=this.prev){var _=S.call(u,"catchLoc"),y=S.call(u,"finallyLoc");if(_&&y){if(this.prev<u.catchLoc)return n(u.catchLoc,!0);if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else if(_){if(this.prev<u.catchLoc)return n(u.catchLoc,!0)}else if(y){if(this.prev<u.finallyLoc)return n(u.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&S.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var u=a;break}}u&&(e==="break"||e==="continue")&&u.tryLoc<=t&&t<=u.finallyLoc&&(u=null);var p=u?u.completion:{};return p.type=e,p.arg=t,u?(this.method="next",this.next=u.finallyLoc,O):this.complete(p)},complete:function(e,t){if(e.type==="throw")throw e.arg;return e.type==="break"||e.type==="continue"?this.next=e.arg:e.type==="return"?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):e.type==="normal"&&t&&(this.next=t),O},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),r(n),O}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var a=n.completion;if(a.type==="throw"){var u=a.arg;r(n)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:d(e),resultName:t,nextLoc:n},this.method==="next"&&(this.arg=C),O}},v}(m.exports);try{regeneratorRuntime=w}catch(v){typeof globalThis=="object"?globalThis.regeneratorRuntime=w:Function("r","regeneratorRuntime = r")(w)}}},ne={};function W(m){var w=ne[m];if(w!==void 0)return w.exports;var v=ne[m]={exports:{}};return ae[m](v,v.exports,W),v.exports}(function(){W.n=function(m){var w=m&&m.__esModule?function(){return m.default}:function(){return m};return W.d(w,{a:w}),w}})(),function(){W.d=function(m,w){for(var v in w)W.o(w,v)&&!W.o(m,v)&&Object.defineProperty(m,v,{enumerable:!0,get:w[v]})}}(),function(){W.o=function(m,w){return Object.prototype.hasOwnProperty.call(m,w)}}();var I={};(function(){W.d(I,{dp:function(){return F},bw:function(){return j},F7:function(){return J},hC:function(){return E},WU:function(){return K}});function m(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}function w(c,s,l){return s in c?Object.defineProperty(c,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):c[s]=l,c}function v(c){for(var s=1;s<arguments.length;s++){var l=arguments[s]!=null?arguments[s]:{},o=Object.keys(l);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(l).filter(function(r){return Object.getOwnPropertyDescriptor(l,r).enumerable}))),o.forEach(function(r){w(c,r,l[r])})}return c}var $=function(){try{var c=document.createElement("canvas");return!!(window.WebGL2RenderingContext&&c.getContext("webgl2"))}catch(s){return!1}},S=0,C=1,X=null,U=$()!==!1,B={},F=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.bloomController?!0:(console.warn("err:pencil.options.bloom"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;e.enable(),r.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||(n.layers.enable(C),B[n.uuid]=!0)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.bloomController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||(n.layers.disable(C),delete B[n.uuid])}),Object.keys(B).length===0&&(e.disable(),r.event.emit("passcheck","bloom"))}},c}(),j=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.outlineController?!0:(console.warn("err:pencil.options.outline"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;e.enable(),r.event.emit("passcheck","outline"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.outlineController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","outline"))}},c}(),J=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},o)}var s=c.prototype;return s.check=function(){var o,r=this.object.pencil;return!((o=r.composerController)===null||o===void 0)&&o.ssrController?!0:(console.warn("err:pencil.options.ssr"),!1)},s.enable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;e.enable(),r.event.emit("passcheck","ssr"),this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||n.material&&e.selectedObjects.push(n)})}},s.disable=function(){var o;if(!!this.check()){var r=this.object.pencil,i=this.options,d=i.exclude,f=i.include,e=(o=r.composerController)===null||o===void 0?void 0:o.ssrController;this.object.object3d.traverse(function(t){var n=t;f&&!f.includes(n)||d&&d.includes(n)||!n.material||e.selectedObjects.splice(e.selectedObjects.indexOf(n),1)}),e.selectedObjects.length===0&&(e.disable(),r.event.emit("passcheck","ssr"))}},c}();function T(c,s,l,o,r,i,d){try{var f=c[i](d),e=f.value}catch(t){l(t);return}f.done?s(e):Promise.resolve(e).then(o,r)}function H(c){return function(){var s=this,l=arguments;return new Promise(function(o,r){var i=c.apply(s,l);function d(e){T(i,o,r,d,f,"next",e)}function f(e){T(i,o,r,d,f,"throw",e)}d(void 0)})}}var Z=W(666),z=W.n(Z),A=c=>{var s={};return W.d(s,c),s},O=c=>()=>c,x=A({Color:()=>Q.Color,Vector2:()=>Q.Vector2,Vector3:()=>Q.Vector3,Vector4:()=>Q.Vector4}),G=c=>{var s={};return W.d(s,c),s},k=c=>()=>c,V=G({animate:()=>ie.animate});function q(c){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return c.then(function(l){return v({err:null,res:l},s)}).catch(function(l){return v({err:l,res:void 0},s)})}function L(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l={};return l.promise=new Promise(function(o,r){l.resolve=o,l.reject=r}),c&&(l.promise=q(l.promise,s)),l}var E=function(){"use strict";function c(l){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};m(this,c),this.object=l,this.options=v({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new x.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},o)}var s=c.prototype;return s.initMaterial=function(){var o=this,r=this.options,i=r.color,d=r.lineNum,f=r.lineWidth,e=r.lineHieght,t=r.fade,n=r.fadeType,a=r.radius,u=r.range,p=r.vertical,_=r.step,y=r.opacity,b=r.exclude,g={field:{value:new x.Vector4(0,0,0,0)},color:{value:new x.Color(i)},opacity:{value:y},lineNum:{value:d},lineWidth:{value:f},lineHieght:{value:e},sizeNum:{value:new x.Vector3(a,a,a)},objPos:{value:new x.Vector3(0,0,0)},fade:{value:t},fadeType:{value:n},range:{value:u},angle:{value:0},stepNum:{value:_}};if(!a){var P=this.object.getSize().size;g.sizeNum.value.copy(P)}this.uniforms=g,this.object.object3d.traverse(function(N){var h=N;!h.material||b&&b.includes(h)||(h.userData.materialO?h.material=h.userData.materialO.clone():h.userData.materialO=Array.isArray(h.material)?h.material.map(function(D){return D.clone()}):h.material.clone(),Array.isArray(h.material)?h.material.forEach(function(D){p?o.setVerticalMaterial(D):o.setMaterial(D)}):p?o.setVerticalMaterial(h.material):o.setMaterial(h.material))})},s.setMaterial=function(o){var r=this.uniforms;o.onBeforeCompile=function(i){i.uniforms.field=r.field,i.uniforms.fieldColor=r.color,i.uniforms.fieldOpacity=r.opacity,i.uniforms.lineNum=r.lineNum,i.uniforms.lineWidth=r.lineWidth,i.uniforms.sizeNum=r.sizeNum,i.uniforms.fade=r.fade,i.uniforms.fadeType=r.fadeType,i.uniforms.range=r.range,i.uniforms.stepNum=r.stepNum,i.vertexShader=`
|
|
1
|
+
import*as q from"three";import*as K from"popmotion";var Q={666:function(P){var x=function(h){"use strict";var U=Object.prototype,W=U.hasOwnProperty,S,E=typeof Symbol=="function"?Symbol:{},G=E.iterator||"@@iterator",X=E.asyncIterator||"@@asyncIterator",M=E.toStringTag||"@@toStringTag";function j(r,e,n){return Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),r[e]}try{j({},"")}catch(r){j=function(e,n,f){return e[n]=f}}function $(r,e,n,f){var i=e&&e.prototype instanceof c?e:c,v=Object.create(i.prototype),b=new y(f||[]);return v._invoke=m(r,n,b),v}h.wrap=$;function V(r,e,n){try{return{type:"normal",arg:r.call(e,n)}}catch(f){return{type:"throw",arg:f}}}var B="suspendedStart",H="suspendedYield",F="executing",I="completed",O={};function c(){}function s(){}function l(){}var a={};j(a,G,function(){return this});var t=Object.getPrototypeOf,o=t&&t(t(A([])));o&&o!==U&&W.call(o,G)&&(a=o);var d=l.prototype=c.prototype=Object.create(a);s.prototype=l,j(d,"constructor",l),j(l,"constructor",s),s.displayName=j(l,M,"GeneratorFunction");function u(r){["next","throw","return"].forEach(function(e){j(r,e,function(n){return this._invoke(e,n)})})}h.isGeneratorFunction=function(r){var e=typeof r=="function"&&r.constructor;return e?e===s||(e.displayName||e.name)==="GeneratorFunction":!1},h.mark=function(r){return Object.setPrototypeOf?Object.setPrototypeOf(r,l):(r.__proto__=l,j(r,M,"GeneratorFunction")),r.prototype=Object.create(d),r},h.awrap=function(r){return{__await:r}};function p(r,e){function n(v,b,g,N){var _=V(r[v],r,b);if(_.type==="throw")N(_.arg);else{var R=_.arg,T=R.value;return T&&typeof T=="object"&&W.call(T,"__await")?e.resolve(T.__await).then(function(D){n("next",D,g,N)},function(D){n("throw",D,g,N)}):e.resolve(T).then(function(D){R.value=D,g(R)},function(D){return n("throw",D,g,N)})}}var f;function i(v,b){function g(){return new e(function(N,_){n(v,b,N,_)})}return f=f?f.then(g,g):g()}this._invoke=i}u(p.prototype),j(p.prototype,X,function(){return this}),h.AsyncIterator=p,h.async=function(r,e,n,f,i){i===void 0&&(i=Promise);var v=new p($(r,e,n,f),i);return h.isGeneratorFunction(e)?v:v.next().then(function(b){return b.done?b.value:v.next()})};function m(r,e,n){var f=B;return function(v,b){if(f===F)throw new Error("Generator is already running");if(f===I){if(v==="throw")throw b;return L()}for(n.method=v,n.arg=b;;){var g=n.delegate;if(g){var N=k(g,n);if(N){if(N===O)continue;return N}}if(n.method==="next")n.sent=n._sent=n.arg;else if(n.method==="throw"){if(f===B)throw f=I,n.arg;n.dispatchException(n.arg)}else n.method==="return"&&n.abrupt("return",n.arg);f=F;var _=V(r,e,n);if(_.type==="normal"){if(f=n.done?I:H,_.arg===O)continue;return{value:_.arg,done:n.done}}else _.type==="throw"&&(f=I,n.method="throw",n.arg=_.arg)}}}function k(r,e){var n=r.iterator[e.method];if(n===S){if(e.delegate=null,e.method==="throw"){if(r.iterator.return&&(e.method="return",e.arg=S,k(r,e),e.method==="throw"))return O;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return O}var f=V(n,r.iterator,e.arg);if(f.type==="throw")return e.method="throw",e.arg=f.arg,e.delegate=null,O;var i=f.arg;if(!i)return e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,O;if(i.done)e[r.resultName]=i.value,e.next=r.nextLoc,e.method!=="return"&&(e.method="next",e.arg=S);else return i;return e.delegate=null,O}u(d),j(d,M,"Generator"),j(d,G,function(){return this}),j(d,"toString",function(){return"[object Generator]"});function w(r){var e={tryLoc:r[0]};1 in r&&(e.catchLoc=r[1]),2 in r&&(e.finallyLoc=r[2],e.afterLoc=r[3]),this.tryEntries.push(e)}function C(r){var e=r.completion||{};e.type="normal",delete e.arg,r.completion=e}function y(r){this.tryEntries=[{tryLoc:"root"}],r.forEach(w,this),this.reset(!0)}h.keys=function(r){var e=[];for(var n in r)e.push(n);return e.reverse(),function f(){for(;e.length;){var i=e.pop();if(i in r)return f.value=i,f.done=!1,f}return f.done=!0,f}};function A(r){if(r){var e=r[G];if(e)return e.call(r);if(typeof r.next=="function")return r;if(!isNaN(r.length)){var n=-1,f=function i(){for(;++n<r.length;)if(W.call(r,n))return i.value=r[n],i.done=!1,i;return i.value=S,i.done=!0,i};return f.next=f}}return{next:L}}h.values=A;function L(){return{value:S,done:!0}}return y.prototype={constructor:y,reset:function(r){if(this.prev=0,this.next=0,this.sent=this._sent=S,this.done=!1,this.delegate=null,this.method="next",this.arg=S,this.tryEntries.forEach(C),!r)for(var e in this)e.charAt(0)==="t"&&W.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=S)},stop:function(){this.done=!0;var r=this.tryEntries[0],e=r.completion;if(e.type==="throw")throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(N,_){return v.type="throw",v.arg=r,e.next=N,_&&(e.method="next",e.arg=S),!!_}for(var f=this.tryEntries.length-1;f>=0;--f){var i=this.tryEntries[f],v=i.completion;if(i.tryLoc==="root")return n("end");if(i.tryLoc<=this.prev){var b=W.call(i,"catchLoc"),g=W.call(i,"finallyLoc");if(b&&g){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(b){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else if(g){if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else throw new Error("try statement without catch or finally")}}},abrupt:function(r,e){for(var n=this.tryEntries.length-1;n>=0;--n){var f=this.tryEntries[n];if(f.tryLoc<=this.prev&&W.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var i=f;break}}i&&(r==="break"||r==="continue")&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var v=i?i.completion:{};return v.type=r,v.arg=e,i?(this.method="next",this.next=i.finallyLoc,O):this.complete(v)},complete:function(r,e){if(r.type==="throw")throw r.arg;return r.type==="break"||r.type==="continue"?this.next=r.arg:r.type==="return"?(this.rval=this.arg=r.arg,this.method="return",this.next="end"):r.type==="normal"&&e&&(this.next=e),O},finish:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===r)return this.complete(n.completion,n.afterLoc),C(n),O}},catch:function(r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===r){var f=n.completion;if(f.type==="throw"){var i=f.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:A(r),resultName:e,nextLoc:n},this.method==="next"&&(this.arg=S),O}},h}(P.exports);try{regeneratorRuntime=x}catch(h){typeof globalThis=="object"?globalThis.regeneratorRuntime=x:Function("r","regeneratorRuntime = r")(x)}}},J={};function z(P){var x=J[P];if(x!==void 0)return x.exports;var h=J[P]={exports:{}};return Q[P](h,h.exports,z),h.exports}(function(){z.n=function(P){var x=P&&P.__esModule?function(){return P.default}:function(){return P};return z.d(x,{a:x}),x}})(),function(){z.d=function(P,x){for(var h in x)z.o(x,h)&&!z.o(P,h)&&Object.defineProperty(P,h,{enumerable:!0,get:x[h]})}}(),function(){z.o=function(P,x){return Object.prototype.hasOwnProperty.call(P,x)}}();var Y={};(function(){z.d(Y,{dp:function(){return O},hC:function(){return F},WU:function(){return I}});function P(c,s,l,a,t,o,d){try{var u=c[o](d),p=u.value}catch(m){l(m);return}u.done?s(p):Promise.resolve(p).then(a,t)}function x(c){return function(){var s=this,l=arguments;return new Promise(function(a,t){var o=c.apply(s,l);function d(p){P(o,a,t,d,u,"next",p)}function u(p){P(o,a,t,d,u,"throw",p)}d(void 0)})}}function h(c,s){if(!(c instanceof s))throw new TypeError("Cannot call a class as a function")}function U(c,s,l){return s in c?Object.defineProperty(c,s,{value:l,enumerable:!0,configurable:!0,writable:!0}):c[s]=l,c}function W(c){for(var s=1;s<arguments.length;s++){var l=arguments[s]!=null?arguments[s]:{},a=Object.keys(l);typeof Object.getOwnPropertySymbols=="function"&&(a=a.concat(Object.getOwnPropertySymbols(l).filter(function(t){return Object.getOwnPropertyDescriptor(l,t).enumerable}))),a.forEach(function(t){U(c,t,l[t])})}return c}var S=z(666),E=z.n(S),G=c=>{var s={};return z.d(s,c),s},X=c=>()=>c,M=G({Color:()=>q.Color,Vector2:()=>q.Vector2,Vector3:()=>q.Vector3,Vector4:()=>q.Vector4}),j=c=>{var s={};return z.d(s,c),s},$=c=>()=>c,V=j({animate:()=>K.animate});function B(c){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return c.then(function(l){return W({err:null,res:l},s)}).catch(function(l){return W({err:l,res:void 0},s)})}function H(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l={};return l.promise=new Promise(function(a,t){l.resolve=a,l.reject=t}),c&&(l.promise=B(l.promise,s)),l}var F=function(){"use strict";function c(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};h(this,c),this.object=l,this.options=W({},{color:16777215,opacity:1,lineNum:10,lineWidth:1,lineHieght:10,fade:!1,fadeType:2,radius:0,range:new M.Vector2(0,1),vertical:!1,step:0,pos:"bottom",duration:5e3,yoyo:!1,repeat:0},a)}var s=c.prototype;return s.initMaterial=function(){var a=this,t=this.options,o=t.color,d=t.lineNum,u=t.lineWidth,p=t.lineHieght,m=t.fade,k=t.fadeType,w=t.radius,C=t.range,y=t.vertical,A=t.step,L=t.opacity,r=t.exclude,e={field:{value:new M.Vector4(0,0,0,0)},color:{value:new M.Color(o)},opacity:{value:L},lineNum:{value:d},lineWidth:{value:u},lineHieght:{value:p},sizeNum:{value:new M.Vector3(w,w,w)},objPos:{value:new M.Vector3(0,0,0)},fade:{value:m},fadeType:{value:k},range:{value:C},angle:{value:0},stepNum:{value:A}};if(!w){var n=this.object.getSize().size;e.sizeNum.value.copy(n)}this.uniforms=e,this.object.object3d.traverse(function(f){var i=f;!i.material||r&&r.includes(i)||(i.userData.materialO?i.material=i.userData.materialO.clone():i.userData.materialO=Array.isArray(i.material)?i.material.map(function(v){return v.clone()}):i.material.clone(),Array.isArray(i.material)?i.material.forEach(function(v){y?a.setVerticalMaterial(v):a.setMaterial(v)}):y?a.setVerticalMaterial(i.material):a.setMaterial(i.material))})},s.setMaterial=function(a){var t=this.uniforms;a.onBeforeCompile=function(o){o.uniforms.field=t.field,o.uniforms.fieldColor=t.color,o.uniforms.fieldOpacity=t.opacity,o.uniforms.lineNum=t.lineNum,o.uniforms.lineWidth=t.lineWidth,o.uniforms.sizeNum=t.sizeNum,o.uniforms.fade=t.fade,o.uniforms.fadeType=t.fadeType,o.uniforms.range=t.range,o.uniforms.stepNum=t.stepNum,o.vertexShader=`
|
|
2
2
|
varying vec4 vWorldPos;
|
|
3
|
-
`.concat(
|
|
3
|
+
`.concat(o.vertexShader,`
|
|
4
4
|
`).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
|
|
5
5
|
vWorldPos = vec4( transformed, 1.0 );
|
|
6
6
|
#ifdef USE_INSTANCING
|
|
7
7
|
vWorldPos = instanceMatrix * vWorldPos;
|
|
8
8
|
#endif
|
|
9
9
|
vWorldPos = modelMatrix * vWorldPos;
|
|
10
|
-
`),
|
|
10
|
+
`),o.fragmentShader=`
|
|
11
11
|
uniform vec4 field;
|
|
12
12
|
uniform vec3 fieldColor;
|
|
13
13
|
uniform float fieldOpacity;
|
|
@@ -19,7 +19,7 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
|
|
|
19
19
|
uniform vec2 range;
|
|
20
20
|
uniform int stepNum;
|
|
21
21
|
varying vec4 vWorldPos;
|
|
22
|
-
`.concat(
|
|
22
|
+
`.concat(o.fragmentShader,`
|
|
23
23
|
`).replace("#include <dithering_fragment>",`#include <dithering_fragment>
|
|
24
24
|
float height = sizeNum.y;
|
|
25
25
|
bool isTop = field.y > vWorldPos.y;
|
|
@@ -54,16 +54,16 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
|
-
`)},
|
|
57
|
+
`)},a.needsUpdate=!0},s.setVerticalMaterial=function(a){var t=this.uniforms;a.onBeforeCompile=function(o){o.uniforms.field=t.field,o.uniforms.fieldColor=t.color,o.uniforms.fieldOpacity=t.opacity,o.uniforms.lineNum=t.lineNum,o.uniforms.lineWidth=t.lineWidth,o.uniforms.lineHieght=t.lineHieght,o.uniforms.sizeNum=t.sizeNum,o.uniforms.fade=t.fade,o.uniforms.range=t.range,o.uniforms.angle=t.angle,o.uniforms.objPos=t.objPos,o.vertexShader=`
|
|
58
58
|
varying vec4 vWorldPos;
|
|
59
|
-
`.concat(
|
|
59
|
+
`.concat(o.vertexShader,`
|
|
60
60
|
`).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
|
|
61
61
|
vWorldPos = vec4( transformed, 1.0 );
|
|
62
62
|
#ifdef USE_INSTANCING
|
|
63
63
|
vWorldPos = instanceMatrix * vWorldPos;
|
|
64
64
|
#endif
|
|
65
65
|
vWorldPos = modelMatrix * vWorldPos;
|
|
66
|
-
`),
|
|
66
|
+
`),o.fragmentShader=`
|
|
67
67
|
uniform vec4 field;
|
|
68
68
|
uniform vec3 fieldColor;
|
|
69
69
|
uniform float fieldOpacity;
|
|
@@ -81,7 +81,7 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
|
|
|
81
81
|
return(x - objPos.x)*cos(a) - (z - objPos.z)*sin(a) + objPos.x ;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
`.concat(
|
|
84
|
+
`.concat(o.fragmentShader,`
|
|
85
85
|
`).replace("#include <dithering_fragment>",`#include <dithering_fragment>
|
|
86
86
|
|
|
87
87
|
float worldDist = distance(field.y, vWorldPos.y);
|
|
@@ -125,23 +125,23 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
`)},
|
|
128
|
+
`)},a.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(a){var t=a;t.material&&t.userData.materialO&&(t.material=t.userData.materialO.clone(),t.userData.materialO=void 0)})},s.play=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;this.stop();var o=H(!0),d=this,u=d.object,p=d.uniforms,m=W({},this.options,a),k=m.lineNum,w=m.step,C=m.lineWidth,y=m.pos,A=m.duration,L=u.getSize(),r=L.min,e=L.max,n=L.size,f=k,i=C;w>0&&(f=1,i=n.y/w);var v=p.sizeNum.value.y*(f>1?2:1);return this.tween=(0,V.animate)({from:0,to:1,duration:A,onPlay:function(){var b,g=new M.Vector3;y==="bottom"?g.set(r.x-.001,r.y-.001,r.z-.001):y==="top"&&g.set(e.x+.001,e.y+.001,e.z+.001);var N=((b=u.pencil.control)===null||b===void 0?void 0:b.getAzimuthalAngle())||0,_=t.object.object3d.position.clone();if(N){var R=Math.sqrt(Math.pow(n.x,2)+Math.pow(n.z,2))/2;g.x=_.x+R,g.z=_.z+R;var T=new M.Vector3().subVectors(g,_),D=new M.Vector3(0,1,0);T.applyAxisAngle(D,N),g.addVectors(_,T)}p.objPos.value.copy(_),p.field.value.set(g.x,g.y,g.z,0),p.angle.value=N,p.lineNum.value=f,p.lineWidth.value=i},onUpdate:function(b){w>0?p.field.value.w=Math.floor(b*w)/w*v:p.field.value.w=b*v},onStop:function(){p.field.value.w=0,o.reject("stop")},onComplete:function(){o.resolve()}}),o.promise},s.checkRepeat=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;return x(E().mark(function o(){var d,u,p,m,k,w;return E().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return d=W({},t.options,a),u=d.yoyo,p=d.repeat,m=d.pos,p===t.options.repeat&&t.initMaterial(),y.next=4,t.play(a);case 4:if(k=y.sent.err,!k){y.next=8;break}return t.resetMaterial(),y.abrupt("return");case 8:if(!p){y.next=15;break}return w=m,u&&(w=w==="bottom"?"top":"bottom"),y.next=13,t.checkRepeat({pos:w,repeat:p===1/0?-1:p-1});case 13:y.next=16;break;case 15:t.resetMaterial();case 16:case"end":return y.stop()}},o)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}(),I=function(){"use strict";function c(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};h(this,c),this.object=l,this.options=W({},{color:16777215,lineWidth:2,opacity:.5,fade:!1,position:new M.Vector3(0,0,0),duration:5e3,repeat:0},a)}var s=c.prototype;return s.initMaterial=function(){var a=this,t=this.options.exclude,o={field:{value:new M.Vector4(0,0,0,1e-4)},color:{value:new M.Color(this.options.color)},opacity:{value:this.options.opacity},lineWidth:{value:this.options.lineWidth}};this.uniforms=o,this.object.object3d.traverse(function(d){var u=d;!u.material||t&&t.includes(u)||(u.userData.materialO?u.material=u.userData.materialO:u.userData.materialO=Array.isArray(u.material)?u.material.map(function(p){return p.clone()}):u.material.clone(),Array.isArray(u.material)?u.material.forEach(function(p){a.setMaterial(p)}):a.setMaterial(u.material))})},s.setMaterial=function(a){var t=this.uniforms;a.onBeforeCompile=function(o){o.uniforms.field=t.field,o.uniforms.fieldColor=t.color,o.uniforms.fieldOpacity=t.opacity,o.uniforms.lineWidth=t.lineWidth,o.vertexShader=`
|
|
129
129
|
varying vec4 vWorldPos;
|
|
130
|
-
`.concat(
|
|
130
|
+
`.concat(o.vertexShader,`
|
|
131
131
|
`).replace("#include <worldpos_vertex>",`#include <worldpos_vertex>
|
|
132
132
|
vWorldPos = vec4( transformed, 1.0 );
|
|
133
133
|
#ifdef USE_INSTANCING
|
|
134
134
|
vWorldPos = instanceMatrix * vWorldPos;
|
|
135
135
|
#endif
|
|
136
136
|
vWorldPos = modelMatrix * vWorldPos;
|
|
137
|
-
`),
|
|
137
|
+
`),o.fragmentShader=`
|
|
138
138
|
uniform vec4 field;
|
|
139
139
|
uniform vec3 fieldColor;
|
|
140
140
|
uniform float fieldOpacity;
|
|
141
141
|
uniform float lineWidth;
|
|
142
142
|
|
|
143
143
|
varying vec4 vWorldPos;
|
|
144
|
-
`.concat(
|
|
144
|
+
`.concat(o.fragmentShader,`
|
|
145
145
|
`).replace("#include <dithering_fragment>",`#include <dithering_fragment>
|
|
146
146
|
|
|
147
147
|
float worldDist = distance(field.xyz, vWorldPos.xyz);
|
|
@@ -157,4 +157,4 @@ import*as Q from"three";import*as ie from"popmotion";var ae={666:function(m){var
|
|
|
157
157
|
}
|
|
158
158
|
gl_FragColor.rgb = mix(gl_FragColor.rgb, fieldColor, fadeout);
|
|
159
159
|
|
|
160
|
-
`)},
|
|
160
|
+
`)},a.needsUpdate=!0},s.resetMaterial=function(){this.object.object3d.traverse(function(a){var t=a;t.material&&t.userData.materialO&&(t.material=t.userData.materialO.clone(),t.userData.materialO=void 0)})},s.play=function(){var a=this;this.stop();var t=H(!0),o=this,d=o.object,u=o.uniforms,p=this.options,m=p.position,k=p.duration,w=this.options.radius;if(!w){var C=d.getSize().size;w=Math.max(C.x,C.y,C.z)}return this.tween=(0,V.animate)({from:1e-4,to:1,duration:k,onPlay:function(){u.field.value.set(m.x,m.y,m.z,1e-4),a.options.fade&&(u.opacity.value=a.options.opacity)},onUpdate:function(y){u.field.value.w=y*w,a.options.fade&&(u.opacity.value=(1-y)*a.options.opacity)},onStop:function(){u.field.value.w=0,t.reject("stop")},onComplete:function(){t.resolve()}}),t.promise},s.checkRepeat=function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=this;return x(E().mark(function o(){var d,u;return E().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return d=W({},t.options,a).repeat,d===t.options.repeat&&t.initMaterial(),m.next=4,t.play();case 4:if(u=m.sent.err,!u){m.next=8;break}return t.resetMaterial(),m.abrupt("return");case 8:if(!d){m.next=13;break}return m.next=11,t.checkRepeat({repeat:d===1/0?-1:d-1});case 11:m.next=14;break;case 13:t.resetMaterial();case 14:case"end":return m.stop()}},o)}))()},s.start=function(){return this.checkRepeat()},s.stop=function(){this.tween&&this.tween.stop()},c}(),O=function(){"use strict";function c(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};h(this,c),this.object=l,this.options=W({},a)}var s=c.prototype;return s.check=function(){var a=this.object.pencil;return a.composerController.bloomPass?!0:(console.warn("err:pencil.options.bloom"),!1)},s.enable=function(){if(!!this.check()){var a=this.object.pencil,t=this.options,o=t.exclude,d=t.include,u=a.composerController.bloomPass;u.enabled=!0,a.event.emit("passcheck","bloom"),this.object.object3d.traverse(function(p){var m=p;d&&!d.includes(m)||o&&o.includes(m)||a.composerController.toggleBloomSelection(m)})}},s.disable=function(){if(!!this.check()){var a=this.object.pencil,t=this.options,o=t.exclude,d=t.include,u=a.composerController.bloomPass;this.object.object3d.traverse(function(p){var m=p;d&&!d.includes(m)||o&&o.includes(m)||a.composerController.toggleBloomSelection(m)}),a.composerController.bloomEffect.selection.size||(u.enabled=!1,a.event.emit("passcheck","bloom"))}},c}()})();var Z=Y.dp,ee=Y.hC,te=Y.WU;export{Z as Bloom,ee as Scan,te as Scan2};
|