@needle-tools/engine 2.67.7-pre → 2.67.8-pre
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/CHANGELOG.md +5 -0
- package/dist/needle-engine.js +3 -2
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_mainloop_utils.js +4 -1
- package/lib/engine/engine_mainloop_utils.js.map +1 -1
- package/package.json +1 -1
- package/plugins/vite/drop.js +1 -0
- package/plugins/vite/editor-connection.js +1 -1
- package/plugins/vite/poster.js +1 -1
- package/plugins/vite/reload.js +1 -1
- package/src/engine/engine_mainloop_utils.ts +4 -2
- package/src/engine-components/postprocessing/Volume.ts +213 -213
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,11 @@ All notable changes to this package will be documented in this file.
|
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [2.67.8-pre] - 2023-03-31
|
|
8
|
+
- Fix: vite plugins must have a name
|
|
9
|
+
- Fix: activeInHierarchy update when key is undefined (e.g. in r3f context)
|
|
10
|
+
- Change: cleanup r3f component
|
|
11
|
+
|
|
7
12
|
## [2.67.7-pre] - 2023-03-30
|
|
8
13
|
- Add: time smoothed delta time
|
|
9
14
|
- Add this.context.targetFrameRate
|
package/dist/needle-engine.js
CHANGED
|
@@ -21806,13 +21806,14 @@ function el(i) {
|
|
|
21806
21806
|
console.trace("Invalid call - no current context.");
|
|
21807
21807
|
return;
|
|
21808
21808
|
}
|
|
21809
|
-
|
|
21809
|
+
const A = ZE(i);
|
|
21810
|
+
bF(i, A, !0) || (console.error('Failed to update active state in hierarchy of "' + i.name + '"', i), console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."));
|
|
21810
21811
|
}
|
|
21811
21812
|
function bF(i, A, g, I = 0) {
|
|
21812
21813
|
if (I > 1e3)
|
|
21813
21814
|
return console.warn("Hierarchy is too deep (> 1000 level) - will abort updating active state"), !1;
|
|
21814
21815
|
const e = ZE(i);
|
|
21815
|
-
A && (A = e, A && i.parent && (A = i.parent[Ds]));
|
|
21816
|
+
A && (A = e, A && i.parent && (A = i.parent[Ds], A === void 0 && (A = !0)));
|
|
21816
21817
|
const C = i[Ds] !== A;
|
|
21817
21818
|
i[Ds] = A, C && (RO && console.warn("ACTIVE CHANGE", i.name, e, i.visible, A, "changed?" + C, i), g && FO(i, (s) => {
|
|
21818
21819
|
A ? s.enabled && (ia(s.__internalAwake.bind(s)), s.__didEnable = !0, s.onEnable()) : s.__didAwake && (s.__didEnable = !1, s.onDisable());
|
|
@@ -3252,7 +3252,7 @@ in script ${I}.ts
|
|
|
3252
3252
|
uv.y = 1.0 - uv.y;
|
|
3253
3253
|
gl_FragColor = texture2D( map, uv);
|
|
3254
3254
|
// gl_FragColor = vec4(uv.xy, 0, 1);
|
|
3255
|
-
}`),Q(_t,"blipMaterial",new Og({uniforms:{map:new MA(null)},vertexShader:xQ.vertex,fragmentShader:xQ.fragment})),Q(_t,"mesh",new GA(xQ.planeGeometry,xQ.blipMaterial));function nO(i){return _t.copyTexture(i)}function BO(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const RR=new CC(()=>new M,20);class aO{constructor(A,g,I,e,t){Q(this,"_point");Q(this,"_normal");Q(this,"distance");Q(this,"impulse");Q(this,"friction");this._point=A,this.distance=g,this._normal=I,this.impulse=e,this.friction=t}get point(){return RR.get().set(this._point.x,this._point.y,this._point.z)}get normal(){return RR.get().set(this._normal.x,this._normal.y,this._normal.z)}}class mR{constructor(A,g,I){Q(this,"contacts");Q(this,"me");Q(this,"_collider");Q(this,"_gameObject");this.me=A,this._collider=g,this._gameObject=g.gameObject,this.contacts=I}get collider(){return this._collider}get gameObject(){return this._gameObject}get rigidBody(){var A;return(A=this.collider)==null?void 0:A.attachedRigidbody}}function Ma(i,A){try{A?i(A):i()}catch(g){return console.error(g),!1}return!0}const cs=Symbol("isActiveInHierarchy"),Ua="builtin_components",Tl=Symbol("originalGuid"),QO=cA("debugnewscripts"),rO=cA("debughierarchy"),JI=[];function Pr(i){if(!(i.new_scripts.length<=0)){if(QO&&console.log("Register new components",i.new_scripts.length,[...i.new_scripts],i.alias?"element: "+i.alias:i.hash,i),i.new_scripts_pre_setup_callbacks.length>0){for(const A of i.new_scripts_pre_setup_callbacks)A&&A();i.new_scripts_pre_setup_callbacks.length=0}JI.length=0,i.new_scripts.length>0&&JI.push(...i.new_scripts),i.new_scripts.length=0;for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed)continue;if(!g.gameObject){console.error("MISSING GAMEOBJECT - will ignore",g),JI.splice(A,1),A--;continue}g.context=i,Wr(g.gameObject),NR(g,i)}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed){hs(JI[A],i),JI.splice(A,1),A--;continue}if(g.registering)try{g.registering()}catch(I){console.error(I)}g.__internalAwake!==void 0&&(g.gameObject||console.error("MISSING GAMEOBJECT",g,g.gameObject),Wr(g.gameObject),g.activeAndEnabled&&Ma(g.__internalAwake.bind(g)))}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed||g.enabled===!1||(Wr(g.gameObject),g.activeAndEnabled===!1))continue;g.__internalEnable!==void 0&&(g.enabled=!0,Ma(g.__internalEnable.bind(g)))}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed||!g.gameObject)continue;i.new_script_start.push(g)}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}JI.length=0;for(const A of i.new_scripts_post_setup_callbacks)A&&A();i.new_scripts_post_setup_callbacks.length=0}}function EO(i){i&&(i.__internalDisable(),hs(i,i.context))}function FR(i,A){for(let g=0;g<i.new_script_start.length;g++)try{const I=i.new_script_start[g];if(A!==void 0&&I.gameObject!==A||I.destroyed||I.activeAndEnabled===!1)continue;Ma(I.__internalAwake.bind(I)),Ma(I.__internalEnable.bind(I)),Ma(I.__internalStart.bind(I)),i.new_script_start.splice(g,1),g--}catch(I){console.error(I),hs(i.new_script_start[g],i),i.new_script_start.splice(g,1),g--}}function NR(i,A){A.scripts.indexOf(i)===-1&&(A.scripts.push(i),i.earlyUpdate&&A.scripts_earlyUpdate.push(i),i.update&&A.scripts_update.push(i),i.lateUpdate&&A.scripts_lateUpdate.push(i),i.onBeforeRender&&A.scripts_onBeforeRender.push(i),i.onAfterRender&&A.scripts_onAfterRender.push(i),i.onPausedChanged&&A.scripts_pausedChanged.push(i))}function hs(i,A){lo(i,A.new_scripts),lo(i,A.new_script_start),lo(i,A.scripts),lo(i,A.scripts_earlyUpdate),lo(i,A.scripts_update),lo(i,A.scripts_lateUpdate),lo(i,A.scripts_onBeforeRender),lo(i,A.scripts_onAfterRender),lo(i,A.scripts_pausedChanged),A.stopAllCoroutinesFrom(i)}function lo(i,A){const g=A.indexOf(i);g>=0&&A.splice(g,1)}function Ol(i){if(i||(i=Ue.Current.scene),!i){console.trace("Invalid call - no current context.");return}KR(i,Na(i),!0)||(console.error('Failed to update active state in hierarchy of "'+i.name+'"',i),console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."))}function KR(i,A,g,I=0){if(I>1e3)return console.warn("Hierarchy is too deep (> 1000 level) - will abort updating active state"),!1;const e=Na(i);A&&(A=e,A&&i.parent&&(A=i.parent[cs]));const C=i[cs]!==A;i[cs]=A,C&&(rO&&console.warn("ACTIVE CHANGE",i.name,e,i.visible,A,"changed?"+C,i),g&&cO(i,s=>{A?s.enabled&&(Ma(s.__internalAwake.bind(s)),s.__didEnable=!0,s.onEnable()):s.__didAwake&&(s.__didEnable=!1,s.onDisable())}));let o=!0;if(i.children){const s=I+1;for(const n of i.children)KR(n,A,g,s)===!1&&(o=!1)}return o}function Wr(i){let A=!0,g=i,I=!1;for(;g&&g;){if(g.type==="Scene"&&(I=!0),!Na(g)){A=!1;break}g=g.parent}if(!i){console.error("GO is null");return}i[cs]=A&&I}function cO(i,A){var g;if((g=i.userData)!=null&&g.components)for(const I of i.userData.components)A(I)}const _l=new Map,JR=Symbol("prewarmFlag"),Of=Symbol("waitingForPrewarm"),_f=cA("debugprewarm");function qR(i,A){if(!i||i[JR]===!0||i[Of]===!0)return;_l.has(A)||_l.set(A,[]),i[Of]=!0,_l.get(A).push(i),_f&&console.debug("register prewarm",i.name)}let LR=null,bR=null;function hO(i){if(!i)return;const A=_l.get(i);if(!(A!=null&&A.length))return;const g=i.mainCamera;if(g){_f&&console.log("prewarm",A.length,"objects",[...A]);const I=i.renderer,e=i.scene;I.compile(e,g),LR??(LR=new Wh(64)),bR??(bR=new kw(.001,9999999,LR)),bR.update(I,e);for(const t of A)t[JR]=!0,t[Of]=!1;A.length=0,_f&&console.log("prewarm done")}}const lO=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function DO(i){return typeof i=="string"&&lO.test(i)}const Ne=[];for(let i=0;i<256;++i)Ne.push((i+256).toString(16).slice(1));function dO(i,A=0){return(Ne[i[A+0]]+Ne[i[A+1]]+Ne[i[A+2]]+Ne[i[A+3]]+"-"+Ne[i[A+4]]+Ne[i[A+5]]+"-"+Ne[i[A+6]]+Ne[i[A+7]]+"-"+Ne[i[A+8]]+Ne[i[A+9]]+"-"+Ne[i[A+10]]+Ne[i[A+11]]+Ne[i[A+12]]+Ne[i[A+13]]+Ne[i[A+14]]+Ne[i[A+15]]).toLowerCase()}function uO(i){if(!DO(i))throw TypeError("Invalid UUID");let A;const g=new Uint8Array(16);return g[0]=(A=parseInt(i.slice(0,8),16))>>>24,g[1]=A>>>16&255,g[2]=A>>>8&255,g[3]=A&255,g[4]=(A=parseInt(i.slice(9,13),16))>>>8,g[5]=A&255,g[6]=(A=parseInt(i.slice(14,18),16))>>>8,g[7]=A&255,g[8]=(A=parseInt(i.slice(19,23),16))>>>8,g[9]=A&255,g[10]=(A=parseInt(i.slice(24,36),16))/1099511627776&255,g[11]=A/4294967296&255,g[12]=A>>>24&255,g[13]=A>>>16&255,g[14]=A>>>8&255,g[15]=A&255,g}function pO(i){i=unescape(encodeURIComponent(i));const A=[];for(let g=0;g<i.length;++g)A.push(i.charCodeAt(g));return A}const wO="6ba7b810-9dad-11d1-80b4-00c04fd430c8",fO="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function yO(i,A,g){function I(e,t,C,o){var s;if(typeof e=="string"&&(e=pO(e)),typeof t=="string"&&(t=uO(t)),((s=t)===null||s===void 0?void 0:s.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let n=new Uint8Array(16+e.length);if(n.set(t),n.set(e,t.length),n=g(n),n[6]=n[6]&15|A,n[8]=n[8]&63|128,C){o=o||0;for(let B=0;B<16;++B)C[o+B]=n[B];return C}return dO(n)}try{I.name=i}catch{}return I.DNS=wO,I.URL=fO,I}function SO(i,A,g,I){switch(i){case 0:return A&g^~A&I;case 1:return A^g^I;case 2:return A&g^A&I^g&I;case 3:return A^g^I}}function Pf(i,A){return i<<A|i>>>32-A}function GO(i){const A=[1518500249,1859775393,2400959708,3395469782],g=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const C=unescape(encodeURIComponent(i));i=[];for(let o=0;o<C.length;++o)i.push(C.charCodeAt(o))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);const I=i.length/4+2,e=Math.ceil(I/16),t=new Array(e);for(let C=0;C<e;++C){const o=new Uint32Array(16);for(let s=0;s<16;++s)o[s]=i[C*64+s*4]<<24|i[C*64+s*4+1]<<16|i[C*64+s*4+2]<<8|i[C*64+s*4+3];t[C]=o}t[e-1][14]=(i.length-1)*8/Math.pow(2,32),t[e-1][14]=Math.floor(t[e-1][14]),t[e-1][15]=(i.length-1)*8&4294967295;for(let C=0;C<e;++C){const o=new Uint32Array(80);for(let E=0;E<16;++E)o[E]=t[C][E];for(let E=16;E<80;++E)o[E]=Pf(o[E-3]^o[E-8]^o[E-14]^o[E-16],1);let s=g[0],n=g[1],B=g[2],r=g[3],a=g[4];for(let E=0;E<80;++E){const c=Math.floor(E/20),h=Pf(s,5)+SO(c,n,B,r)+a+A[c]+o[E]>>>0;a=r,r=B,B=Pf(n,30)>>>0,n=s,s=h}g[0]=g[0]+s>>>0,g[1]=g[1]+n>>>0,g[2]=g[2]+B>>>0,g[3]=g[3]+r>>>0,g[4]=g[4]+a>>>0}return[g[0]>>24&255,g[0]>>16&255,g[0]>>8&255,g[0]&255,g[1]>>24&255,g[1]>>16&255,g[1]>>8&255,g[1]&255,g[2]>>24&255,g[2]>>16&255,g[2]>>8&255,g[2]&255,g[3]>>24&255,g[3]>>16&255,g[3]>>8&255,g[3]&255,g[4]>>24&255,g[4]>>16&255,g[4]>>8&255,g[4]&255]}const vR=yO("v5",80,GO);var Zi=(i=>(i[i.OnConnection=0]="OnConnection",i[i.OnRoomJoin=1]="OnRoomJoin",i[i.Queued=2]="Queued",i[i.Immediate=3]="Immediate",i))(Zi||{});Ue.registerCallback(oC.ContextCreated,i=>{const A=i.context;RO(A),MO(A)});const Pl=cA("debugcomponents"),xR="eff8ba80-635d-11ec-90d6-0242ac120003";class fi{constructor(A){Q(this,"_originalSeed");Q(this,"_seed");typeof A=="string"&&(A=fi.hash(A)),this._originalSeed=A,this._seed=A}get seed(){return this._seed}set seed(A){this._seed=A}reset(){this._seed=this._originalSeed}generateUUID(A){if(typeof A=="string")return vR(A,xR);const g=this._seed;return this._seed-=1,vR(g.toString(),xR)}initialize(A){typeof A=="string"?this._seed=fi.hash(A):this._seed=A}static createFromString(A){return new fi(this.hash(A))}static hash(A){let g=0;for(let I=0;I<A.length;I++)g=A.charCodeAt(I)+((g<<5)-g);return g}}class YR{constructor(A){Q(this,"guid");this.guid=A}}function Wf(i,A,g=!0){if(!i)return;const I=i;if(Ds(i,g),!A){console.warn("Can not send destroy: No networking connection provided",i.guid);return}if(!A.isConnected){console.warn("Can not send destroy: not connected",i.guid);return}let e=i.guid;if(!e&&I.uuid&&(e=I.uuid),!e){console.warn("Can not send destroy: failed to find guid",i);return}const t=new YR(e);A.send("instance-destroyed",t,Zi.Queued)}function kO(i,A){const g=new YR(i);A.send("instance-destroyed",g,Zi.Queued)}function MO(i){i.connection.beginListen("instance-destroyed",A=>{Pl&&console.log("[Remote] Destroyed",i.scene,A);const g=eE(A.guid,i.scene);g&&Ds(g)})}class UO{constructor(A,g){Q(this,"guid");Q(this,"originalGuid");Q(this,"seed");Q(this,"visible");Q(this,"hostData");Q(this,"dontSave");Q(this,"parent");Q(this,"position");Q(this,"rotation");Q(this,"scale");this.originalGuid=A,this.guid=g}}function HR(i,A,g,I){var s;const e=i;if(!e.guid)return console.warn("Can not instantiate: No guid",e),null;if(A.context||(A.context=bg.Current),!A.context)return console.error("Missing network instantiate options / reference to network connection in sync instantiate"),null;const t=A?{...A}:null,{instance:C,seed:o}=mO(e,A);if(C){const n=C;if(n.guid){Pl&&console.log("[Local] new instance","gameobject:",C==null?void 0:C.guid);const B=new UO(e.guid,n.guid);B.seed=o,t&&(t.position&&(B.position={x:t.position.x,y:t.position.y,z:t.position.z}),t.rotation&&(B.rotation={x:t.rotation.x,y:t.rotation.y,z:t.rotation.z,w:t.rotation.w}),t.scale&&(B.scale={x:t.scale.x,y:t.scale.y,z:t.scale.z})),B.position||(B.position={x:n.position.x,y:n.position.y,z:n.position.z}),B.rotation||(B.rotation={x:n.quaternion.x,y:n.quaternion.y,z:n.quaternion.z,w:n.quaternion.w}),B.scale||(B.scale={x:n.scale.x,y:n.scale.y,z:n.scale.z}),B.visible=e.visible,t!=null&&t.parent&&(typeof t.parent=="string"?B.parent=t.parent:B.parent=t.parent.guid),B.hostData=g,I===!1&&(B.dontSave=!0),(s=A==null?void 0:A.context)==null||s.connection.send("new-instance-created",B)}else console.warn("Missing guid, can not send new instance event",n)}return C}function jf(){return Math.random()*9999999}function RO(i){i.connection.beginListen("new-instance-created",async A=>{const g=await NO(A.originalGuid,i.scene);if(!g){console.warn("could not find object that was instantiated: "+A.guid);return}const I=new DC;A.position&&(I.position=new M(A.position.x,A.position.y,A.position.z)),A.rotation&&(I.rotation=new RA(A.rotation.x,A.rotation.y,A.rotation.z,A.rotation.w)),A.scale&&(I.scale=new M(A.scale.x,A.scale.y,A.scale.z)),I.parent=A.parent,A.seed&&(I.idProvider=new fi(A.seed)),I.visible=A.visible,I.context=i,Pl&&i.alias&&console.log("[Remote] instantiate in: "+i.alias);const e=iE(g,I);e&&(A.parent==="scene"&&i.scene.add(e),Pl&&console.log("[Remote] new instance","gameobject:",e==null?void 0:e.guid,g))})}function mO(i,A){const g=jf(),I=A??new DC;I.idProvider=new fi(g);const e=iE(i,I);return{seed:g,instance:e}}const TR={};function FO(i,A){TR[i]=A}async function NO(i,A){const g=TR[i];if(g!=null){const I=await g(i);if(I)return I}return OR(i,A)}function OR(i,A){if(A===null||!i)return null;if(A.guid===i)return A;if(A.children)for(const g of A.children){const I=OR(i,g);if(I)return I}return null}const _R=new Map;function KO(i,A){if(!i)return;if(!A){console.warn("No prototype found",i,i.prototype,i.constructor);return}let g=_R.get(A);g&&g.apply(i)}function JO(i){const A=qO(i.prototype);_R.set(i,A)}function qO(i){return new LO(i)}class LO{constructor(A){Q(this,"$symbol");Q(this,"extensions");Q(this,"descriptors");this.$symbol=Symbol("prototype-extension"),this.extensions=Object.keys(A),this.descriptors=new Array;for(let g=0;g<this.extensions.length;g++){const I=this.extensions[g],e=Object.getOwnPropertyDescriptor(A,I);e&&this.descriptors.push(e)}}apply(A){if(!A[this.$symbol]){A[this.$symbol]=!0;for(let g=0;g<this.extensions.length;g++){const I=this.extensions[g],e=this.descriptors[g];e&&Object.defineProperty(A,I,e)}}}}const bO=new Map;var Wl=(i=>(i.Added="component-added",i.Removing="removing-component",i))(Wl||{});function Zf(i,A){const g=bO.get(i);if(g)for(const I of g)I(A)}const zf=cA("debuggetcomponent");function vO(i){return i==null||i.isObject3D?i:i.object&&i.object.isObject3D?i.object:i}function Vf(i,A){if(!i||!i.userData.components)return;const g=i.userData.components.indexOf(A);g<0||(Zf(Wl.Removing,A),A.gameObject=null,i.userData.components.splice(g,1))}function Xf(i,A){const g=Ra(i,A);if(g)return g;const I=new A;return ls(i,I)}const xO=new fi("addComponentIdProvider");function ls(i,A,g=!0){i.userData||(i.userData={}),i.userData.components||(i.userData.components=[]),i.userData.components.push(A),A.gameObject=i,(A.guid===void 0||A.guid==="invalid")&&(A.guid=xO.generateUUID()),Zl(i),xF(A);try{g&&A.__internalAwake&&(Wr(i),A.__internalAwake()),Zf(Wl.Added,A)}catch(I){console.error(I)}return A}function PR(i,A){if(A.gameObject!==i){if(A.gameObject&&A.gameObject.userData.components){const g=A.gameObject.userData.components.indexOf(A);A.gameObject.userData.components.splice(g,1)}if(!i.userData.components)i.userData.components=[];else if(i.userData.components.includes(A))return;i.userData.components.push(A),A.gameObject=i}}function WR(i){if(i.gameObject&&i.gameObject.userData.components){const A=i.gameObject.userData.components.indexOf(i);i.gameObject.userData.components.splice(A,1)}i.__internalDisable&&i.__internalDisable(),i.onDestroy&&i.onDestroy(),hs(i,i.context??bg.Current),i.__internalDestroy(),i.gameObject=null}let jR=!1;function ZR(i,A,g){var I;if(i!=null){if(!i.isObject3D){console.error("Object is not object3D");return}if(!((I=i==null?void 0:i.userData)!=null&&I.components))return null;if(typeof A=="string"&&(jR||(jR=!0,console.warn(`Accessing components by name is not supported.
|
|
3255
|
+
}`),Q(_t,"blipMaterial",new Og({uniforms:{map:new MA(null)},vertexShader:xQ.vertex,fragmentShader:xQ.fragment})),Q(_t,"mesh",new GA(xQ.planeGeometry,xQ.blipMaterial));function nO(i){return _t.copyTexture(i)}function BO(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas||typeof ImageBitmap<"u"&&i instanceof ImageBitmap}const RR=new CC(()=>new M,20);class aO{constructor(A,g,I,e,t){Q(this,"_point");Q(this,"_normal");Q(this,"distance");Q(this,"impulse");Q(this,"friction");this._point=A,this.distance=g,this._normal=I,this.impulse=e,this.friction=t}get point(){return RR.get().set(this._point.x,this._point.y,this._point.z)}get normal(){return RR.get().set(this._normal.x,this._normal.y,this._normal.z)}}class mR{constructor(A,g,I){Q(this,"contacts");Q(this,"me");Q(this,"_collider");Q(this,"_gameObject");this.me=A,this._collider=g,this._gameObject=g.gameObject,this.contacts=I}get collider(){return this._collider}get gameObject(){return this._gameObject}get rigidBody(){var A;return(A=this.collider)==null?void 0:A.attachedRigidbody}}function Ma(i,A){try{A?i(A):i()}catch(g){return console.error(g),!1}return!0}const cs=Symbol("isActiveInHierarchy"),Ua="builtin_components",Tl=Symbol("originalGuid"),QO=cA("debugnewscripts"),rO=cA("debughierarchy"),JI=[];function Pr(i){if(!(i.new_scripts.length<=0)){if(QO&&console.log("Register new components",i.new_scripts.length,[...i.new_scripts],i.alias?"element: "+i.alias:i.hash,i),i.new_scripts_pre_setup_callbacks.length>0){for(const A of i.new_scripts_pre_setup_callbacks)A&&A();i.new_scripts_pre_setup_callbacks.length=0}JI.length=0,i.new_scripts.length>0&&JI.push(...i.new_scripts),i.new_scripts.length=0;for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed)continue;if(!g.gameObject){console.error("MISSING GAMEOBJECT - will ignore",g),JI.splice(A,1),A--;continue}g.context=i,Wr(g.gameObject),NR(g,i)}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed){hs(JI[A],i),JI.splice(A,1),A--;continue}if(g.registering)try{g.registering()}catch(I){console.error(I)}g.__internalAwake!==void 0&&(g.gameObject||console.error("MISSING GAMEOBJECT",g,g.gameObject),Wr(g.gameObject),g.activeAndEnabled&&Ma(g.__internalAwake.bind(g)))}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed||g.enabled===!1||(Wr(g.gameObject),g.activeAndEnabled===!1))continue;g.__internalEnable!==void 0&&(g.enabled=!0,Ma(g.__internalEnable.bind(g)))}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}for(let A=0;A<JI.length;A++)try{const g=JI[A];if(g.destroyed||!g.gameObject)continue;i.new_script_start.push(g)}catch(g){console.error(g),hs(JI[A],i),JI.splice(A,1),A--}JI.length=0;for(const A of i.new_scripts_post_setup_callbacks)A&&A();i.new_scripts_post_setup_callbacks.length=0}}function EO(i){i&&(i.__internalDisable(),hs(i,i.context))}function FR(i,A){for(let g=0;g<i.new_script_start.length;g++)try{const I=i.new_script_start[g];if(A!==void 0&&I.gameObject!==A||I.destroyed||I.activeAndEnabled===!1)continue;Ma(I.__internalAwake.bind(I)),Ma(I.__internalEnable.bind(I)),Ma(I.__internalStart.bind(I)),i.new_script_start.splice(g,1),g--}catch(I){console.error(I),hs(i.new_script_start[g],i),i.new_script_start.splice(g,1),g--}}function NR(i,A){A.scripts.indexOf(i)===-1&&(A.scripts.push(i),i.earlyUpdate&&A.scripts_earlyUpdate.push(i),i.update&&A.scripts_update.push(i),i.lateUpdate&&A.scripts_lateUpdate.push(i),i.onBeforeRender&&A.scripts_onBeforeRender.push(i),i.onAfterRender&&A.scripts_onAfterRender.push(i),i.onPausedChanged&&A.scripts_pausedChanged.push(i))}function hs(i,A){lo(i,A.new_scripts),lo(i,A.new_script_start),lo(i,A.scripts),lo(i,A.scripts_earlyUpdate),lo(i,A.scripts_update),lo(i,A.scripts_lateUpdate),lo(i,A.scripts_onBeforeRender),lo(i,A.scripts_onAfterRender),lo(i,A.scripts_pausedChanged),A.stopAllCoroutinesFrom(i)}function lo(i,A){const g=A.indexOf(i);g>=0&&A.splice(g,1)}function Ol(i){if(i||(i=Ue.Current.scene),!i){console.trace("Invalid call - no current context.");return}const A=Na(i);KR(i,A,!0)||(console.error('Failed to update active state in hierarchy of "'+i.name+'"',i),console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again)."))}function KR(i,A,g,I=0){if(I>1e3)return console.warn("Hierarchy is too deep (> 1000 level) - will abort updating active state"),!1;const e=Na(i);A&&(A=e,A&&i.parent&&(A=i.parent[cs],A===void 0&&(A=!0)));const C=i[cs]!==A;i[cs]=A,C&&(rO&&console.warn("ACTIVE CHANGE",i.name,e,i.visible,A,"changed?"+C,i),g&&cO(i,s=>{A?s.enabled&&(Ma(s.__internalAwake.bind(s)),s.__didEnable=!0,s.onEnable()):s.__didAwake&&(s.__didEnable=!1,s.onDisable())}));let o=!0;if(i.children){const s=I+1;for(const n of i.children)KR(n,A,g,s)===!1&&(o=!1)}return o}function Wr(i){let A=!0,g=i,I=!1;for(;g&&g;){if(g.type==="Scene"&&(I=!0),!Na(g)){A=!1;break}g=g.parent}if(!i){console.error("GO is null");return}i[cs]=A&&I}function cO(i,A){var g;if((g=i.userData)!=null&&g.components)for(const I of i.userData.components)A(I)}const _l=new Map,JR=Symbol("prewarmFlag"),Of=Symbol("waitingForPrewarm"),_f=cA("debugprewarm");function qR(i,A){if(!i||i[JR]===!0||i[Of]===!0)return;_l.has(A)||_l.set(A,[]),i[Of]=!0,_l.get(A).push(i),_f&&console.debug("register prewarm",i.name)}let LR=null,bR=null;function hO(i){if(!i)return;const A=_l.get(i);if(!(A!=null&&A.length))return;const g=i.mainCamera;if(g){_f&&console.log("prewarm",A.length,"objects",[...A]);const I=i.renderer,e=i.scene;I.compile(e,g),LR??(LR=new Wh(64)),bR??(bR=new kw(.001,9999999,LR)),bR.update(I,e);for(const t of A)t[JR]=!0,t[Of]=!1;A.length=0,_f&&console.log("prewarm done")}}const lO=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function DO(i){return typeof i=="string"&&lO.test(i)}const Ne=[];for(let i=0;i<256;++i)Ne.push((i+256).toString(16).slice(1));function dO(i,A=0){return(Ne[i[A+0]]+Ne[i[A+1]]+Ne[i[A+2]]+Ne[i[A+3]]+"-"+Ne[i[A+4]]+Ne[i[A+5]]+"-"+Ne[i[A+6]]+Ne[i[A+7]]+"-"+Ne[i[A+8]]+Ne[i[A+9]]+"-"+Ne[i[A+10]]+Ne[i[A+11]]+Ne[i[A+12]]+Ne[i[A+13]]+Ne[i[A+14]]+Ne[i[A+15]]).toLowerCase()}function uO(i){if(!DO(i))throw TypeError("Invalid UUID");let A;const g=new Uint8Array(16);return g[0]=(A=parseInt(i.slice(0,8),16))>>>24,g[1]=A>>>16&255,g[2]=A>>>8&255,g[3]=A&255,g[4]=(A=parseInt(i.slice(9,13),16))>>>8,g[5]=A&255,g[6]=(A=parseInt(i.slice(14,18),16))>>>8,g[7]=A&255,g[8]=(A=parseInt(i.slice(19,23),16))>>>8,g[9]=A&255,g[10]=(A=parseInt(i.slice(24,36),16))/1099511627776&255,g[11]=A/4294967296&255,g[12]=A>>>24&255,g[13]=A>>>16&255,g[14]=A>>>8&255,g[15]=A&255,g}function pO(i){i=unescape(encodeURIComponent(i));const A=[];for(let g=0;g<i.length;++g)A.push(i.charCodeAt(g));return A}const wO="6ba7b810-9dad-11d1-80b4-00c04fd430c8",fO="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function yO(i,A,g){function I(e,t,C,o){var s;if(typeof e=="string"&&(e=pO(e)),typeof t=="string"&&(t=uO(t)),((s=t)===null||s===void 0?void 0:s.length)!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let n=new Uint8Array(16+e.length);if(n.set(t),n.set(e,t.length),n=g(n),n[6]=n[6]&15|A,n[8]=n[8]&63|128,C){o=o||0;for(let B=0;B<16;++B)C[o+B]=n[B];return C}return dO(n)}try{I.name=i}catch{}return I.DNS=wO,I.URL=fO,I}function SO(i,A,g,I){switch(i){case 0:return A&g^~A&I;case 1:return A^g^I;case 2:return A&g^A&I^g&I;case 3:return A^g^I}}function Pf(i,A){return i<<A|i>>>32-A}function GO(i){const A=[1518500249,1859775393,2400959708,3395469782],g=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof i=="string"){const C=unescape(encodeURIComponent(i));i=[];for(let o=0;o<C.length;++o)i.push(C.charCodeAt(o))}else Array.isArray(i)||(i=Array.prototype.slice.call(i));i.push(128);const I=i.length/4+2,e=Math.ceil(I/16),t=new Array(e);for(let C=0;C<e;++C){const o=new Uint32Array(16);for(let s=0;s<16;++s)o[s]=i[C*64+s*4]<<24|i[C*64+s*4+1]<<16|i[C*64+s*4+2]<<8|i[C*64+s*4+3];t[C]=o}t[e-1][14]=(i.length-1)*8/Math.pow(2,32),t[e-1][14]=Math.floor(t[e-1][14]),t[e-1][15]=(i.length-1)*8&4294967295;for(let C=0;C<e;++C){const o=new Uint32Array(80);for(let E=0;E<16;++E)o[E]=t[C][E];for(let E=16;E<80;++E)o[E]=Pf(o[E-3]^o[E-8]^o[E-14]^o[E-16],1);let s=g[0],n=g[1],B=g[2],r=g[3],a=g[4];for(let E=0;E<80;++E){const c=Math.floor(E/20),h=Pf(s,5)+SO(c,n,B,r)+a+A[c]+o[E]>>>0;a=r,r=B,B=Pf(n,30)>>>0,n=s,s=h}g[0]=g[0]+s>>>0,g[1]=g[1]+n>>>0,g[2]=g[2]+B>>>0,g[3]=g[3]+r>>>0,g[4]=g[4]+a>>>0}return[g[0]>>24&255,g[0]>>16&255,g[0]>>8&255,g[0]&255,g[1]>>24&255,g[1]>>16&255,g[1]>>8&255,g[1]&255,g[2]>>24&255,g[2]>>16&255,g[2]>>8&255,g[2]&255,g[3]>>24&255,g[3]>>16&255,g[3]>>8&255,g[3]&255,g[4]>>24&255,g[4]>>16&255,g[4]>>8&255,g[4]&255]}const vR=yO("v5",80,GO);var Zi=(i=>(i[i.OnConnection=0]="OnConnection",i[i.OnRoomJoin=1]="OnRoomJoin",i[i.Queued=2]="Queued",i[i.Immediate=3]="Immediate",i))(Zi||{});Ue.registerCallback(oC.ContextCreated,i=>{const A=i.context;RO(A),MO(A)});const Pl=cA("debugcomponents"),xR="eff8ba80-635d-11ec-90d6-0242ac120003";class fi{constructor(A){Q(this,"_originalSeed");Q(this,"_seed");typeof A=="string"&&(A=fi.hash(A)),this._originalSeed=A,this._seed=A}get seed(){return this._seed}set seed(A){this._seed=A}reset(){this._seed=this._originalSeed}generateUUID(A){if(typeof A=="string")return vR(A,xR);const g=this._seed;return this._seed-=1,vR(g.toString(),xR)}initialize(A){typeof A=="string"?this._seed=fi.hash(A):this._seed=A}static createFromString(A){return new fi(this.hash(A))}static hash(A){let g=0;for(let I=0;I<A.length;I++)g=A.charCodeAt(I)+((g<<5)-g);return g}}class YR{constructor(A){Q(this,"guid");this.guid=A}}function Wf(i,A,g=!0){if(!i)return;const I=i;if(Ds(i,g),!A){console.warn("Can not send destroy: No networking connection provided",i.guid);return}if(!A.isConnected){console.warn("Can not send destroy: not connected",i.guid);return}let e=i.guid;if(!e&&I.uuid&&(e=I.uuid),!e){console.warn("Can not send destroy: failed to find guid",i);return}const t=new YR(e);A.send("instance-destroyed",t,Zi.Queued)}function kO(i,A){const g=new YR(i);A.send("instance-destroyed",g,Zi.Queued)}function MO(i){i.connection.beginListen("instance-destroyed",A=>{Pl&&console.log("[Remote] Destroyed",i.scene,A);const g=eE(A.guid,i.scene);g&&Ds(g)})}class UO{constructor(A,g){Q(this,"guid");Q(this,"originalGuid");Q(this,"seed");Q(this,"visible");Q(this,"hostData");Q(this,"dontSave");Q(this,"parent");Q(this,"position");Q(this,"rotation");Q(this,"scale");this.originalGuid=A,this.guid=g}}function HR(i,A,g,I){var s;const e=i;if(!e.guid)return console.warn("Can not instantiate: No guid",e),null;if(A.context||(A.context=bg.Current),!A.context)return console.error("Missing network instantiate options / reference to network connection in sync instantiate"),null;const t=A?{...A}:null,{instance:C,seed:o}=mO(e,A);if(C){const n=C;if(n.guid){Pl&&console.log("[Local] new instance","gameobject:",C==null?void 0:C.guid);const B=new UO(e.guid,n.guid);B.seed=o,t&&(t.position&&(B.position={x:t.position.x,y:t.position.y,z:t.position.z}),t.rotation&&(B.rotation={x:t.rotation.x,y:t.rotation.y,z:t.rotation.z,w:t.rotation.w}),t.scale&&(B.scale={x:t.scale.x,y:t.scale.y,z:t.scale.z})),B.position||(B.position={x:n.position.x,y:n.position.y,z:n.position.z}),B.rotation||(B.rotation={x:n.quaternion.x,y:n.quaternion.y,z:n.quaternion.z,w:n.quaternion.w}),B.scale||(B.scale={x:n.scale.x,y:n.scale.y,z:n.scale.z}),B.visible=e.visible,t!=null&&t.parent&&(typeof t.parent=="string"?B.parent=t.parent:B.parent=t.parent.guid),B.hostData=g,I===!1&&(B.dontSave=!0),(s=A==null?void 0:A.context)==null||s.connection.send("new-instance-created",B)}else console.warn("Missing guid, can not send new instance event",n)}return C}function jf(){return Math.random()*9999999}function RO(i){i.connection.beginListen("new-instance-created",async A=>{const g=await NO(A.originalGuid,i.scene);if(!g){console.warn("could not find object that was instantiated: "+A.guid);return}const I=new DC;A.position&&(I.position=new M(A.position.x,A.position.y,A.position.z)),A.rotation&&(I.rotation=new RA(A.rotation.x,A.rotation.y,A.rotation.z,A.rotation.w)),A.scale&&(I.scale=new M(A.scale.x,A.scale.y,A.scale.z)),I.parent=A.parent,A.seed&&(I.idProvider=new fi(A.seed)),I.visible=A.visible,I.context=i,Pl&&i.alias&&console.log("[Remote] instantiate in: "+i.alias);const e=iE(g,I);e&&(A.parent==="scene"&&i.scene.add(e),Pl&&console.log("[Remote] new instance","gameobject:",e==null?void 0:e.guid,g))})}function mO(i,A){const g=jf(),I=A??new DC;I.idProvider=new fi(g);const e=iE(i,I);return{seed:g,instance:e}}const TR={};function FO(i,A){TR[i]=A}async function NO(i,A){const g=TR[i];if(g!=null){const I=await g(i);if(I)return I}return OR(i,A)}function OR(i,A){if(A===null||!i)return null;if(A.guid===i)return A;if(A.children)for(const g of A.children){const I=OR(i,g);if(I)return I}return null}const _R=new Map;function KO(i,A){if(!i)return;if(!A){console.warn("No prototype found",i,i.prototype,i.constructor);return}let g=_R.get(A);g&&g.apply(i)}function JO(i){const A=qO(i.prototype);_R.set(i,A)}function qO(i){return new LO(i)}class LO{constructor(A){Q(this,"$symbol");Q(this,"extensions");Q(this,"descriptors");this.$symbol=Symbol("prototype-extension"),this.extensions=Object.keys(A),this.descriptors=new Array;for(let g=0;g<this.extensions.length;g++){const I=this.extensions[g],e=Object.getOwnPropertyDescriptor(A,I);e&&this.descriptors.push(e)}}apply(A){if(!A[this.$symbol]){A[this.$symbol]=!0;for(let g=0;g<this.extensions.length;g++){const I=this.extensions[g],e=this.descriptors[g];e&&Object.defineProperty(A,I,e)}}}}const bO=new Map;var Wl=(i=>(i.Added="component-added",i.Removing="removing-component",i))(Wl||{});function Zf(i,A){const g=bO.get(i);if(g)for(const I of g)I(A)}const zf=cA("debuggetcomponent");function vO(i){return i==null||i.isObject3D?i:i.object&&i.object.isObject3D?i.object:i}function Vf(i,A){if(!i||!i.userData.components)return;const g=i.userData.components.indexOf(A);g<0||(Zf(Wl.Removing,A),A.gameObject=null,i.userData.components.splice(g,1))}function Xf(i,A){const g=Ra(i,A);if(g)return g;const I=new A;return ls(i,I)}const xO=new fi("addComponentIdProvider");function ls(i,A,g=!0){i.userData||(i.userData={}),i.userData.components||(i.userData.components=[]),i.userData.components.push(A),A.gameObject=i,(A.guid===void 0||A.guid==="invalid")&&(A.guid=xO.generateUUID()),Zl(i),xF(A);try{g&&A.__internalAwake&&(Wr(i),A.__internalAwake()),Zf(Wl.Added,A)}catch(I){console.error(I)}return A}function PR(i,A){if(A.gameObject!==i){if(A.gameObject&&A.gameObject.userData.components){const g=A.gameObject.userData.components.indexOf(A);A.gameObject.userData.components.splice(g,1)}if(!i.userData.components)i.userData.components=[];else if(i.userData.components.includes(A))return;i.userData.components.push(A),A.gameObject=i}}function WR(i){if(i.gameObject&&i.gameObject.userData.components){const A=i.gameObject.userData.components.indexOf(i);i.gameObject.userData.components.splice(A,1)}i.__internalDisable&&i.__internalDisable(),i.onDestroy&&i.onDestroy(),hs(i,i.context??bg.Current),i.__internalDestroy(),i.gameObject=null}let jR=!1;function ZR(i,A,g){var I;if(i!=null){if(!i.isObject3D){console.error("Object is not object3D");return}if(!((I=i==null?void 0:i.userData)!=null&&I.components))return null;if(typeof A=="string"&&(jR||(jR=!0,console.warn(`Accessing components by name is not supported.
|
|
3256
3256
|
Please use the component type instead. This may keep working in local development but it will fail when bundling your application.
|
|
3257
3257
|
|
|
3258
3258
|
You can import other modules your main module to get access to types
|
|
@@ -223,7 +223,8 @@ export function updateIsActive(obj) {
|
|
|
223
223
|
console.trace("Invalid call - no current context.");
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
|
-
const
|
|
226
|
+
const activeSelf = isActiveSelf(obj);
|
|
227
|
+
const wasSuccessful = updateIsActiveInHierarchyRecursiveRuntime(obj, activeSelf, true);
|
|
227
228
|
if (!wasSuccessful) {
|
|
228
229
|
console.error("Failed to update active state in hierarchy of \"" + obj.name + "\"", obj);
|
|
229
230
|
console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again).");
|
|
@@ -240,6 +241,8 @@ function updateIsActiveInHierarchyRecursiveRuntime(go, activeInHierarchy, allowE
|
|
|
240
241
|
// IF we update activeInHierarchy within a disabled hierarchy we need to check the parent
|
|
241
242
|
if (activeInHierarchy && go.parent) {
|
|
242
243
|
activeInHierarchy = go.parent[constants.activeInHierarchyFieldName];
|
|
244
|
+
if (activeInHierarchy === undefined)
|
|
245
|
+
activeInHierarchy = true;
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
248
|
const prevActive = go[constants.activeInHierarchyFieldName];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine_mainloop_utils.js","sourceRoot":"","sources":["../../../src/engine/engine_mainloop_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,wBAAwB,CAAC;AAChD,OAAO,KAAK,SAAS,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAY,qBAAqB,EAAE,MAAM,OAAO,CAAC;AAEpE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,MAAM,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAC1C,MAAM,cAAc,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAElD,8DAA8D;AAC9D,4DAA4D;AAC5D,6BAA6B;AAC7B,MAAM,kBAAkB,GAAU,EAAE,CAAC;AAErC,MAAM,UAAU,iBAAiB,CAAC,OAAiB;IAC/C,IAAI,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO;IAC5C,IAAI,KAAK;QACL,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;IAE3K,iGAAiG;IACjG,IAAI,OAAO,CAAC,+BAA+B,CAAC,MAAM,GAAG,CAAC,EAA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.8-pre",
|
|
4
4
|
"description": "Needle Engine is a web-based runtime for 3D apps. It runs on your machine for development, and can be deployed anywhere. It is flexible, extensible, and collaboration and XR come naturally.",
|
|
5
5
|
"main": "dist/needle-engine.umd.cjs",
|
|
6
6
|
"module": "lib/needle-engine.js",
|
package/plugins/vite/drop.js
CHANGED
|
@@ -54,7 +54,7 @@ export const editorConnection = async (command, config, userSettings, pluginsArr
|
|
|
54
54
|
|
|
55
55
|
function createPlugin(isInstalled) {
|
|
56
56
|
return {
|
|
57
|
-
|
|
57
|
+
name: "needle-editor-connection",
|
|
58
58
|
// Setup HMR port for connecting to the editor
|
|
59
59
|
config(config) {
|
|
60
60
|
if (!isInstalled) {
|
package/plugins/vite/poster.js
CHANGED
|
@@ -14,7 +14,7 @@ export const needlePoster = (command) => {
|
|
|
14
14
|
if (command === 'build') return [];
|
|
15
15
|
|
|
16
16
|
return {
|
|
17
|
-
name: '
|
|
17
|
+
name: 'needle-poster',
|
|
18
18
|
configureServer(server) {
|
|
19
19
|
server.ws.on('needle:screenshot', async (data, client) => {
|
|
20
20
|
if(!data?.data){
|
package/plugins/vite/reload.js
CHANGED
|
@@ -36,7 +36,7 @@ export const needleReload = (command, config, userSettings) => {
|
|
|
36
36
|
if (projectConfig?.codegenDirectory?.length) ignorePatterns.push(`${projectConfig?.codegenDirectory}/**/*`);
|
|
37
37
|
|
|
38
38
|
return {
|
|
39
|
-
name: 'reload',
|
|
39
|
+
name: 'needle-reload',
|
|
40
40
|
config(config) {
|
|
41
41
|
if (!config.server) config.server = { watch: { ignored: [] } };
|
|
42
42
|
else if (!config.server.watch) config.server.watch = { ignored: [] };
|
|
@@ -222,7 +222,8 @@ export function updateIsActive(obj?: Object3D) {
|
|
|
222
222
|
console.trace("Invalid call - no current context.");
|
|
223
223
|
return;
|
|
224
224
|
}
|
|
225
|
-
const
|
|
225
|
+
const activeSelf = isActiveSelf(obj);
|
|
226
|
+
const wasSuccessful = updateIsActiveInHierarchyRecursiveRuntime(obj, activeSelf, true);
|
|
226
227
|
if (!wasSuccessful) {
|
|
227
228
|
console.error("Failed to update active state in hierarchy of \"" + obj.name + "\"", obj);
|
|
228
229
|
console.warn(" ↑ this error might be caused by circular references. Please make sure you don't have files with circular references (e.g. one GLB 1 is loading GLB 2 which is then loading GLB 1 again).")
|
|
@@ -240,7 +241,8 @@ function updateIsActiveInHierarchyRecursiveRuntime(go: THREE.Object3D, activeInH
|
|
|
240
241
|
activeInHierarchy = isActive;
|
|
241
242
|
// IF we update activeInHierarchy within a disabled hierarchy we need to check the parent
|
|
242
243
|
if (activeInHierarchy && go.parent) {
|
|
243
|
-
activeInHierarchy = go.parent[constants.activeInHierarchyFieldName]
|
|
244
|
+
activeInHierarchy = go.parent[constants.activeInHierarchyFieldName];
|
|
245
|
+
if(activeInHierarchy === undefined) activeInHierarchy = true;
|
|
244
246
|
}
|
|
245
247
|
}
|
|
246
248
|
|
|
@@ -1,213 +1,213 @@
|
|
|
1
|
-
import { Behaviour, GameObject } from "../Component";
|
|
2
|
-
import { serializeable } from "../../engine/engine_serialization_decorator";
|
|
3
|
-
import { getParam } from "../../engine/engine_utils";
|
|
4
|
-
import { VolumeProfile } from "./VolumeProfile";
|
|
5
|
-
import { EditorModification, IEditorModification as IEditorModificationReceiver } from "../../engine/engine_editor-sync";
|
|
6
|
-
import { PostProcessingHandler } from "./PostProcessingHandler";
|
|
7
|
-
import { PostProcessingEffect } from "./PostProcessingEffect";
|
|
8
|
-
import { VolumeParameter } from "./VolumeParameter";
|
|
9
|
-
import { getEditorModificationCache } from "../../engine/engine_editor-sync";
|
|
10
|
-
import { isDevEnvironment } from "../../engine/debug";
|
|
11
|
-
import { EffectComposer } from "postprocessing";
|
|
12
|
-
|
|
13
|
-
const debug = getParam("debugpost");
|
|
14
|
-
|
|
15
|
-
export class Volume extends Behaviour implements IEditorModificationReceiver {
|
|
16
|
-
|
|
17
|
-
@serializeable(VolumeProfile)
|
|
18
|
-
sharedProfile?: VolumeProfile;
|
|
19
|
-
|
|
20
|
-
private _postprocessing?: PostProcessingHandler;
|
|
21
|
-
private _effects: PostProcessingEffect[] = [];
|
|
22
|
-
|
|
23
|
-
awake() {
|
|
24
|
-
// ensure the profile is initialized
|
|
25
|
-
this.sharedProfile?.init();
|
|
26
|
-
|
|
27
|
-
if (debug) {
|
|
28
|
-
console.log(this);
|
|
29
|
-
console.log("Press P to toggle post processing");
|
|
30
|
-
window.addEventListener("keydown", (e) => {
|
|
31
|
-
if (e.key === "p") {
|
|
32
|
-
console.log("Toggle volume: " + this.name, !this.enabled);
|
|
33
|
-
this.enabled = !this.enabled;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
onDisable() {
|
|
40
|
-
this._postprocessing?.unapply();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
onBeforeRender(): void {
|
|
44
|
-
if (!this.context.isInXR) {
|
|
45
|
-
|
|
46
|
-
if (this.context.composer && (this.context.composer instanceof EffectComposer) === false) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Wait for the first frame to be rendered before creating because then we know we have a camera (issue 135)
|
|
51
|
-
if (this.context.mainCamera) {
|
|
52
|
-
if (!this._postprocessing || !this._postprocessing.isActive) {
|
|
53
|
-
this.apply();
|
|
54
|
-
// TODO: remove this workaround for postprocessing rendering not working correctly when applied for the first time
|
|
55
|
-
this.apply();
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (this.context.composer) {
|
|
60
|
-
this.context.composer.setRenderer(this.context.renderer);
|
|
61
|
-
this.context.composer.setMainScene(this.context.scene);
|
|
62
|
-
if (this.context.mainCamera)
|
|
63
|
-
this.context.composer.setMainCamera(this.context.mainCamera);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
onDestroy(): void {
|
|
69
|
-
this._postprocessing?.dispose();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
private _lastApplyTime?: number;
|
|
73
|
-
private _rapidApplyCount = 0;
|
|
74
|
-
|
|
75
|
-
private apply() {
|
|
76
|
-
if (debug) console.log("Apply PostProcessing", this, this.context.mainCamera?.name);
|
|
77
|
-
|
|
78
|
-
if (isDevEnvironment()) {
|
|
79
|
-
if (this._lastApplyTime !== undefined && Date.now() - this._lastApplyTime < 100) {
|
|
80
|
-
this._rapidApplyCount++;
|
|
81
|
-
if (this._rapidApplyCount === 5)
|
|
82
|
-
console.warn("Detected rapid post processing modifications - this might be a bug", this);
|
|
83
|
-
}
|
|
84
|
-
this._lastApplyTime = Date.now();
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.unapply();
|
|
89
|
-
|
|
90
|
-
this._effects.length = 0;
|
|
91
|
-
// get from profile
|
|
92
|
-
if (this.sharedProfile?.components) {
|
|
93
|
-
this._effects.push(...this.sharedProfile.components);
|
|
94
|
-
}
|
|
95
|
-
// get additional effects
|
|
96
|
-
const additionalComponents = this.gameObject.getComponentsInChildren(PostProcessingEffect);
|
|
97
|
-
if (debug && additionalComponents?.length)
|
|
98
|
-
console.log("Additional", additionalComponents);
|
|
99
|
-
if (additionalComponents) {
|
|
100
|
-
for (const comp of additionalComponents) {
|
|
101
|
-
if (comp.active) this._effects.push(comp);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
if (this._effects.length > 0) {
|
|
106
|
-
if (!this._postprocessing)
|
|
107
|
-
this._postprocessing = new PostProcessingHandler(this.context);
|
|
108
|
-
this._postprocessing.apply(this._effects);
|
|
109
|
-
this._applyPostQueue();
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private unapply() {
|
|
115
|
-
this._postprocessing?.unapply();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
private _applyPostQueue() {
|
|
120
|
-
if (this._modificationQueue) {
|
|
121
|
-
for (const entry of this._modificationQueue.values()) this.onEditorModification(entry);
|
|
122
|
-
this._modificationQueue.clear();
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** called from needle editor sync package if its active */
|
|
127
|
-
onEditorModification(modification: EditorModification): void | boolean | undefined {
|
|
128
|
-
|
|
129
|
-
if (modification.propertyName.startsWith("postprocessing.")) {
|
|
130
|
-
|
|
131
|
-
if (!this._postprocessing) {
|
|
132
|
-
if (!this._modificationQueue) this._modificationQueue = new Map<string, EditorModification>();
|
|
133
|
-
this._modificationQueue.set(modification.propertyName, modification);
|
|
134
|
-
return true;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (!this._effects?.length) return;
|
|
138
|
-
const path = modification.propertyName.split(".");
|
|
139
|
-
if (path.length === 3 || path.length === 4) {
|
|
140
|
-
const componentName = path[1];
|
|
141
|
-
const propertyName = path[2];
|
|
142
|
-
for (const comp of this._effects) {
|
|
143
|
-
if (comp.typeName?.toLowerCase() === componentName.toLowerCase()) {
|
|
144
|
-
|
|
145
|
-
if (propertyName === "active") {
|
|
146
|
-
comp.active = modification.value;
|
|
147
|
-
this.scheduleRecreate();
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// cache the volume parameters
|
|
152
|
-
if (!effectVolumeProperties.has(componentName)) {
|
|
153
|
-
const volumeParameterKeys = new Array<string>();
|
|
154
|
-
effectVolumeProperties.set(componentName, volumeParameterKeys);
|
|
155
|
-
const keys = Object.keys(comp);
|
|
156
|
-
for (const key of keys) {
|
|
157
|
-
const prop = comp[key];
|
|
158
|
-
if (prop instanceof VolumeParameter) {
|
|
159
|
-
volumeParameterKeys.push(key);
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
if (effectVolumeProperties.has(componentName)) {
|
|
165
|
-
const paramName = propertyName.toLowerCase();
|
|
166
|
-
const volumeParameterKeys = effectVolumeProperties.get(componentName)!;
|
|
167
|
-
for (const key of volumeParameterKeys) {
|
|
168
|
-
if (key.toLowerCase() === paramName) {
|
|
169
|
-
const prop = comp[key] as VolumeParameter;
|
|
170
|
-
if (prop instanceof VolumeParameter) {
|
|
171
|
-
const isActiveStateChange = path.length === 4 && path[3] === "active";
|
|
172
|
-
if (isActiveStateChange) {
|
|
173
|
-
prop.overrideState = modification.value;
|
|
174
|
-
this.scheduleRecreate();
|
|
175
|
-
}
|
|
176
|
-
else if (prop && prop.value !== undefined) {
|
|
177
|
-
prop.value = modification.value;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
return;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
console.warn("Unknown modification", propertyName);
|
|
186
|
-
return;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return true;
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
return false;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
private _modificationQueue?: Map<string, EditorModification>;
|
|
197
|
-
|
|
198
|
-
private _recreateId: number = -1;
|
|
199
|
-
private scheduleRecreate() {
|
|
200
|
-
// When the editor modifications come in with changed active effects we want/need to re-create the effects
|
|
201
|
-
// We defer it slightly because multiple active changes could be made and we dont want to recreate the full effect stack multiple times
|
|
202
|
-
const id = ++this._recreateId;
|
|
203
|
-
setTimeout(() => {
|
|
204
|
-
if (id !== this._recreateId) return;
|
|
205
|
-
this.onDisable();
|
|
206
|
-
this.onEnable();
|
|
207
|
-
}, 200);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
/** cached VolumeParameter keys per object */
|
|
213
|
-
const effectVolumeProperties: Map<string, string[]> = new Map<string, string[]>();
|
|
1
|
+
import { Behaviour, GameObject } from "../Component";
|
|
2
|
+
import { serializeable } from "../../engine/engine_serialization_decorator";
|
|
3
|
+
import { getParam } from "../../engine/engine_utils";
|
|
4
|
+
import { VolumeProfile } from "./VolumeProfile";
|
|
5
|
+
import { EditorModification, IEditorModification as IEditorModificationReceiver } from "../../engine/engine_editor-sync";
|
|
6
|
+
import { PostProcessingHandler } from "./PostProcessingHandler";
|
|
7
|
+
import { PostProcessingEffect } from "./PostProcessingEffect";
|
|
8
|
+
import { VolumeParameter } from "./VolumeParameter";
|
|
9
|
+
import { getEditorModificationCache } from "../../engine/engine_editor-sync";
|
|
10
|
+
import { isDevEnvironment } from "../../engine/debug";
|
|
11
|
+
import { EffectComposer } from "postprocessing";
|
|
12
|
+
|
|
13
|
+
const debug = getParam("debugpost");
|
|
14
|
+
|
|
15
|
+
export class Volume extends Behaviour implements IEditorModificationReceiver {
|
|
16
|
+
|
|
17
|
+
@serializeable(VolumeProfile)
|
|
18
|
+
sharedProfile?: VolumeProfile;
|
|
19
|
+
|
|
20
|
+
private _postprocessing?: PostProcessingHandler;
|
|
21
|
+
private _effects: PostProcessingEffect[] = [];
|
|
22
|
+
|
|
23
|
+
awake() {
|
|
24
|
+
// ensure the profile is initialized
|
|
25
|
+
this.sharedProfile?.init();
|
|
26
|
+
|
|
27
|
+
if (debug) {
|
|
28
|
+
console.log(this);
|
|
29
|
+
console.log("Press P to toggle post processing");
|
|
30
|
+
window.addEventListener("keydown", (e) => {
|
|
31
|
+
if (e.key === "p") {
|
|
32
|
+
console.log("Toggle volume: " + this.name, !this.enabled);
|
|
33
|
+
this.enabled = !this.enabled;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
onDisable() {
|
|
40
|
+
this._postprocessing?.unapply();
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
onBeforeRender(): void {
|
|
44
|
+
if (!this.context.isInXR) {
|
|
45
|
+
|
|
46
|
+
if (this.context.composer && (this.context.composer instanceof EffectComposer) === false) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Wait for the first frame to be rendered before creating because then we know we have a camera (issue 135)
|
|
51
|
+
if (this.context.mainCamera) {
|
|
52
|
+
if (!this._postprocessing || !this._postprocessing.isActive) {
|
|
53
|
+
this.apply();
|
|
54
|
+
// TODO: remove this workaround for postprocessing rendering not working correctly when applied for the first time
|
|
55
|
+
this.apply();
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (this.context.composer) {
|
|
60
|
+
this.context.composer.setRenderer(this.context.renderer);
|
|
61
|
+
this.context.composer.setMainScene(this.context.scene);
|
|
62
|
+
if (this.context.mainCamera)
|
|
63
|
+
this.context.composer.setMainCamera(this.context.mainCamera);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
onDestroy(): void {
|
|
69
|
+
this._postprocessing?.dispose();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
private _lastApplyTime?: number;
|
|
73
|
+
private _rapidApplyCount = 0;
|
|
74
|
+
|
|
75
|
+
private apply() {
|
|
76
|
+
if (debug) console.log("Apply PostProcessing", this, this.context.mainCamera?.name);
|
|
77
|
+
|
|
78
|
+
if (isDevEnvironment()) {
|
|
79
|
+
if (this._lastApplyTime !== undefined && Date.now() - this._lastApplyTime < 100) {
|
|
80
|
+
this._rapidApplyCount++;
|
|
81
|
+
if (this._rapidApplyCount === 5)
|
|
82
|
+
console.warn("Detected rapid post processing modifications - this might be a bug", this);
|
|
83
|
+
}
|
|
84
|
+
this._lastApplyTime = Date.now();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
this.unapply();
|
|
89
|
+
|
|
90
|
+
this._effects.length = 0;
|
|
91
|
+
// get from profile
|
|
92
|
+
if (this.sharedProfile?.components) {
|
|
93
|
+
this._effects.push(...this.sharedProfile.components);
|
|
94
|
+
}
|
|
95
|
+
// get additional effects
|
|
96
|
+
const additionalComponents = this.gameObject.getComponentsInChildren(PostProcessingEffect);
|
|
97
|
+
if (debug && additionalComponents?.length)
|
|
98
|
+
console.log("Additional", additionalComponents);
|
|
99
|
+
if (additionalComponents) {
|
|
100
|
+
for (const comp of additionalComponents) {
|
|
101
|
+
if (comp.active) this._effects.push(comp);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (this._effects.length > 0) {
|
|
106
|
+
if (!this._postprocessing)
|
|
107
|
+
this._postprocessing = new PostProcessingHandler(this.context);
|
|
108
|
+
this._postprocessing.apply(this._effects);
|
|
109
|
+
this._applyPostQueue();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
private unapply() {
|
|
115
|
+
this._postprocessing?.unapply();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
private _applyPostQueue() {
|
|
120
|
+
if (this._modificationQueue) {
|
|
121
|
+
for (const entry of this._modificationQueue.values()) this.onEditorModification(entry);
|
|
122
|
+
this._modificationQueue.clear();
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/** called from needle editor sync package if its active */
|
|
127
|
+
onEditorModification(modification: EditorModification): void | boolean | undefined {
|
|
128
|
+
|
|
129
|
+
if (modification.propertyName.startsWith("postprocessing.")) {
|
|
130
|
+
|
|
131
|
+
if (!this._postprocessing) {
|
|
132
|
+
if (!this._modificationQueue) this._modificationQueue = new Map<string, EditorModification>();
|
|
133
|
+
this._modificationQueue.set(modification.propertyName, modification);
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!this._effects?.length) return;
|
|
138
|
+
const path = modification.propertyName.split(".");
|
|
139
|
+
if (path.length === 3 || path.length === 4) {
|
|
140
|
+
const componentName = path[1];
|
|
141
|
+
const propertyName = path[2];
|
|
142
|
+
for (const comp of this._effects) {
|
|
143
|
+
if (comp.typeName?.toLowerCase() === componentName.toLowerCase()) {
|
|
144
|
+
|
|
145
|
+
if (propertyName === "active") {
|
|
146
|
+
comp.active = modification.value;
|
|
147
|
+
this.scheduleRecreate();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// cache the volume parameters
|
|
152
|
+
if (!effectVolumeProperties.has(componentName)) {
|
|
153
|
+
const volumeParameterKeys = new Array<string>();
|
|
154
|
+
effectVolumeProperties.set(componentName, volumeParameterKeys);
|
|
155
|
+
const keys = Object.keys(comp);
|
|
156
|
+
for (const key of keys) {
|
|
157
|
+
const prop = comp[key];
|
|
158
|
+
if (prop instanceof VolumeParameter) {
|
|
159
|
+
volumeParameterKeys.push(key);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (effectVolumeProperties.has(componentName)) {
|
|
165
|
+
const paramName = propertyName.toLowerCase();
|
|
166
|
+
const volumeParameterKeys = effectVolumeProperties.get(componentName)!;
|
|
167
|
+
for (const key of volumeParameterKeys) {
|
|
168
|
+
if (key.toLowerCase() === paramName) {
|
|
169
|
+
const prop = comp[key] as VolumeParameter;
|
|
170
|
+
if (prop instanceof VolumeParameter) {
|
|
171
|
+
const isActiveStateChange = path.length === 4 && path[3] === "active";
|
|
172
|
+
if (isActiveStateChange) {
|
|
173
|
+
prop.overrideState = modification.value;
|
|
174
|
+
this.scheduleRecreate();
|
|
175
|
+
}
|
|
176
|
+
else if (prop && prop.value !== undefined) {
|
|
177
|
+
prop.value = modification.value;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
console.warn("Unknown modification", propertyName);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return true;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
return false;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
private _modificationQueue?: Map<string, EditorModification>;
|
|
197
|
+
|
|
198
|
+
private _recreateId: number = -1;
|
|
199
|
+
private scheduleRecreate() {
|
|
200
|
+
// When the editor modifications come in with changed active effects we want/need to re-create the effects
|
|
201
|
+
// We defer it slightly because multiple active changes could be made and we dont want to recreate the full effect stack multiple times
|
|
202
|
+
const id = ++this._recreateId;
|
|
203
|
+
setTimeout(() => {
|
|
204
|
+
if (id !== this._recreateId) return;
|
|
205
|
+
this.onDisable();
|
|
206
|
+
this.onEnable();
|
|
207
|
+
}, 200);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/** cached VolumeParameter keys per object */
|
|
213
|
+
const effectVolumeProperties: Map<string, string[]> = new Map<string, string[]>();
|