@needle-tools/engine 3.35.0-alpha → 3.35.0-beta
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 +1 -1
- package/dist/needle-engine.js +5 -5
- package/dist/needle-engine.light.js +5 -5
- package/dist/needle-engine.light.min.js +1 -1
- package/dist/needle-engine.light.umd.cjs +64 -64
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +102 -102
- package/package.json +1 -1
- package/src/engine/codegen/register_types.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,7 @@ 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
|
-
## [3.35.0-
|
|
7
|
+
## [3.35.0-beta] - 2023-03-25
|
|
8
8
|
- Add: Support for `transient-pointer` input sources for VisionOS
|
|
9
9
|
- Add: add metadata and intersections to `NEPointerEvent` type. Intersections are filled in from EventSystem. This information can be access via `this.input.addEventListener` or the input event callbacks
|
|
10
10
|
- Change: `ObjectUtils.createPrimitive` now has types strings e.g. `ObjectUtils.createPrimitive("Cube")`
|
package/dist/needle-engine.js
CHANGED
|
@@ -30203,13 +30203,13 @@ class Py {
|
|
|
30203
30203
|
}
|
|
30204
30204
|
r(Py, "eventListeners", /* @__PURE__ */ new Map());
|
|
30205
30205
|
const sT = IA("debugdefines");
|
|
30206
|
-
kE('if(!globalThis[""3.35.0-
|
|
30206
|
+
kE('if(!globalThis[""3.35.0-beta""]) globalThis[""3.35.0-beta""] = "0.0.0";');
|
|
30207
30207
|
kE('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
|
|
30208
|
-
kE('if(!globalThis[""
|
|
30209
|
-
kE('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.35.0-
|
|
30208
|
+
kE('if(!globalThis[""Mon Mar 25 2024 15:03:06 GMT+0100 (Central European Standard Time)""]) globalThis[""Mon Mar 25 2024 15:03:06 GMT+0100 (Central European Standard Time)""] = "unknown";');
|
|
30209
|
+
kE('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.35.0-beta";');
|
|
30210
30210
|
kE('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
30211
|
-
kE('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "
|
|
30212
|
-
const sC = "3.35.0-
|
|
30211
|
+
kE('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Mar 25 2024 15:03:06 GMT+0100 (Central European Standard Time)";');
|
|
30212
|
+
const sC = "3.35.0-beta", OR = "undefined", nT = "Mon Mar 25 2024 15:03:06 GMT+0100 (Central European Standard Time)";
|
|
30213
30213
|
sT && console.log(`Engine version: ${sC} (generator: ${OR})
|
|
30214
30214
|
Project built at ${nT}`);
|
|
30215
30215
|
const Sa = "needle_isActiveInHierarchy", lQ = "builtin_components", Wp = "needle_editor_guid";
|
|
@@ -30203,13 +30203,13 @@ class Vb {
|
|
|
30203
30203
|
}
|
|
30204
30204
|
h(Vb, "eventListeners", /* @__PURE__ */ new Map());
|
|
30205
30205
|
const CU = ne("debugdefines");
|
|
30206
|
-
tp('if(!globalThis[""3.35.0-
|
|
30206
|
+
tp('if(!globalThis[""3.35.0-beta""]) globalThis[""3.35.0-beta""] = "0.0.0";');
|
|
30207
30207
|
tp('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";');
|
|
30208
|
-
tp('if(!globalThis[""
|
|
30209
|
-
tp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.35.0-
|
|
30208
|
+
tp('if(!globalThis[""Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)""]) globalThis[""Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)""] = "unknown";');
|
|
30209
|
+
tp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.35.0-beta";');
|
|
30210
30210
|
tp('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";');
|
|
30211
|
-
tp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "
|
|
30212
|
-
const ql = "3.35.0-
|
|
30211
|
+
tp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)";');
|
|
30212
|
+
const ql = "3.35.0-beta", IT = "undefined", EU = "Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)";
|
|
30213
30213
|
CU && console.log(`Engine version: ${ql} (generator: ${IT})
|
|
30214
30214
|
Project built at ${EU}`);
|
|
30215
30215
|
const rh = "needle_isActiveInHierarchy", Wd = "builtin_components", c0 = "needle_editor_guid";
|
|
@@ -4341,7 +4341,7 @@ void main() {
|
|
|
4341
4341
|
`;a+=r(o);const l=Object.keys(s);let c="";for(let u=0;u<l.length;u++){const d=l[u],p=s[d];if(tg.has(p)){c+="";continue}tg.set(p,!0),c+=d+":"+n(p,o+1),u<l.length-1&&(c+=", "),c.length>=60&&(c+=`
|
|
4342
4342
|
`,c+=r(o),a+=c,c="")}return a+=c,a+=`
|
|
4343
4343
|
}`,a}return s}function r(s){let o="";for(let a=0;a<s;a++)o+=" ";return o}}const iY=ee("nodevlogs");function cn(i,e=Vs.Log){Ra(e,i)}function ji(i){cn(i,Vs.Warn)}function Tk(i){cn(i,Vs.Error)}let sE;function pt(){return iY?!1:sE!==void 0?sE:Ps()}function nY(i){sE=i}const wu=new mu,Hr=new S,Gc=new S,Qi=new Me,Ik={X:new S(1,0,0),Y:new S(0,1,0),Z:new S(0,0,1)},oE={type:"change"},Rk={type:"mouseDown"},Pk={type:"mouseUp",mode:null},Bk={type:"objectChange"};class rY extends ge{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const n=new lE;this._gizmo=n,this.add(n);const r=new hY;this._plane=r,this.add(r);const s=this;function o(y,b){let _=b;Object.defineProperty(s,y,{get:function(){return _!==void 0?_:b},set:function(E){_!==E&&(_=E,r[y]=E,n[y]=E,s.dispatchEvent({type:y+"-changed",value:E}),s.dispatchEvent(oE))}}),s[y]=b,r[y]=b,n[y]=b}o("camera",e),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const a=new S,l=new S,c=new Me,u=new Me,d=new S,p=new Me,f=new S,m=new S,A=new S,v=0,g=new S;o("worldPosition",a),o("worldPositionStart",l),o("worldQuaternion",c),o("worldQuaternionStart",u),o("cameraPosition",d),o("cameraQuaternion",p),o("pointStart",f),o("pointEnd",m),o("rotationAxis",A),o("rotationAngle",v),o("eye",g),this._offset=new S,this._startNorm=new S,this._endNorm=new S,this._cameraScale=new S,this._parentPosition=new S,this._parentQuaternion=new Me,this._parentQuaternionInv=new Me,this._parentScale=new S,this._worldScaleStart=new S,this._worldQuaternionInv=new Me,this._worldScale=new S,this._positionStart=new S,this._quaternionStart=new Me,this._scaleStart=new S,this._getPointer=sY.bind(this),this._onPointerDown=aY.bind(this),this._onPointerHover=oY.bind(this),this._onPointerMove=lY.bind(this),this._onPointerUp=cY.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;e!==null&&wu.setFromCamera(e,this.camera);const t=aE(this._gizmo.picker[this.mode],wu);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e!=null&&e.button!==0)&&this.axis!==null){e!==null&&wu.setFromCamera(e,this.camera);const t=aE(this._plane,wu,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,Rk.mode=this.mode,this.dispatchEvent(Rk)}}pointerMove(e){const t=this.axis,n=this.mode,r=this.object;let s=this.space;if(n==="scale"?s="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(s="world"),r===void 0||t===null||this.dragging===!1||e!==null&&e.button!==-1)return;e!==null&&wu.setFromCamera(e,this.camera);const o=aE(this._plane,wu,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),n==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),s==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),s==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),r.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(s==="local"&&(r.position.applyQuaternion(Qi.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.position.applyQuaternion(this._quaternionStart)),s==="world"&&(r.parent&&r.position.add(Hr.setFromMatrixPosition(r.parent.matrixWorld)),t.search("X")!==-1&&(r.position.x=Math.round(r.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(r.position.y=Math.round(r.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(r.position.z=Math.round(r.position.z/this.translationSnap)*this.translationSnap),r.parent&&r.position.sub(Hr.setFromMatrixPosition(r.parent.matrixWorld))));else if(n==="scale"){if(t.search("XYZ")!==-1){let a=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(a*=-1),Gc.set(a,a,a)}else Hr.copy(this.pointStart),Gc.copy(this.pointEnd),Hr.applyQuaternion(this._worldQuaternionInv),Gc.applyQuaternion(this._worldQuaternionInv),Gc.divide(Hr),t.search("X")===-1&&(Gc.x=1),t.search("Y")===-1&&(Gc.y=1),t.search("Z")===-1&&(Gc.z=1);r.scale.copy(this._scaleStart).multiply(Gc),this.scaleSnap&&(t.search("X")!==-1&&(r.scale.x=Math.round(r.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(r.scale.y=Math.round(r.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(r.scale.z=Math.round(r.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(n==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const a=20/this.worldPosition.distanceTo(Hr.setFromMatrixPosition(this.camera.matrixWorld));let l=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Hr.copy(this.rotationAxis).cross(this.eye))*a):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Ik[t]),Hr.copy(Ik[t]),s==="local"&&Hr.applyQuaternion(this.worldQuaternion),Hr.cross(this.eye),Hr.length()===0?l=!0:this.rotationAngle=this._offset.dot(Hr.normalize())*a),(t==="E"||l)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),s==="local"&&t!=="E"&&t!=="XYZE"?(r.quaternion.copy(this._quaternionStart),r.quaternion.multiply(Qi.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),r.quaternion.copy(Qi.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),r.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(oE),this.dispatchEvent(Bk)}}pointerUp(e){e!==null&&e.button!==0||(this.dragging&&this.axis!==null&&(Pk.mode=this.mode,this.dispatchEvent(Pk)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(oE),this.dispatchEvent(Bk),this.pointStart.copy(this.pointEnd))}getRaycaster(){return wu}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function sY(i){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:i.button};{const e=this.domElement.getBoundingClientRect();return{x:(i.clientX-e.left)/e.width*2-1,y:-(i.clientY-e.top)/e.height*2+1,button:i.button}}}function oY(i){if(this.enabled)switch(i.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(i));break}}function aY(i){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(i.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(i)),this.pointerDown(this._getPointer(i)))}function lY(i){this.enabled&&this.pointerMove(this._getPointer(i))}function cY(i){this.enabled&&(this.domElement.releasePointerCapture(i.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(i)))}function aE(i,e,t){const n=e.intersectObject(i,!0);for(let r=0;r<n.length;r++)if(n[r].object.visible||t)return n[r];return!1}const Zy=new Li,Mi=new S(0,1,0),Dk=new S(0,0,0),Ok=new Ee,$y=new Me,eb=new Me,Ba=new S,kk=new Ee,ig=new S(1,0,0),Su=new S(0,1,0),ng=new S(0,0,1),tb=new S,rg=new S,sg=new S;class lE extends ge{constructor(){super(),this.isTransformControlsGizmo=!0,this.type="TransformControlsGizmo";const e=new ii({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),t=new mn({depthTest:!1,depthWrite:!1,fog:!1,toneMapped:!1,transparent:!0}),n=e.clone();n.opacity=.15;const r=t.clone();r.opacity=.5;const s=e.clone();s.color.setHex(16711680);const o=e.clone();o.color.setHex(65280);const a=e.clone();a.color.setHex(255);const l=e.clone();l.color.setHex(16711680),l.opacity=.5;const c=e.clone();c.color.setHex(65280),c.opacity=.5;const u=e.clone();u.color.setHex(255),u.opacity=.5;const d=e.clone();d.opacity=.25;const p=e.clone();p.color.setHex(16776960),p.opacity=.25,e.clone().color.setHex(16776960);const f=e.clone();f.color.setHex(7895160);const m=new wn(0,.04,.1,12);m.translate(0,.05,0);const A=new Bi(.08,.08,.08);A.translate(0,.04,0);const v=new yt;v.setAttribute("position",new ot([0,0,0,1,0,0],3));const g=new wn(.0075,.0075,.5,3);g.translate(0,.25,0);function y(k,W){const U=new Ac(k,.0075,3,64,W*Math.PI*2);return U.rotateY(Math.PI/2),U.rotateX(Math.PI/2),U}function b(){const k=new yt;return k.setAttribute("position",new ot([0,0,0,1,1,1],3)),k}const _={X:[[new me(m,s),[.5,0,0],[0,0,-Math.PI/2]],[new me(m,s),[-.5,0,0],[0,0,Math.PI/2]],[new me(g,s),[0,0,0],[0,0,-Math.PI/2]]],Y:[[new me(m,o),[0,.5,0]],[new me(m,o),[0,-.5,0],[Math.PI,0,0]],[new me(g,o)]],Z:[[new me(m,a),[0,0,.5],[Math.PI/2,0,0]],[new me(m,a),[0,0,-.5],[-Math.PI/2,0,0]],[new me(g,a),null,[Math.PI/2,0,0]]],XYZ:[[new me(new vc(.1,0),d.clone()),[0,0,0]]],XY:[[new me(new Bi(.15,.15,.01),u.clone()),[.15,.15,0]]],YZ:[[new me(new Bi(.15,.15,.01),l.clone()),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Bi(.15,.15,.01),c.clone()),[.15,0,.15],[-Math.PI/2,0,0]]]},E={X:[[new me(new wn(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new me(new wn(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new me(new wn(.2,0,.6,4),n),[0,.3,0]],[new me(new wn(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new me(new wn(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new me(new wn(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XYZ:[[new me(new vc(.2,0),n)]],XY:[[new me(new Bi(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new me(new Bi(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Bi(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]]},I={START:[[new me(new vc(.01,2),r),null,null,null,"helper"]],END:[[new me(new vc(.01,2),r),null,null,null,"helper"]],DELTA:[[new gn(b(),r),null,null,null,"helper"]],X:[[new gn(v,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gn(v,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gn(v,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},M={XYZE:[[new me(y(.5,1),f),null,[0,Math.PI/2,0]]],X:[[new me(y(.5,.5),s)]],Y:[[new me(y(.5,.5),o),null,[0,0,-Math.PI/2]]],Z:[[new me(y(.5,.5),a),null,[0,Math.PI/2,0]]],E:[[new me(y(.75,1),p),null,[0,Math.PI/2,0]]]},T={AXIS:[[new gn(v,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},D={XYZE:[[new me(new va(.25,10,8),n)]],X:[[new me(new Ac(.5,.1,4,24),n),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new me(new Ac(.5,.1,4,24),n),[0,0,0],[Math.PI/2,0,0]]],Z:[[new me(new Ac(.5,.1,4,24),n),[0,0,0],[0,0,-Math.PI/2]]],E:[[new me(new Ac(.75,.1,2,24),n)]]},C={X:[[new me(A,s),[.5,0,0],[0,0,-Math.PI/2]],[new me(g,s),[0,0,0],[0,0,-Math.PI/2]],[new me(A,s),[-.5,0,0],[0,0,Math.PI/2]]],Y:[[new me(A,o),[0,.5,0]],[new me(g,o)],[new me(A,o),[0,-.5,0],[0,0,Math.PI]]],Z:[[new me(A,a),[0,0,.5],[Math.PI/2,0,0]],[new me(g,a),[0,0,0],[Math.PI/2,0,0]],[new me(A,a),[0,0,-.5],[-Math.PI/2,0,0]]],XY:[[new me(new Bi(.15,.15,.01),u),[.15,.15,0]]],YZ:[[new me(new Bi(.15,.15,.01),l),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Bi(.15,.15,.01),c),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new me(new Bi(.1,.1,.1),d.clone())]]},P={X:[[new me(new wn(.2,0,.6,4),n),[.3,0,0],[0,0,-Math.PI/2]],[new me(new wn(.2,0,.6,4),n),[-.3,0,0],[0,0,Math.PI/2]]],Y:[[new me(new wn(.2,0,.6,4),n),[0,.3,0]],[new me(new wn(.2,0,.6,4),n),[0,-.3,0],[0,0,Math.PI]]],Z:[[new me(new wn(.2,0,.6,4),n),[0,0,.3],[Math.PI/2,0,0]],[new me(new wn(.2,0,.6,4),n),[0,0,-.3],[-Math.PI/2,0,0]]],XY:[[new me(new Bi(.2,.2,.01),n),[.15,.15,0]]],YZ:[[new me(new Bi(.2,.2,.01),n),[0,.15,.15],[0,Math.PI/2,0]]],XZ:[[new me(new Bi(.2,.2,.01),n),[.15,0,.15],[-Math.PI/2,0,0]]],XYZ:[[new me(new Bi(.2,.2,.2),n),[0,0,0]]]},Q={X:[[new gn(v,r.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new gn(v,r.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new gn(v,r.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]};function G(k){const W=new ge;for(const U in k)for(let F=k[U].length;F--;){const z=k[U][F][0].clone(),Z=k[U][F][1],K=k[U][F][2],re=k[U][F][3],Ae=k[U][F][4];z.name=U,z.tag=Ae,Z&&z.position.set(Z[0],Z[1],Z[2]),K&&z.rotation.set(K[0],K[1],K[2]),re&&z.scale.set(re[0],re[1],re[2]),z.updateMatrix();const Re=z.geometry.clone();Re.applyMatrix4(z.matrix),z.geometry=Re,z.renderOrder=1/0,z.position.set(0,0,0),z.rotation.set(0,0,0),z.scale.set(1,1,1),W.add(z)}return W}this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=G(_)),this.add(this.gizmo.rotate=G(M)),this.add(this.gizmo.scale=G(C)),this.add(this.picker.translate=G(E)),this.add(this.picker.rotate=G(D)),this.add(this.picker.scale=G(P)),this.add(this.helper.translate=G(I)),this.add(this.helper.rotate=G(T)),this.add(this.helper.scale=G(Q)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}updateMatrixWorld(e){const t=(this.mode==="scale"?"local":this.space)==="local"?this.worldQuaternion:eb;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let n=[];n=n.concat(this.picker[this.mode].children),n=n.concat(this.gizmo[this.mode].children),n=n.concat(this.helper[this.mode].children);for(let r=0;r<n.length;r++){const s=n[r];s.visible=!0,s.rotation.set(0,0,0),s.position.copy(this.worldPosition);let o;if(this.camera.isOrthographicCamera?o=(this.camera.top-this.camera.bottom)/this.camera.zoom:o=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),s.scale.set(1,1,1).multiplyScalar(o*this.size/4),s.tag==="helper"){s.visible=!1,s.name==="AXIS"?(s.visible=!!this.axis,this.axis==="X"&&(Qi.setFromEuler(Zy.set(0,0,0)),s.quaternion.copy(t).multiply(Qi),Math.abs(Mi.copy(ig).applyQuaternion(t).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Y"&&(Qi.setFromEuler(Zy.set(0,0,Math.PI/2)),s.quaternion.copy(t).multiply(Qi),Math.abs(Mi.copy(Su).applyQuaternion(t).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="Z"&&(Qi.setFromEuler(Zy.set(0,Math.PI/2,0)),s.quaternion.copy(t).multiply(Qi),Math.abs(Mi.copy(ng).applyQuaternion(t).dot(this.eye))>.9&&(s.visible=!1)),this.axis==="XYZE"&&(Qi.setFromEuler(Zy.set(0,Math.PI/2,0)),Mi.copy(this.rotationAxis),s.quaternion.setFromRotationMatrix(Ok.lookAt(Dk,Mi,Su)),s.quaternion.multiply(Qi),s.visible=this.dragging),this.axis==="E"&&(s.visible=!1)):s.name==="START"?(s.position.copy(this.worldPositionStart),s.visible=this.dragging):s.name==="END"?(s.position.copy(this.worldPosition),s.visible=this.dragging):s.name==="DELTA"?(s.position.copy(this.worldPositionStart),s.quaternion.copy(this.worldQuaternionStart),Hr.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Hr.applyQuaternion(this.worldQuaternionStart.clone().invert()),s.scale.copy(Hr),s.visible=this.dragging):(s.quaternion.copy(t),this.dragging?s.position.copy(this.worldPositionStart):s.position.copy(this.worldPosition),this.axis&&(s.visible=this.axis.search(s.name)!==-1));continue}s.quaternion.copy(t),this.mode==="translate"||this.mode==="scale"?(s.name==="X"&&Math.abs(Mi.copy(ig).applyQuaternion(t).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Y"&&Math.abs(Mi.copy(Su).applyQuaternion(t).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="Z"&&Math.abs(Mi.copy(ng).applyQuaternion(t).dot(this.eye))>.99&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XY"&&Math.abs(Mi.copy(ng).applyQuaternion(t).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="YZ"&&Math.abs(Mi.copy(ig).applyQuaternion(t).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1),s.name==="XZ"&&Math.abs(Mi.copy(Su).applyQuaternion(t).dot(this.eye))<.2&&(s.scale.set(1e-10,1e-10,1e-10),s.visible=!1)):this.mode==="rotate"&&($y.copy(t),Mi.copy(this.eye).applyQuaternion(Qi.copy(t).invert()),s.name.search("E")!==-1&&s.quaternion.setFromRotationMatrix(Ok.lookAt(this.eye,Dk,Su)),s.name==="X"&&(Qi.setFromAxisAngle(ig,Math.atan2(-Mi.y,Mi.z)),Qi.multiplyQuaternions($y,Qi),s.quaternion.copy(Qi)),s.name==="Y"&&(Qi.setFromAxisAngle(Su,Math.atan2(Mi.x,Mi.z)),Qi.multiplyQuaternions($y,Qi),s.quaternion.copy(Qi)),s.name==="Z"&&(Qi.setFromAxisAngle(ng,Math.atan2(Mi.y,Mi.x)),Qi.multiplyQuaternions($y,Qi),s.quaternion.copy(Qi))),s.visible=s.visible&&(s.name.indexOf("X")===-1||this.showX),s.visible=s.visible&&(s.name.indexOf("Y")===-1||this.showY),s.visible=s.visible&&(s.name.indexOf("Z")===-1||this.showZ),s.visible=s.visible&&(s.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),s.material._color=s.material._color||s.material.color.clone(),s.material._opacity=s.material._opacity||s.material.opacity,s.material.color.copy(s.material._color),s.material.opacity=s.material._opacity,this.enabled&&this.axis&&(s.name===this.axis||this.axis.split("").some(function(a){return s.name===a}))&&(s.material.color.setHex(16776960),s.material.opacity=1)}super.updateMatrixWorld(e)}}class hY extends me{constructor(){super(new Ln(1e5,1e5,2,2),new ii({visible:!1,wireframe:!0,side:hi,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),tb.copy(ig).applyQuaternion(t==="local"?this.worldQuaternion:eb),rg.copy(Su).applyQuaternion(t==="local"?this.worldQuaternion:eb),sg.copy(ng).applyQuaternion(t==="local"?this.worldQuaternion:eb),Mi.copy(rg),this.mode){case"translate":case"scale":switch(this.axis){case"X":Mi.copy(this.eye).cross(tb),Ba.copy(tb).cross(Mi);break;case"Y":Mi.copy(this.eye).cross(rg),Ba.copy(rg).cross(Mi);break;case"Z":Mi.copy(this.eye).cross(sg),Ba.copy(sg).cross(Mi);break;case"XY":Ba.copy(sg);break;case"YZ":Ba.copy(tb);break;case"XZ":Mi.copy(sg),Ba.copy(rg);break;case"XYZ":case"E":Ba.set(0,0,0);break}break;case"rotate":default:Ba.set(0,0,0)}Ba.length()===0?this.quaternion.copy(this.cameraQuaternion):(kk.lookAt(Hr.set(0,0,0),Ba,Mi),this.quaternion.setFromRotationMatrix(kk)),super.updateMatrixWorld(e)}}const uY=ee("debugpatch");function ib(i,e,t,n){const r=uY===e;if(!t&&!n)return;const s=e+"___needle";pY(i,e,t,n);const o=Object.getOwnPropertyDescriptor(i,e),a=i[e];r&&console.log("Patch",i.constructor.name,e,o,a),o?(r&&console.log("Apply patch with existing descriptor",i.constructor.name,e,o),typeof o.value=="function"&&(i[e]=Uk(o.value,i,e))):(r&&console.log("Create patch with new property",i.constructor.name,e,o),Object.defineProperty(i,e,{set:function(l){if(typeof l=="function")this[s]=Uk(l,i,e);else{const c=this[s];Fk(i,e,this,c,l),this[s]=l,Nk(i,e,this,c,l)}},get:function(){const l=this[s];return typeof l=="function"&&l[s]?l[s]:l}}))}function dY(i,e,t){const n=hE(i,e);if(n)for(let r=n.length-1;r>=0;r--){const s=n[r];s.prefix===t&&(s.prefix=null),s.postfix===t&&(s.postfix=null),!s.prefix&&!s.postfix&&n.splice(r,1)}}const Lk=Symbol("Needle:Patches:WrappedFunction");function Uk(i,e,t){if(i[Lk])return i;const n=function(...r){Fk(e,t,this,...r);const s=i.apply(this,r);return Nk(e,t,this,s,...r),s};return n[Lk]=!0,n}const nb="Needle:Patches";function cE(){return globalThis[nb]||(globalThis[nb]=new WeakMap),globalThis[nb]}function hE(i,e){const t=cE().get(i);return t?t.get(e):null}function pY(i,e,t,n){let r=cE().get(i);r||(r=new Map,cE().set(i,r));let s=r.get(e);s||(s=[],r.set(e,s)),s.push({prefix:t,postfix:n})}function Fk(i,e,t,...n){var r;if(!t)return;const s=hE(i,e);if(s)for(const o of s)(r=o.prefix)==null||r.call(t,...n)}function Nk(i,e,t,n,...r){var s;if(!t)return;const o=hE(i,e);if(o)for(const a of o)(s=a.postfix)==null||s.call(t,n,...r)}const zk=Symbol("gltf-loader-internal-usage-tracker"),fY=ee("debugusers"),rb=class{constructor(i){h(this,"parser"),h(this,"_getDependency"),h(this,"_loadingId"),h(this,"_loadedObjects",new Set),this.parser=i,this._getDependency=this.parser.getDependency,this._loadingId=Date.now().toString()}get name(){return"NEEDLE_internal_usage_tracker"}static isLoading(i){return rb._loadingProcesses>0}beforeRoot(){rb._loadingProcesses++;const i=this,e=this._getDependency;return this.parser.getDependency=function(t,n){const r=e.call(this,t,n);return r.then(s=>(s&&(i._loadedObjects.add(s),s[zk]=i._loadingId),s)),r},null}afterRoot(i){rb._loadingProcesses--,this.parser.getDependency=this._getDependency;for(const e of this._loadedObjects)delete e[zk],e instanceof ge&&(e.parent||e instanceof me&&(fY&&console.warn("> GLTF LOADER: Mesh not used in scene!",e),e.material=null,e.geometry=null));return null}};let uE=rb;h(uE,"_loadingProcesses",0);class jk{constructor(){window.addEventListener("unhandledrejection",e=>{var t;if(e.defaultPrevented)return;const n=(t=e?.reason)==null?void 0:t.path;if(n){const r=n[0];r&&r.tagName==="IMG"&&(console.warn(`Could not load image:
|
|
4344
|
-
`+r.src),e.preventDefault())}})}}const sb=ee("trackresources");function Qk(){return sb==="dispose"}let Cu=!0;sb===0&&(Cu=!1);function mY(i){Cu=i}function Gk(){return Cu}const Hk=Symbol("disposable");function dE(i,e){i&&(i[Hk]=e,Eu&&console.warn("Set disposable",e,i))}const Vk=Symbol("disposed");function gY(i){return i[Vk]===!0}function Ii(i){var e;if(i){if(i[Hk]===!1){Eu&&console.warn("Object is marked as not disposable",i);return}if(i[Vk]=!0,i instanceof jr)Ii(i.environment),Ii(i.background),Ii(i.customDepthMaterial),Ii(i.customDistanceMaterial);else if(i instanceof Ko)Ii(i.geometry),Ii(i.material),Ii(i.skeleton),Ii(i.bindMatrix),Ii(i.bindMatrixInverse),Ii(i.customDepthMaterial),Ii(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof me)Ii(i.geometry),Ii(i.material),Ii(i.customDepthMaterial),Ii(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof yt){wp(i);for(const t of Object.keys(i.attributes)){const n=i.attributes[t];Ii(n)}}else if(i instanceof $e||i instanceof xs)Eu&&console.warn("BufferAttribute dispose not supported",i.count);else if(i instanceof Array)for(const t of i)t instanceof Ot&&Ii(t);else if(i instanceof Ot){wp(i);for(const n of Object.keys(i)){const r=i[n];r instanceof Tt&&(Ii(r),i[n]=null)}const t=i.uniforms;if(t)for(const n of Object.keys(t)){const r=t[n];r instanceof Tt?(Ii(r),t[n]=null):r instanceof be&&(Ii(r.value),r.value=null)}}else i instanceof Tt?(wp(i),wp(i.source),((e=i.source)==null?void 0:e.data)instanceof ImageBitmap&&wp(i.source.data)):i instanceof Wf?(wp(i.boneTexture),i.boneTexture=null):i instanceof Tm||!(i instanceof ge)&&Eu&&console.warn("Unknown object type",i)}}function wp(i){i&&((Eu||Qk()||sb)&&console.warn("\u{1F9E8} FREE",i),i instanceof ImageBitmap?i.close():i instanceof _l?i.data=null:i.dispose())}function Wk(i){(i instanceof me||i instanceof Ko)&&(i.material=null,i.geometry=null)}const vY=new Set;function pE(i,e,t=null,n){if(n||(n=vY,n.clear()),!i)return n;const r=i[og];if(r)for(const s of r)n.has(s)||t?.call(null,s)!==!1&&(n.add(s),e&&pE(s,!0,t,n));return n}function AY(i){return i[ag]}const Eu=ee("debugresourceusers")||ee("debugmemory"),og=Symbol("needle-resource-users"),ag=Symbol("needle-resource-users-count");function as(i,e){ib(i,e,function(t,n){Cu&&(ob(og,this,t,!1),ob(og,this,n,!0))})}Cu&&(as(me.prototype,"material"),as(me.prototype,"geometry"),as(Ot.prototype,"map"),as(Ot.prototype,"bumpMap"),as(Ot.prototype,"alphaMap"),as(Ot.prototype,"normalMap"),as(Ot.prototype,"displacementMap"),as(Ot.prototype,"roughnessMap"),as(Ot.prototype,"metalnessMap"),as(Ot.prototype,"emissiveMap"),as(Ot.prototype,"specularMap"),as(Ot.prototype,"envMap"),as(Ot.prototype,"lightMap"),as(Ot.prototype,"aoMap"),as(Ot.prototype,"gradientMap"));function yY(i){if(Cu===!1)return;const e=i[og];if(e)for(const t of e)ob(og,t,i,!1)}Cu&&ib(Ot.prototype,"dispose",function(){yY(this)});let fE=0;function ob(i,e,t,n){if(fE>0)return;if(Array.isArray(t)){for(const s of t)ob(i,e,s,n);return}if(!t)return;let r=t[i];if(r||(r=new Set),n){if(e&&!r.has(e)){r.add(e);let s=t[ag]||0;s+=1,t[ag]=s,Eu&&console.warn(`\u{1F7E2} Added user of "${t.type}"`,e,t,s,"users:",r)}}else if(e&&r.has(e)){r.delete(e);let s=t[ag]||0;s>0&&(s-=1,t[ag]=s),Eu&&console.warn(`\u{1F534} Removed user of "${t.type}"`,e,t,s,"users:",r),s<=0&&(uE.isLoading(t)||(sb&&console.warn(`\u{1F534} Removed all user of "${t.type}"`,t),Qk()&&Ii(t)))}t[i]=r}try{ib(Il.prototype,"render",function(){fE++},function(){fE--})}catch(i){console.warn("Could not wrap WebGLRenderer.render",i)}var lg=(i=>(i.Added="component-added",i.Removing="removing-component",i))(lg||{});const qk=ee("debugcomponentevents");class cg{static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let n=this.eventListeners.get(e);n||(n=[]),n.push(t),this.eventListeners.set(e,n),qk&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const n=this.eventListeners.get(e);if(!n)return;const r=n.indexOf(t);r<0||n.splice(r,1)}static dispatchComponentLifecycleEvent(e,t){const n=this.eventListeners.get(e);if(qk&&console.log("Dispatching event "+e,n),!!n)for(const r of n)r(t)}}h(cg,"eventListeners",new Map);const Xk=ee("debugdefines");Sp('if(!globalThis[""3.35.0-
|
|
4344
|
+
`+r.src),e.preventDefault())}})}}const sb=ee("trackresources");function Qk(){return sb==="dispose"}let Cu=!0;sb===0&&(Cu=!1);function mY(i){Cu=i}function Gk(){return Cu}const Hk=Symbol("disposable");function dE(i,e){i&&(i[Hk]=e,Eu&&console.warn("Set disposable",e,i))}const Vk=Symbol("disposed");function gY(i){return i[Vk]===!0}function Ii(i){var e;if(i){if(i[Hk]===!1){Eu&&console.warn("Object is marked as not disposable",i);return}if(i[Vk]=!0,i instanceof jr)Ii(i.environment),Ii(i.background),Ii(i.customDepthMaterial),Ii(i.customDistanceMaterial);else if(i instanceof Ko)Ii(i.geometry),Ii(i.material),Ii(i.skeleton),Ii(i.bindMatrix),Ii(i.bindMatrixInverse),Ii(i.customDepthMaterial),Ii(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof me)Ii(i.geometry),Ii(i.material),Ii(i.customDepthMaterial),Ii(i.customDistanceMaterial),i.geometry=null,i.material=null;else if(i instanceof yt){wp(i);for(const t of Object.keys(i.attributes)){const n=i.attributes[t];Ii(n)}}else if(i instanceof $e||i instanceof xs)Eu&&console.warn("BufferAttribute dispose not supported",i.count);else if(i instanceof Array)for(const t of i)t instanceof Ot&&Ii(t);else if(i instanceof Ot){wp(i);for(const n of Object.keys(i)){const r=i[n];r instanceof Tt&&(Ii(r),i[n]=null)}const t=i.uniforms;if(t)for(const n of Object.keys(t)){const r=t[n];r instanceof Tt?(Ii(r),t[n]=null):r instanceof be&&(Ii(r.value),r.value=null)}}else i instanceof Tt?(wp(i),wp(i.source),((e=i.source)==null?void 0:e.data)instanceof ImageBitmap&&wp(i.source.data)):i instanceof Wf?(wp(i.boneTexture),i.boneTexture=null):i instanceof Tm||!(i instanceof ge)&&Eu&&console.warn("Unknown object type",i)}}function wp(i){i&&((Eu||Qk()||sb)&&console.warn("\u{1F9E8} FREE",i),i instanceof ImageBitmap?i.close():i instanceof _l?i.data=null:i.dispose())}function Wk(i){(i instanceof me||i instanceof Ko)&&(i.material=null,i.geometry=null)}const vY=new Set;function pE(i,e,t=null,n){if(n||(n=vY,n.clear()),!i)return n;const r=i[og];if(r)for(const s of r)n.has(s)||t?.call(null,s)!==!1&&(n.add(s),e&&pE(s,!0,t,n));return n}function AY(i){return i[ag]}const Eu=ee("debugresourceusers")||ee("debugmemory"),og=Symbol("needle-resource-users"),ag=Symbol("needle-resource-users-count");function as(i,e){ib(i,e,function(t,n){Cu&&(ob(og,this,t,!1),ob(og,this,n,!0))})}Cu&&(as(me.prototype,"material"),as(me.prototype,"geometry"),as(Ot.prototype,"map"),as(Ot.prototype,"bumpMap"),as(Ot.prototype,"alphaMap"),as(Ot.prototype,"normalMap"),as(Ot.prototype,"displacementMap"),as(Ot.prototype,"roughnessMap"),as(Ot.prototype,"metalnessMap"),as(Ot.prototype,"emissiveMap"),as(Ot.prototype,"specularMap"),as(Ot.prototype,"envMap"),as(Ot.prototype,"lightMap"),as(Ot.prototype,"aoMap"),as(Ot.prototype,"gradientMap"));function yY(i){if(Cu===!1)return;const e=i[og];if(e)for(const t of e)ob(og,t,i,!1)}Cu&&ib(Ot.prototype,"dispose",function(){yY(this)});let fE=0;function ob(i,e,t,n){if(fE>0)return;if(Array.isArray(t)){for(const s of t)ob(i,e,s,n);return}if(!t)return;let r=t[i];if(r||(r=new Set),n){if(e&&!r.has(e)){r.add(e);let s=t[ag]||0;s+=1,t[ag]=s,Eu&&console.warn(`\u{1F7E2} Added user of "${t.type}"`,e,t,s,"users:",r)}}else if(e&&r.has(e)){r.delete(e);let s=t[ag]||0;s>0&&(s-=1,t[ag]=s),Eu&&console.warn(`\u{1F534} Removed user of "${t.type}"`,e,t,s,"users:",r),s<=0&&(uE.isLoading(t)||(sb&&console.warn(`\u{1F534} Removed all user of "${t.type}"`,t),Qk()&&Ii(t)))}t[i]=r}try{ib(Il.prototype,"render",function(){fE++},function(){fE--})}catch(i){console.warn("Could not wrap WebGLRenderer.render",i)}var lg=(i=>(i.Added="component-added",i.Removing="removing-component",i))(lg||{});const qk=ee("debugcomponentevents");class cg{static addComponentLifecylceEventListener(e,t){this.eventListeners.has(e)&&this.eventListeners.set(e,[]);let n=this.eventListeners.get(e);n||(n=[]),n.push(t),this.eventListeners.set(e,n),qk&&console.log("Added event listener for "+e,this.eventListeners)}static removeComponentLifecylceEventListener(e,t){const n=this.eventListeners.get(e);if(!n)return;const r=n.indexOf(t);r<0||n.splice(r,1)}static dispatchComponentLifecycleEvent(e,t){const n=this.eventListeners.get(e);if(qk&&console.log("Dispatching event "+e,n),!!n)for(const r of n)r(t)}}h(cg,"eventListeners",new Map);const Xk=ee("debugdefines");Sp('if(!globalThis[""3.35.0-beta""]) globalThis[""3.35.0-beta""] = "0.0.0";'),Sp('if(!globalThis[""undefined""]) globalThis[""undefined""] = "unknown";'),Sp('if(!globalThis[""Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)""]) globalThis[""Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)""] = "unknown";'),Sp('globalThis["__NEEDLE_ENGINE_VERSION__"] = "3.35.0-beta";'),Sp('globalThis["__NEEDLE_ENGINE_GENERATOR__"] = "undefined";'),Sp('globalThis["__NEEDLE_PROJECT_BUILD_TIME__"] = "Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)";');const Ll="3.35.0-beta",ab="undefined",mE="Mon Mar 25 2024 15:03:15 GMT+0100 (Central European Standard Time)";Xk&&console.log(`Engine version: ${Ll} (generator: ${ab})
|
|
4345
4345
|
Project built at ${mE}`);const Ul="needle_isActiveInHierarchy",Mu="builtin_components",hg="needle_editor_guid";function Sp(i){try{(0,eval)(i)}catch(e){Xk&&console.error(e)}}const ug=Symbol("NEEDLE_NEED_UPDATE_INSTANCE"),Yk=Symbol("isUsingInstancing"),Jk=Symbol("instancingRenderer"),gE=Symbol("instancingAutoUpdateBounds");class ba{static isUsingInstancing(e){return e[Yk]===!0}static getRenderer(e){return e[Jk]||null}setAutoUpdateBounds(e,t){const n=ba.getRenderer(e);n&&(n[gE]=t)}static markDirty(e,t=!0){if(e&&(this.isUsingInstancing(e)&&(e[ug]=!0,e.matrixWorldNeedsUpdate=!0),t))for(const n of e.children)ba.markDirty(n,!0)}}function Tu(i,e){try{e?i(e):i()}catch(t){return console.error(t),!1}return!0}const vE=ee("debugnewscripts"),bY=ee("debughierarchy"),Gi=[];function _Y(){return Gi.length>0}function lb(i){if(!(i.new_scripts.length<=0)){if(vE&&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 e of i.new_scripts_pre_setup_callbacks)e&&e();i.new_scripts_pre_setup_callbacks.length=0}Gi.length=0,i.new_scripts.length>0&&Gi.push(...i.new_scripts),i.new_scripts.length=0;for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.isComponent!==!0){(pt()||vE)&&console.error(`Registered script is not a Needle Engine component.
|
|
4346
4346
|
The script will be ignored. Please make sure your component extends "Behaviour" imported from "@needle-tools/engine"
|
|
4347
4347
|
`,t),Gi.splice(e,1),e--;continue}if(t.destroyed)continue;if(!t.gameObject){console.error("MISSING GAMEOBJECT - will ignore",t),Gi.splice(e,1),e--;continue}t.context=i,dg(t.gameObject),AE(t,i)}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.destroyed){Fl(Gi[e],i),Gi.splice(e,1),e--;continue}if(t.registering)try{t.registering()}catch(n){console.error(n)}t.__internalAwake!==void 0&&(t.gameObject||console.error("MISSING GAMEOBJECT",t,t.gameObject),dg(t.gameObject),t.activeAndEnabled&&Tu(t.__internalAwake.bind(t)))}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.destroyed||t.enabled===!1||(dg(t.gameObject),t.activeAndEnabled===!1))continue;t.__internalEnable!==void 0&&(t.enabled=!0,Tu(t.__internalEnable.bind(t)))}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}for(let e=0;e<Gi.length;e++)try{const t=Gi[e];if(t.destroyed||!t.gameObject)continue;i.new_script_start.push(t)}catch(t){console.error(t),Fl(Gi[e],i),Gi.splice(e,1),e--}Gi.length=0;for(const e of i.new_scripts_post_setup_callbacks)e&&e();i.new_scripts_post_setup_callbacks.length=0}}function xY(i){i&&(i.__internalDisable(!0),Fl(i,i.context))}function Kk(i,e){for(let t=0;t<i.new_script_start.length;t++)try{const n=i.new_script_start[t];if(e!==void 0&&n.gameObject!==e||n.destroyed||n.activeAndEnabled===!1)continue;Tu(n.__internalAwake.bind(n)),n.enabled&&(Tu(n.__internalEnable.bind(n)),Tu(n.__internalStart.bind(n)),i.new_script_start.splice(t,1),t--)}catch(n){console.error(n),Fl(i.new_script_start[t],i),i.new_script_start.splice(t,1),t--}}function AE(i,e){e.scripts.indexOf(i)===-1&&(e.scripts.push(i),i.earlyUpdate&&e.scripts_earlyUpdate.push(i),i.update&&e.scripts_update.push(i),i.lateUpdate&&e.scripts_lateUpdate.push(i),i.onBeforeRender&&e.scripts_onBeforeRender.push(i),i.onAfterRender&&e.scripts_onAfterRender.push(i),i.onPausedChanged&&e.scripts_pausedChanged.push(i),yE(i,null)&&e.new_scripts_xr.push(i),yE(i,"immersive-vr")&&e.scripts_immersive_vr.push(i),yE(i,"immersive-ar")&&e.scripts_immersive_ar.push(i))}function Fl(i,e){wo(i,e.new_scripts),wo(i,e.new_script_start),wo(i,e.scripts),wo(i,e.scripts_earlyUpdate),wo(i,e.scripts_update),wo(i,e.scripts_lateUpdate),wo(i,e.scripts_onBeforeRender),wo(i,e.scripts_onAfterRender),wo(i,e.scripts_pausedChanged),wo(i,e.new_scripts_xr),wo(i,e.scripts_immersive_vr),wo(i,e.scripts_immersive_ar),e.stopAllCoroutinesFrom(i)}function wo(i,e){const t=e.indexOf(i);t>=0&&e.splice(t,1)}function yE(i,e){var t;if(i){const n=i;if(n.onBeforeXR||n.onEnterXR||n.onUpdateXR||n.onLeaveXR||n.onXRControllerAdded||n.onXRControllerRemoved)return!(e!=null&&((t=n.supportsXR)==null?void 0:t.call(n,e))===!1)}return!1}function cb(i){if(i||(i=li.Current.scene),!i){console.trace("Invalid call - no current context.");return}const e=Lp(i);Zk(i,e,!0)||(vE||pt()?console.error(`Error updating hierarchy
|