@needle-tools/engine 3.5.3-alpha → 3.5.3-alpha.1
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 +3 -0
- package/dist/needle-engine.js +1 -1
- package/dist/needle-engine.min.js +1 -1
- package/dist/needle-engine.umd.cjs +1 -1
- package/lib/engine/engine_serialization_core.js +1 -1
- package/lib/engine/engine_serialization_core.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/engine/codegen/register_types.js +2 -2
- package/src/engine/engine_serialization_core.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,9 @@ 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.5.3-alpha.1] - 2023-05-10
|
|
8
|
+
- Fix: wrong check in serialization causing particles to break (introduced in 3.5.3-exp)
|
|
9
|
+
|
|
7
10
|
## [3.5.3-alpha] - 2023-05-10
|
|
8
11
|
- Add: `IPointerMoveHandler` interface providing `onPointerMove` event while hovered
|
|
9
12
|
- Add: USDZ AudioSource support and PlayAudioOnClick
|
package/dist/needle-engine.js
CHANGED
|
@@ -21029,7 +21029,7 @@ function D8(i, A) {
|
|
|
21029
21029
|
for (const I of Object.keys(t))
|
|
21030
21030
|
if (g[I] === void 0 && oF(t[I]) && !oF(g)) {
|
|
21031
21031
|
const C = p8(g, I);
|
|
21032
|
-
if (C
|
|
21032
|
+
if ((C == null ? void 0 : C.writable) === !1 && C && C.set === void 0) {
|
|
21033
21033
|
Is && console.warn('Property is not writable "' + I + '"', g, C, t[I], g[I]);
|
|
21034
21034
|
continue;
|
|
21035
21035
|
}
|
|
@@ -3240,7 +3240,7 @@ Please change to:
|
|
|
3240
3240
|
${o}? : AssetReference;
|
|
3241
3241
|
|
|
3242
3242
|
in script ${I}.ts
|
|
3243
|
-
<a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(I,o,g[o],g);continue}}}}function MW(g,A){for(const e of Object.keys(A)){const t=A[e];if(typeof t=="object"&&t!==null&&t!==void 0){const I=g[e];if(!I){As&&console.log(e,"is undefined on",g);continue}for(const i of Object.keys(t))if(I[i]===void 0&&WK(t[i])&&!WK(I)){const o=RW(I,i);if(o!=null&&o.writable||o&&o.set===void 0){As&&console.warn('Property is not writable "'+i+'"',I,o,t[i],I[i]);continue}I[i]=t[i]}}}}function RW(g,A){for(;g;){const e=Object.getOwnPropertyDescriptor(g,A);if(e)return e;g=Object.getPrototypeOf(g)}}function WK(g){switch(typeof g){case"number":case"string":case"boolean":return!0}return!1}function Rf(g,A,e,t,I){let i=typeof A=="function"&&A.prototype===void 0,o=A;if(i)try{if(o=A?.call(A,I),i=!1,o==null)return}catch(n){console.error("Error in callback",n,g)}if(e.type=o,!i&&I instanceof o)return I;if(I&&typeof I=="object"&&yW(I)){if(I.__concreteInstance)return I.__concreteInstance;const n=I;if(!n.$serializedTypes&&o.prototype.$serializedTypes&&(n.$serializedTypes=o.prototype.$serializedTypes),n.$serializedTypes&&zp(n,g,e),I&&o!==void 0)try{const r=new o;rI&&console.log("Create concrete instance for persistent asset",I,"instance:",r),Zn(r,I),I.__concreteInstance=r,I=r}catch(r){console.error("Error creating instance or creating values on instance",r,I,o)}return I}if(t||(t={serializer:Wp.getSerializerForConstructor(o)}),Array.isArray(g)){const n=[];for(let r=0;r<g.length;r++){const Q=g[r],E=Rf(Q,A,e,t,Q);n.push(E)}return n}const C=t.serializer;if(C)return C.onDeserialize(g,e);let s;if(g&&(g.isMaterial||g.isTexture||g.isObject3D))s=g;else{if(g===void 0)return;if(g===null&&(o===Ue||o===Ye||o===yA||o===xi))return null;s=new o(...UW(g))}const a=s;return a.$serializedTypes&&zp(a,g,e),s}function UW(g){if(Vp.length=0,typeof g=="object"&&g!==null&&g!==void 0)for(const A of Object.keys(g))Vp.push(g[A]);return Vp}const Uf=Symbol("assigned component properties");function Zn(g,A,e){var t;if(A==null||g==null)return;g[Uf]=!0;const I=((t=g.constructor)==null?void 0:t.name)??"unknown";e?.registerDefinedKeys(I,g);for(const i of Object.keys(A)){const o=FW(g,i);typeof o?.value!="function"&&(!o||o.writable===!0||o?.set!==void 0)&&(g[i]=A[i])}delete g[Uf]}function FW(g,A){let e;do e=Object.getOwnPropertyDescriptor(g,A);while(!e&&(g=Object.getPrototypeOf(g)));return e}const Yi=aA("debuginput");class Zp{constructor(A){B(this,"key"),B(this,"keyType"),B(this,"source"),this.key=A.key,this.keyType=A.type,this.source=A}}var zo=(g=>(g.PointerDown="pointerdown",g.PointerUp="pointerup",g.PointerMove="pointermove",g.KeyDown="keydown",g.KeyUp="keyup",g.KeyPressed="keypress",g))(zo||{}),VK=(g=>(g.Mouse="mouse",g.Touch="touch",g))(VK||{});class zK extends EventTarget{constructor(A){super(),B(this,"_doubleClickTimeThreshold",.2),B(this,"_longPressTimeThreshold",1),B(this,"_specialCursorTrigger",0),B(this,"context"),B(this,"_pointerDown",[!1]),B(this,"_pointerUp",[!1]),B(this,"_pointerClick",[!1]),B(this,"_pointerDoubleClick",[!1]),B(this,"_pointerPressed",[!1]),B(this,"_pointerPositions",[new W]),B(this,"_pointerPositionsLastFrame",[new W]),B(this,"_pointerPositionsDelta",[new W]),B(this,"_pointerPositionsRC",[new W]),B(this,"_pointerPositionDown",[new W]),B(this,"_pointerDownTime",[]),B(this,"_pointerUpTime",[]),B(this,"_pointerUpTimestamp",[]),B(this,"_pointerIds",[]),B(this,"_pointerTypes",[""]),B(this,"_mouseWheelChanged",[!1]),B(this,"_mouseWheelDeltaY",[0]),B(this,"_pointerEvent",[]),B(this,"_pointerUsed",[]),B(this,"keysPressed",{}),this.context=A,this.context.post_render_callbacks.push(this.onEndOfFrame.bind(this)),window.addEventListener("touchstart",this.onTouchStart.bind(this),!1),window.addEventListener("touchmove",this.onTouchMove.bind(this),{passive:!0}),window.addEventListener("touchend",this.onTouchUp.bind(this),!1),window.addEventListener("mousedown",this.onMouseDown.bind(this),!1),window.addEventListener("mousemove",this.onMouseMove.bind(this),!1),window.addEventListener("mouseup",this.onMouseUp.bind(this),!1),window.addEventListener("wheel",this.onMouseWheel.bind(this),{passive:!0}),window.addEventListener("keydown",this.onKeyDown.bind(this),!1),window.addEventListener("keypress",this.onKeyPressed.bind(this),!1),window.addEventListener("keyup",this.onKeyUp.bind(this),!1),window.addEventListener("blur",this.onLostFocus.bind(this))}get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}setCursorPointer(){this._specialCursorTrigger+=1,this.context.domElement.style.cursor="pointer"}setCursorNormal(){this._specialCursorTrigger-=1,this._specialCursorTrigger=Math.max(0,this._specialCursorTrigger),this._specialCursorTrigger===0&&(this.context.domElement.style.cursor="default")}setPointerUsed(A,e=!0){if(A>=this._pointerUsed.length){if(A>=this._pointerIds.length)return;for(;this._pointerUsed.length<=A;)this._pointerUsed.push(!1)}this._pointerUsed[A]=e}getPointerUsed(A){return A>=this._pointerUsed.length?!1:this._pointerUsed[A]}getPointerPressedCount(){let A=0;for(let e=0;e<this._pointerPressed.length;e++)this._pointerPressed[e]&&A++;return A}getPointerPosition(A){return A>=this._pointerPositions.length?null:this._pointerPositions[A]}getPointerPositionLastFrame(A){return A>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[A]}getPointerPositionDelta(A){return A>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[A]}getPointerPositionRC(A){return A>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[A]}getPointerDown(A){return A>=this._pointerDown.length?!1:this._pointerDown[A]}getPointerUp(A){return A>=this._pointerUp.length?!1:this._pointerUp[A]}getPointerPressed(A){return A>=this._pointerPressed.length?!1:this._pointerPressed[A]}getPointerClicked(A){return A>=this._pointerClick.length?!1:this._pointerClick[A]}getPointerDoubleClicked(A){return A>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[A]}getPointerDownTime(A){return A>=this._pointerDownTime.length?-1:this._pointerDownTime[A]}getPointerUpTime(A){return A>=this._pointerUpTime.length?-1:this._pointerUpTime[A]}getPointerLongPress(A){return A>=this._pointerDownTime.length?!1:this.getPointerPressed(A)&&this.context.time.time-this._pointerDownTime[A]>this._longPressTimeThreshold}getIsMouse(A){return A<0||A>=this._pointerTypes.length?!1:this._pointerTypes[A]==="mouse"}getIsTouch(A){return A<0||A>=this._pointerTypes.length?!1:this._pointerTypes[A]==="touch"}getTouchesPressedCount(){let A=0;for(let e=0;e<this._pointerPressed.length;e++)this._pointerPressed[e]&&this.getIsTouch(e)&&A++;return A}getMouseWheelChanged(A=0){return A>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[A]}getMouseWheelDeltaY(A=0){return A>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[A]}getPointerEvent(A){if(!(A>=this._pointerEvent.length))return this._pointerEvent[A]??void 0}*foreachPointerId(A){for(let e=0;e<this._pointerTypes.length;e++)if(this._pointerIsActive(e)){if(A!==void 0){const t=this._pointerTypes[e];if(Array.isArray(A)){let I=!1;for(const i of A)if(t===i){I=!0;break}if(!I)continue}else if(A!==t)continue}yield e}}*foreachTouchId(){for(let A=0;A<this._pointerTypes.length;A++)this._pointerTypes[A]==="touch"&&this._pointerIsActive[A]&&(yield A)}_pointerIsActive(A){return A<0?!1:this._pointerPressed[A]||this._pointerDown[A]||this._pointerUp[A]}getKeyDown(){for(const A in this.keysPressed){const e=this.keysPressed[A];if(e.startFrame===this.context.time.frameCount)return e.key}return null}getKeyPressed(){for(const A in this.keysPressed){const e=this.keysPressed[A];if(e.pressed)return e.key}return null}isKeyDown(A){var e;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(A);if(t!==null){for(const I of t)if(this.isKeyDown(I))return!0;return!1}return((e=this.keysPressed[A])==null?void 0:e.startFrame)===this.context.time.frameCount&&this.keysPressed[A].pressed}isKeyUp(A){var e;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(A);if(t!==null){for(const I of t)if(this.isKeyUp(I))return!0;return!1}return((e=this.keysPressed[A])==null?void 0:e.frame)===this.context.time.frameCount&&!this.keysPressed[A].pressed}isKeyPressed(A){var e;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(A);if(t!==null){for(const I of t)if(this.isKeyPressed(I))return!0;return!1}return(e=this.keysPressed[A])==null?void 0:e.pressed}getCodeForCommonKeyName(A){if(A.length===1){if(A>="0"&&A<="9")return["Digit"+A];if(A>="a"&&A<="z")return["Key"+A.toUpperCase()];if(A==" ")return["Space"]}switch(A){case"Shift":return["ShiftLeft","ShiftRight"];case"Control":return["ControlLeft","ControlRight"];case"Alt":return["AltLeft","AltRight"]}return null}createPointerDown(A){Yi&&jt("Create Pointer down"),this.onDown(A)}createPointerMove(A){Yi&&jt("Create Pointer move"),this.onMove(A)}createPointerUp(A){Yi&&jt("Create Pointer up"),this.onUp(A)}convertScreenspaceToRaycastSpace(A){A.x=(A.x-this.context.domX)/this.context.domWidth*2-1,A.y=-((A.y-this.context.domY)/this.context.domHeight)*2+1}onLostFocus(){for(const A in this.keysPressed)this.keysPressed[A].pressed=!1}onEndOfFrame(){for(let A=0;A<this._pointerUp.length;A++)this._pointerUp[A]=!1;for(let A=0;A<this._pointerDown.length;A++)this._pointerDown[A]=!1;for(let A=0;A<this._pointerClick.length;A++)this._pointerClick[A]=!1;for(let A=0;A<this._pointerDoubleClick.length;A++)this._pointerDoubleClick[A]=!1;for(const A of this._pointerPositionsDelta)A.set(0,0);for(let A=0;A<this._mouseWheelChanged.length;A++)this._mouseWheelChanged[A]=!1;for(let A=0;A<this._mouseWheelDeltaY.length;A++)this._mouseWheelDeltaY[A]=0}canReceiveInput(A){return A.target===this.context.renderer.domElement}onKeyDown(A){if(!this.context.application.hasFocus)return;const e=this.keysPressed[A.code];e&&e.pressed||(this.keysPressed[A.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:A.key,code:A.code},this.onDispatchEvent("keydown",new Zp(A)))}onKeyPressed(A){if(!this.context.application.hasFocus)return;const e=this.keysPressed[A.code];e&&(e.pressed=!0,e.frame=this.context.time.frameCount+1,this.onDispatchEvent("keypress",new Zp(A)))}onKeyUp(A){if(!this.context.application.hasFocus)return;const e=this.keysPressed[A.code];e&&(e.pressed=!1,e.frame=this.context.time.frameCount+1,this.onDispatchEvent("keyup",new Zp(A)))}onMouseWheel(A){if(this.canReceiveInput(A)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const e=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=e+A.deltaY}onTouchStart(A){if(!(A.changedTouches.length<=0)&&this.canReceiveInput(A)!==!1)for(let e=0;e<A.changedTouches.length;e++){const t=A.changedTouches[e],I=this.getPointerIndex(t.identifier);Yi&&jt(`touch start #${I}, identifier:${t.identifier}`);const i={button:I,clientX:t.clientX,clientY:t.clientY,pointerType:"touch",source:A};this.onDown(i)}}onTouchMove(A){if(!(A.changedTouches.length<=0))for(let e=0;e<A.changedTouches.length;e++){const t=A.changedTouches[e],I={button:this.getPointerIndex(t.identifier),clientX:t.clientX,clientY:t.clientY,pointerType:"touch",source:A};this.onMove(I)}}onTouchUp(A){if(!(A.changedTouches.length<=0))for(let e=0;e<A.changedTouches.length;e++){const t=A.changedTouches[e],I=this.getPointerIndex(t.identifier);if(!this.isNewEvent(A.timeStamp,I,this._pointerUpTimestamp))continue;Yi&&jt(`touch up #${I}, identifier:${t.identifier}`);const i={button:I,clientX:t.clientX,clientY:t.clientY,pointerType:"touch",source:A};this.onUp(i)}}onMouseDown(A){if(A.defaultPrevented||this.canReceiveInput(A)===!1)return;let e=A.button;this.onDown({button:e,clientX:A.clientX,clientY:A.clientY,pointerType:"mouse",source:A})}onMouseMove(A){if(A.defaultPrevented)return;const e={button:A.button,clientX:A.clientX,clientY:A.clientY,pointerType:"mouse",source:A,movementX:A.movementX,movementY:A.movementY};this.onMove(e)}onMouseUp(A){if(A.defaultPrevented)return;let e=A.button;this.isNewEvent(A.timeStamp,e,this._pointerUpTimestamp)&&this.onUp({button:e,clientX:A.clientX,clientY:A.clientY,pointerType:"mouse",source:A})}isNewEvent(A,e,t){for(;t.length<=e;)t.push(-1);return A===t[e]?!1:(t[e]=A,!0)}isInRect(A){if(this.context.isInXR)return!0;const e=this.context.domElement.getBoundingClientRect(),t=A.clientX,I=A.clientY,i=t>=e.x&&t<=e.right&&I>=e.y&&I<=e.bottom;return Yi&&!i&&console.log("Not in rect",e,t,I),i}onDown(A){var e;if(Yi&&console.log(A.pointerType,"DOWN",A.button),!!this.isInRect(A)){if(A.pointerType==="mouse"){const t=this._pointerUpTimestamp[A.button];if(t>0&&t===((e=A.source)==null?void 0:e.timeStamp)){Yi&&console.log("Ignoring mouse.down for touch.up");return}}for(this.setPointerState(A.button,this._pointerPressed,!0),this.setPointerState(A.button,this._pointerDown,!0),this.setPointerStateT(A.button,this._pointerEvent,A.source);A.button>=this._pointerTypes.length;)this._pointerTypes.push(A.pointerType);for(this._pointerTypes[A.button]=A.pointerType;A.button>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new W);for(this._pointerPositionDown[A.button].set(A.clientX,A.clientY);A.button>=this._pointerPositions.length;)this._pointerPositions.push(new W);this._pointerPositions[A.button].set(A.clientX,A.clientY),A.button>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[A.button]=this.context.time.time,this.updatePointerPosition(A),this.onDispatchEvent("pointerdown",A)}}onMove(A){const e=this.getPointerPressed(A.button);e===!1&&!this.isInRect(A)||A.pointerType==="touch"&&!e||(Yi&&console.log(A.pointerType,"MOVE",A.button),this.updatePointerPosition(A),this.setPointerStateT(A.button,this._pointerEvent,A.source),this.onDispatchEvent("pointermove",A))}onUp(A){var e;if(((e=this._pointerIds)==null?void 0:e.length)>=A.button&&(this._pointerIds[A.button]=-1),!this._pointerPressed[A.button]){Yi&&console.log(A.pointerType,"UP",A.button,"was not down");return}for(Yi&&console.log(A.pointerType,"UP",A.button),this.setPointerState(A.button,this._pointerPressed,!1),this.setPointerStateT(A.button,this._pointerEvent,A.source),this.setPointerState(A.button,this._pointerUp,!0);A.button>=this._pointerUsed.length;)this._pointerUsed.push(!1);if(this.setPointerState(A.button,this._pointerUsed,!1),this.updatePointerPosition(A),!this._pointerPositionDown[A.button]){Yi&&Do("Received pointer up event without matching down event for button: "+A.button),console.warn("Received pointer up event without matching down event for button: "+A.button);return}const t=A.clientX-this._pointerPositionDown[A.button].x,I=A.clientY-this._pointerPositionDown[A.button].y;if(A.button>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),Math.abs(t)<5&&Math.abs(I)<5){this.setPointerState(A.button,this._pointerClick,!0);const i=this._pointerUpTime[A.button],o=this.context.time.time-i;o<this._doubleClickTimeThreshold&&o>0&&this.setPointerState(A.button,this._pointerDoubleClick,!0)}this._pointerUpTime[A.button]=this.context.time.time,this.onDispatchEvent("pointerup",A)}updatePointerPosition(A){for(;A.button>=this._pointerPositions.length;)this._pointerPositions.push(new W);for(;A.button>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new W);for(;A.button>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new W);const e=this._pointerPositionsLastFrame[A.button];e.copy(this._pointerPositions[A.button]);const t=this._pointerPositionsDelta[A.button],I=A.clientX-e.x,i=A.clientY-e.y;t.x+=I,t.y+=i,this._pointerPositions[A.button].x=A.clientX,this._pointerPositions[A.button].y=A.clientY;const o=A.clientX,C=A.clientY;for(;A.button>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new W);const s=this._pointerPositionsRC[A.button];s.set(o,C),this.convertScreenspaceToRaycastSpace(s)}getPointerIndex(A){const e=this._pointerIds;let t=-1;for(let I=0;I<e.length;I++){if(e[I]===A)return I;t===-1&&e[I]===-1&&(t=I)}return t!==-1?(e[t]=A,t):(e.push(A),e.length-1)}setPointerState(A,e,t){for(;e.length<=A;)e.push(!1);e[A]=t}setPointerStateT(A,e,t){for(;e.length<=A;)e.push(null);e[A]=t}onDispatchEvent(A,e){const t=we.Current;try{we.Current=this.context;const I=new Event(A);Zn(I,e),this.dispatchEvent(I)}finally{we.Current=t}}}class NW{constructor(){B(this,"Rad2Deg",180/Math.PI),B(this,"Deg2Rad",Math.PI/180),B(this,"Epsilon",1e-5)}random(){return Math.random()}clamp(A,e,t){return A<e?e:A>t?t:A}clamp01(A){return this.clamp(A,0,1)}lerp(A,e,t){return t=t<0?0:t,t=t>1?1:t,A+(e-A)*t}inverseLerp(A,e,t){return(t-A)/(e-A)}remap(A,e,t,I,i){return I+(i-I)*(A-e)/(t-e)}moveTowards(A,e,t){return A+=t,(t<0&&A<e||t>0&&A>e)&&(A=e),A}toDegrees(A){return A*180/Math.PI}toRadians(A){return A*Math.PI/180}tan(A){return Math.tan(A)}gammaToLinear(A){return Math.pow(A,2.2)}linearToGamma(A){return Math.pow(A,1/2.2)}}const $A=new NW;function ZK(g,A,e){const t=g.length(),I=A.length(),i=$A.lerp(t,I,e);return g.lerp(A,e).normalize().multiplyScalar(i)}const KW=new mA().setFromAxisAngle(new f(0,1,0),Math.PI);function JW(g,A){g.lookAt(A),g.quaternion.multiply(KW)}const Ff=new Dn(()=>new f,100);function ye(g,A=null,e=!0){const t=A??Ff.get();return g?g.parent?(e&&g.updateWorldMatrix(!0,!1),g.matrixWorldNeedsUpdate&&g.updateMatrixWorld(),t.setFromMatrixPosition(g.matrixWorld),t):t.copy(g.position):t.set(0,0,0)}function nt(g,A){if(!g)return;const e=Ff.get();A!==e&&e.copy(A),(g?.parent??g).worldToLocal(e),g.position.set(e.x,e.y,e.z)}function br(g,A,e,t){const I=Ff.get();I.set(A,e,t),nt(g,I)}const Xn=new mA,wh=new mA,Nf=new mA;function vt(g,A=null){if(!g)return wh.set(0,0,0,1);const e=A??wh;return g.parent?(g.getWorldQuaternion(e),e):e.copy(g.quaternion)}function PI(g,A){if(!g)return;A!==Xn&&Xn.copy(A);const e=Xn,t=g?.parent;t?.getWorldQuaternion(Nf),Nf.invert();const I=Nf.multiply(e);g.quaternion.set(I.x,I.y,I.z,I.w)}function XK(g,A,e,t,I){Xn.set(A,e,t,I),PI(g,Xn)}const Xp=new f,qW=new f;function Wt(g,A=null){return g?g.parent?(g.getWorldScale(A??Xp),A??Xp):Xp.copy(g.scale):Xp.set(0,0,0)}function Kf(g,A){if(!g)return;if(!g.parent){g.scale.copy(A);return}const e=qW;g.parent.getWorldScale(e),g.scale.copy(A),g.scale.divide(e)}const bW=new f,$K=new mA;function vW(g){return vt(g,$K),bW.set(0,0,1).applyQuaternion($K)}const AJ=new St,eJ=new St,LW=new f;function gJ(g){return g.getWorldQuaternion(wh),eJ.setFromQuaternion(wh),eJ}function tJ(g,A){PI(g,wh.setFromEuler(A))}function Jf(g){const A=gJ(g),e=LW;return e.set(A.x,A.y,A.z),e.x=$A.toDegrees(e.x),e.y=$A.toDegrees(e.y),e.z=$A.toDegrees(e.z),e}function xW(g,A){$p(g,A.x,A.y,A.z,!0)}function $p(g,A,e,t,I=!0){I&&(A=$A.toRadians(A),e=$A.toRadians(e),t=$A.toRadians(t)),AJ.set(A,e,t),Xn.setFromEuler(AJ),PI(g,Xn)}function Au(g,A=!0){g&&(A?function e(t){console.groupCollapsed((t.name?t.name:"(no name : "+t.type+")")+" %o",t),t.children.forEach(e),console.groupEnd()}(g):g.traverse(function(e){for(var t="|___",I=e;I.parent!==null;)t=" "+t,I=I.parent;console.log(t+e.name+" <"+e.type+">")}))}function IJ(g){if(g){const A=g;return A.blendMode!==void 0&&A.clampWhenFinished!==void 0&&A.enabled!==void 0&&A.fadeIn!==void 0&&A.getClip!==void 0}return!1}const yh=class{static createBlitMaterial(g){return new je({uniforms:{map:new kA(null)},vertexShader:this.vertex,fragmentShader:g})}static copyTexture(g,A){const e=A??this.blipMaterial;e.uniforms.map.value=g,e.needsUpdate=!0,e.uniformsNeedUpdate=!0;const t=this.mesh;t.material=e,t.frustumCulled=!1,this.scene.children.length=0,this.scene.add(t),this.renderer.setSize(g.image.width,g.image.height),this.renderer.clear(),this.renderer.render(this.scene,this.perspectiveCam);const I=new Ye(this.renderer.domElement);return I.name="Copy",I.needsUpdate=!0,I}static textureToCanvas(g,A){if(!g)return null;(A===!0||g.isCompressedTexture===!0)&&(g=iJ(g));const e=g.image;if(HW(e)){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const I=t.getContext("2d");return I?(I.drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t):(console.error("Failed getting canvas 2d context"),null)}return null}};let wo=yh;B(wo,"planeGeometry",new Ot(2,2,1,1)),B(wo,"renderer",new Sr({antialias:!1})),B(wo,"perspectiveCam",new Xe),B(wo,"scene",new vi),B(wo,"vertex",`
|
|
3243
|
+
<a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(I,o,g[o],g);continue}}}}function MW(g,A){for(const e of Object.keys(A)){const t=A[e];if(typeof t=="object"&&t!==null&&t!==void 0){const I=g[e];if(!I){As&&console.log(e,"is undefined on",g);continue}for(const i of Object.keys(t))if(I[i]===void 0&&WK(t[i])&&!WK(I)){const o=RW(I,i);if(o?.writable===!1&&o&&o.set===void 0){As&&console.warn('Property is not writable "'+i+'"',I,o,t[i],I[i]);continue}I[i]=t[i]}}}}function RW(g,A){for(;g;){const e=Object.getOwnPropertyDescriptor(g,A);if(e)return e;g=Object.getPrototypeOf(g)}}function WK(g){switch(typeof g){case"number":case"string":case"boolean":return!0}return!1}function Rf(g,A,e,t,I){let i=typeof A=="function"&&A.prototype===void 0,o=A;if(i)try{if(o=A?.call(A,I),i=!1,o==null)return}catch(n){console.error("Error in callback",n,g)}if(e.type=o,!i&&I instanceof o)return I;if(I&&typeof I=="object"&&yW(I)){if(I.__concreteInstance)return I.__concreteInstance;const n=I;if(!n.$serializedTypes&&o.prototype.$serializedTypes&&(n.$serializedTypes=o.prototype.$serializedTypes),n.$serializedTypes&&zp(n,g,e),I&&o!==void 0)try{const r=new o;rI&&console.log("Create concrete instance for persistent asset",I,"instance:",r),Zn(r,I),I.__concreteInstance=r,I=r}catch(r){console.error("Error creating instance or creating values on instance",r,I,o)}return I}if(t||(t={serializer:Wp.getSerializerForConstructor(o)}),Array.isArray(g)){const n=[];for(let r=0;r<g.length;r++){const Q=g[r],E=Rf(Q,A,e,t,Q);n.push(E)}return n}const C=t.serializer;if(C)return C.onDeserialize(g,e);let s;if(g&&(g.isMaterial||g.isTexture||g.isObject3D))s=g;else{if(g===void 0)return;if(g===null&&(o===Ue||o===Ye||o===yA||o===xi))return null;s=new o(...UW(g))}const a=s;return a.$serializedTypes&&zp(a,g,e),s}function UW(g){if(Vp.length=0,typeof g=="object"&&g!==null&&g!==void 0)for(const A of Object.keys(g))Vp.push(g[A]);return Vp}const Uf=Symbol("assigned component properties");function Zn(g,A,e){var t;if(A==null||g==null)return;g[Uf]=!0;const I=((t=g.constructor)==null?void 0:t.name)??"unknown";e?.registerDefinedKeys(I,g);for(const i of Object.keys(A)){const o=FW(g,i);typeof o?.value!="function"&&(!o||o.writable===!0||o?.set!==void 0)&&(g[i]=A[i])}delete g[Uf]}function FW(g,A){let e;do e=Object.getOwnPropertyDescriptor(g,A);while(!e&&(g=Object.getPrototypeOf(g)));return e}const Yi=aA("debuginput");class Zp{constructor(A){B(this,"key"),B(this,"keyType"),B(this,"source"),this.key=A.key,this.keyType=A.type,this.source=A}}var zo=(g=>(g.PointerDown="pointerdown",g.PointerUp="pointerup",g.PointerMove="pointermove",g.KeyDown="keydown",g.KeyUp="keyup",g.KeyPressed="keypress",g))(zo||{}),VK=(g=>(g.Mouse="mouse",g.Touch="touch",g))(VK||{});class zK extends EventTarget{constructor(A){super(),B(this,"_doubleClickTimeThreshold",.2),B(this,"_longPressTimeThreshold",1),B(this,"_specialCursorTrigger",0),B(this,"context"),B(this,"_pointerDown",[!1]),B(this,"_pointerUp",[!1]),B(this,"_pointerClick",[!1]),B(this,"_pointerDoubleClick",[!1]),B(this,"_pointerPressed",[!1]),B(this,"_pointerPositions",[new W]),B(this,"_pointerPositionsLastFrame",[new W]),B(this,"_pointerPositionsDelta",[new W]),B(this,"_pointerPositionsRC",[new W]),B(this,"_pointerPositionDown",[new W]),B(this,"_pointerDownTime",[]),B(this,"_pointerUpTime",[]),B(this,"_pointerUpTimestamp",[]),B(this,"_pointerIds",[]),B(this,"_pointerTypes",[""]),B(this,"_mouseWheelChanged",[!1]),B(this,"_mouseWheelDeltaY",[0]),B(this,"_pointerEvent",[]),B(this,"_pointerUsed",[]),B(this,"keysPressed",{}),this.context=A,this.context.post_render_callbacks.push(this.onEndOfFrame.bind(this)),window.addEventListener("touchstart",this.onTouchStart.bind(this),!1),window.addEventListener("touchmove",this.onTouchMove.bind(this),{passive:!0}),window.addEventListener("touchend",this.onTouchUp.bind(this),!1),window.addEventListener("mousedown",this.onMouseDown.bind(this),!1),window.addEventListener("mousemove",this.onMouseMove.bind(this),!1),window.addEventListener("mouseup",this.onMouseUp.bind(this),!1),window.addEventListener("wheel",this.onMouseWheel.bind(this),{passive:!0}),window.addEventListener("keydown",this.onKeyDown.bind(this),!1),window.addEventListener("keypress",this.onKeyPressed.bind(this),!1),window.addEventListener("keyup",this.onKeyUp.bind(this),!1),window.addEventListener("blur",this.onLostFocus.bind(this))}get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}setCursorPointer(){this._specialCursorTrigger+=1,this.context.domElement.style.cursor="pointer"}setCursorNormal(){this._specialCursorTrigger-=1,this._specialCursorTrigger=Math.max(0,this._specialCursorTrigger),this._specialCursorTrigger===0&&(this.context.domElement.style.cursor="default")}setPointerUsed(A,e=!0){if(A>=this._pointerUsed.length){if(A>=this._pointerIds.length)return;for(;this._pointerUsed.length<=A;)this._pointerUsed.push(!1)}this._pointerUsed[A]=e}getPointerUsed(A){return A>=this._pointerUsed.length?!1:this._pointerUsed[A]}getPointerPressedCount(){let A=0;for(let e=0;e<this._pointerPressed.length;e++)this._pointerPressed[e]&&A++;return A}getPointerPosition(A){return A>=this._pointerPositions.length?null:this._pointerPositions[A]}getPointerPositionLastFrame(A){return A>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[A]}getPointerPositionDelta(A){return A>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[A]}getPointerPositionRC(A){return A>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[A]}getPointerDown(A){return A>=this._pointerDown.length?!1:this._pointerDown[A]}getPointerUp(A){return A>=this._pointerUp.length?!1:this._pointerUp[A]}getPointerPressed(A){return A>=this._pointerPressed.length?!1:this._pointerPressed[A]}getPointerClicked(A){return A>=this._pointerClick.length?!1:this._pointerClick[A]}getPointerDoubleClicked(A){return A>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[A]}getPointerDownTime(A){return A>=this._pointerDownTime.length?-1:this._pointerDownTime[A]}getPointerUpTime(A){return A>=this._pointerUpTime.length?-1:this._pointerUpTime[A]}getPointerLongPress(A){return A>=this._pointerDownTime.length?!1:this.getPointerPressed(A)&&this.context.time.time-this._pointerDownTime[A]>this._longPressTimeThreshold}getIsMouse(A){return A<0||A>=this._pointerTypes.length?!1:this._pointerTypes[A]==="mouse"}getIsTouch(A){return A<0||A>=this._pointerTypes.length?!1:this._pointerTypes[A]==="touch"}getTouchesPressedCount(){let A=0;for(let e=0;e<this._pointerPressed.length;e++)this._pointerPressed[e]&&this.getIsTouch(e)&&A++;return A}getMouseWheelChanged(A=0){return A>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[A]}getMouseWheelDeltaY(A=0){return A>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[A]}getPointerEvent(A){if(!(A>=this._pointerEvent.length))return this._pointerEvent[A]??void 0}*foreachPointerId(A){for(let e=0;e<this._pointerTypes.length;e++)if(this._pointerIsActive(e)){if(A!==void 0){const t=this._pointerTypes[e];if(Array.isArray(A)){let I=!1;for(const i of A)if(t===i){I=!0;break}if(!I)continue}else if(A!==t)continue}yield e}}*foreachTouchId(){for(let A=0;A<this._pointerTypes.length;A++)this._pointerTypes[A]==="touch"&&this._pointerIsActive[A]&&(yield A)}_pointerIsActive(A){return A<0?!1:this._pointerPressed[A]||this._pointerDown[A]||this._pointerUp[A]}getKeyDown(){for(const A in this.keysPressed){const e=this.keysPressed[A];if(e.startFrame===this.context.time.frameCount)return e.key}return null}getKeyPressed(){for(const A in this.keysPressed){const e=this.keysPressed[A];if(e.pressed)return e.key}return null}isKeyDown(A){var e;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(A);if(t!==null){for(const I of t)if(this.isKeyDown(I))return!0;return!1}return((e=this.keysPressed[A])==null?void 0:e.startFrame)===this.context.time.frameCount&&this.keysPressed[A].pressed}isKeyUp(A){var e;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(A);if(t!==null){for(const I of t)if(this.isKeyUp(I))return!0;return!1}return((e=this.keysPressed[A])==null?void 0:e.frame)===this.context.time.frameCount&&!this.keysPressed[A].pressed}isKeyPressed(A){var e;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(A);if(t!==null){for(const I of t)if(this.isKeyPressed(I))return!0;return!1}return(e=this.keysPressed[A])==null?void 0:e.pressed}getCodeForCommonKeyName(A){if(A.length===1){if(A>="0"&&A<="9")return["Digit"+A];if(A>="a"&&A<="z")return["Key"+A.toUpperCase()];if(A==" ")return["Space"]}switch(A){case"Shift":return["ShiftLeft","ShiftRight"];case"Control":return["ControlLeft","ControlRight"];case"Alt":return["AltLeft","AltRight"]}return null}createPointerDown(A){Yi&&jt("Create Pointer down"),this.onDown(A)}createPointerMove(A){Yi&&jt("Create Pointer move"),this.onMove(A)}createPointerUp(A){Yi&&jt("Create Pointer up"),this.onUp(A)}convertScreenspaceToRaycastSpace(A){A.x=(A.x-this.context.domX)/this.context.domWidth*2-1,A.y=-((A.y-this.context.domY)/this.context.domHeight)*2+1}onLostFocus(){for(const A in this.keysPressed)this.keysPressed[A].pressed=!1}onEndOfFrame(){for(let A=0;A<this._pointerUp.length;A++)this._pointerUp[A]=!1;for(let A=0;A<this._pointerDown.length;A++)this._pointerDown[A]=!1;for(let A=0;A<this._pointerClick.length;A++)this._pointerClick[A]=!1;for(let A=0;A<this._pointerDoubleClick.length;A++)this._pointerDoubleClick[A]=!1;for(const A of this._pointerPositionsDelta)A.set(0,0);for(let A=0;A<this._mouseWheelChanged.length;A++)this._mouseWheelChanged[A]=!1;for(let A=0;A<this._mouseWheelDeltaY.length;A++)this._mouseWheelDeltaY[A]=0}canReceiveInput(A){return A.target===this.context.renderer.domElement}onKeyDown(A){if(!this.context.application.hasFocus)return;const e=this.keysPressed[A.code];e&&e.pressed||(this.keysPressed[A.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:A.key,code:A.code},this.onDispatchEvent("keydown",new Zp(A)))}onKeyPressed(A){if(!this.context.application.hasFocus)return;const e=this.keysPressed[A.code];e&&(e.pressed=!0,e.frame=this.context.time.frameCount+1,this.onDispatchEvent("keypress",new Zp(A)))}onKeyUp(A){if(!this.context.application.hasFocus)return;const e=this.keysPressed[A.code];e&&(e.pressed=!1,e.frame=this.context.time.frameCount+1,this.onDispatchEvent("keyup",new Zp(A)))}onMouseWheel(A){if(this.canReceiveInput(A)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const e=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=e+A.deltaY}onTouchStart(A){if(!(A.changedTouches.length<=0)&&this.canReceiveInput(A)!==!1)for(let e=0;e<A.changedTouches.length;e++){const t=A.changedTouches[e],I=this.getPointerIndex(t.identifier);Yi&&jt(`touch start #${I}, identifier:${t.identifier}`);const i={button:I,clientX:t.clientX,clientY:t.clientY,pointerType:"touch",source:A};this.onDown(i)}}onTouchMove(A){if(!(A.changedTouches.length<=0))for(let e=0;e<A.changedTouches.length;e++){const t=A.changedTouches[e],I={button:this.getPointerIndex(t.identifier),clientX:t.clientX,clientY:t.clientY,pointerType:"touch",source:A};this.onMove(I)}}onTouchUp(A){if(!(A.changedTouches.length<=0))for(let e=0;e<A.changedTouches.length;e++){const t=A.changedTouches[e],I=this.getPointerIndex(t.identifier);if(!this.isNewEvent(A.timeStamp,I,this._pointerUpTimestamp))continue;Yi&&jt(`touch up #${I}, identifier:${t.identifier}`);const i={button:I,clientX:t.clientX,clientY:t.clientY,pointerType:"touch",source:A};this.onUp(i)}}onMouseDown(A){if(A.defaultPrevented||this.canReceiveInput(A)===!1)return;let e=A.button;this.onDown({button:e,clientX:A.clientX,clientY:A.clientY,pointerType:"mouse",source:A})}onMouseMove(A){if(A.defaultPrevented)return;const e={button:A.button,clientX:A.clientX,clientY:A.clientY,pointerType:"mouse",source:A,movementX:A.movementX,movementY:A.movementY};this.onMove(e)}onMouseUp(A){if(A.defaultPrevented)return;let e=A.button;this.isNewEvent(A.timeStamp,e,this._pointerUpTimestamp)&&this.onUp({button:e,clientX:A.clientX,clientY:A.clientY,pointerType:"mouse",source:A})}isNewEvent(A,e,t){for(;t.length<=e;)t.push(-1);return A===t[e]?!1:(t[e]=A,!0)}isInRect(A){if(this.context.isInXR)return!0;const e=this.context.domElement.getBoundingClientRect(),t=A.clientX,I=A.clientY,i=t>=e.x&&t<=e.right&&I>=e.y&&I<=e.bottom;return Yi&&!i&&console.log("Not in rect",e,t,I),i}onDown(A){var e;if(Yi&&console.log(A.pointerType,"DOWN",A.button),!!this.isInRect(A)){if(A.pointerType==="mouse"){const t=this._pointerUpTimestamp[A.button];if(t>0&&t===((e=A.source)==null?void 0:e.timeStamp)){Yi&&console.log("Ignoring mouse.down for touch.up");return}}for(this.setPointerState(A.button,this._pointerPressed,!0),this.setPointerState(A.button,this._pointerDown,!0),this.setPointerStateT(A.button,this._pointerEvent,A.source);A.button>=this._pointerTypes.length;)this._pointerTypes.push(A.pointerType);for(this._pointerTypes[A.button]=A.pointerType;A.button>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new W);for(this._pointerPositionDown[A.button].set(A.clientX,A.clientY);A.button>=this._pointerPositions.length;)this._pointerPositions.push(new W);this._pointerPositions[A.button].set(A.clientX,A.clientY),A.button>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[A.button]=this.context.time.time,this.updatePointerPosition(A),this.onDispatchEvent("pointerdown",A)}}onMove(A){const e=this.getPointerPressed(A.button);e===!1&&!this.isInRect(A)||A.pointerType==="touch"&&!e||(Yi&&console.log(A.pointerType,"MOVE",A.button),this.updatePointerPosition(A),this.setPointerStateT(A.button,this._pointerEvent,A.source),this.onDispatchEvent("pointermove",A))}onUp(A){var e;if(((e=this._pointerIds)==null?void 0:e.length)>=A.button&&(this._pointerIds[A.button]=-1),!this._pointerPressed[A.button]){Yi&&console.log(A.pointerType,"UP",A.button,"was not down");return}for(Yi&&console.log(A.pointerType,"UP",A.button),this.setPointerState(A.button,this._pointerPressed,!1),this.setPointerStateT(A.button,this._pointerEvent,A.source),this.setPointerState(A.button,this._pointerUp,!0);A.button>=this._pointerUsed.length;)this._pointerUsed.push(!1);if(this.setPointerState(A.button,this._pointerUsed,!1),this.updatePointerPosition(A),!this._pointerPositionDown[A.button]){Yi&&Do("Received pointer up event without matching down event for button: "+A.button),console.warn("Received pointer up event without matching down event for button: "+A.button);return}const t=A.clientX-this._pointerPositionDown[A.button].x,I=A.clientY-this._pointerPositionDown[A.button].y;if(A.button>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),Math.abs(t)<5&&Math.abs(I)<5){this.setPointerState(A.button,this._pointerClick,!0);const i=this._pointerUpTime[A.button],o=this.context.time.time-i;o<this._doubleClickTimeThreshold&&o>0&&this.setPointerState(A.button,this._pointerDoubleClick,!0)}this._pointerUpTime[A.button]=this.context.time.time,this.onDispatchEvent("pointerup",A)}updatePointerPosition(A){for(;A.button>=this._pointerPositions.length;)this._pointerPositions.push(new W);for(;A.button>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new W);for(;A.button>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new W);const e=this._pointerPositionsLastFrame[A.button];e.copy(this._pointerPositions[A.button]);const t=this._pointerPositionsDelta[A.button],I=A.clientX-e.x,i=A.clientY-e.y;t.x+=I,t.y+=i,this._pointerPositions[A.button].x=A.clientX,this._pointerPositions[A.button].y=A.clientY;const o=A.clientX,C=A.clientY;for(;A.button>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new W);const s=this._pointerPositionsRC[A.button];s.set(o,C),this.convertScreenspaceToRaycastSpace(s)}getPointerIndex(A){const e=this._pointerIds;let t=-1;for(let I=0;I<e.length;I++){if(e[I]===A)return I;t===-1&&e[I]===-1&&(t=I)}return t!==-1?(e[t]=A,t):(e.push(A),e.length-1)}setPointerState(A,e,t){for(;e.length<=A;)e.push(!1);e[A]=t}setPointerStateT(A,e,t){for(;e.length<=A;)e.push(null);e[A]=t}onDispatchEvent(A,e){const t=we.Current;try{we.Current=this.context;const I=new Event(A);Zn(I,e),this.dispatchEvent(I)}finally{we.Current=t}}}class NW{constructor(){B(this,"Rad2Deg",180/Math.PI),B(this,"Deg2Rad",Math.PI/180),B(this,"Epsilon",1e-5)}random(){return Math.random()}clamp(A,e,t){return A<e?e:A>t?t:A}clamp01(A){return this.clamp(A,0,1)}lerp(A,e,t){return t=t<0?0:t,t=t>1?1:t,A+(e-A)*t}inverseLerp(A,e,t){return(t-A)/(e-A)}remap(A,e,t,I,i){return I+(i-I)*(A-e)/(t-e)}moveTowards(A,e,t){return A+=t,(t<0&&A<e||t>0&&A>e)&&(A=e),A}toDegrees(A){return A*180/Math.PI}toRadians(A){return A*Math.PI/180}tan(A){return Math.tan(A)}gammaToLinear(A){return Math.pow(A,2.2)}linearToGamma(A){return Math.pow(A,1/2.2)}}const $A=new NW;function ZK(g,A,e){const t=g.length(),I=A.length(),i=$A.lerp(t,I,e);return g.lerp(A,e).normalize().multiplyScalar(i)}const KW=new mA().setFromAxisAngle(new f(0,1,0),Math.PI);function JW(g,A){g.lookAt(A),g.quaternion.multiply(KW)}const Ff=new Dn(()=>new f,100);function ye(g,A=null,e=!0){const t=A??Ff.get();return g?g.parent?(e&&g.updateWorldMatrix(!0,!1),g.matrixWorldNeedsUpdate&&g.updateMatrixWorld(),t.setFromMatrixPosition(g.matrixWorld),t):t.copy(g.position):t.set(0,0,0)}function nt(g,A){if(!g)return;const e=Ff.get();A!==e&&e.copy(A),(g?.parent??g).worldToLocal(e),g.position.set(e.x,e.y,e.z)}function br(g,A,e,t){const I=Ff.get();I.set(A,e,t),nt(g,I)}const Xn=new mA,wh=new mA,Nf=new mA;function vt(g,A=null){if(!g)return wh.set(0,0,0,1);const e=A??wh;return g.parent?(g.getWorldQuaternion(e),e):e.copy(g.quaternion)}function PI(g,A){if(!g)return;A!==Xn&&Xn.copy(A);const e=Xn,t=g?.parent;t?.getWorldQuaternion(Nf),Nf.invert();const I=Nf.multiply(e);g.quaternion.set(I.x,I.y,I.z,I.w)}function XK(g,A,e,t,I){Xn.set(A,e,t,I),PI(g,Xn)}const Xp=new f,qW=new f;function Wt(g,A=null){return g?g.parent?(g.getWorldScale(A??Xp),A??Xp):Xp.copy(g.scale):Xp.set(0,0,0)}function Kf(g,A){if(!g)return;if(!g.parent){g.scale.copy(A);return}const e=qW;g.parent.getWorldScale(e),g.scale.copy(A),g.scale.divide(e)}const bW=new f,$K=new mA;function vW(g){return vt(g,$K),bW.set(0,0,1).applyQuaternion($K)}const AJ=new St,eJ=new St,LW=new f;function gJ(g){return g.getWorldQuaternion(wh),eJ.setFromQuaternion(wh),eJ}function tJ(g,A){PI(g,wh.setFromEuler(A))}function Jf(g){const A=gJ(g),e=LW;return e.set(A.x,A.y,A.z),e.x=$A.toDegrees(e.x),e.y=$A.toDegrees(e.y),e.z=$A.toDegrees(e.z),e}function xW(g,A){$p(g,A.x,A.y,A.z,!0)}function $p(g,A,e,t,I=!0){I&&(A=$A.toRadians(A),e=$A.toRadians(e),t=$A.toRadians(t)),AJ.set(A,e,t),Xn.setFromEuler(AJ),PI(g,Xn)}function Au(g,A=!0){g&&(A?function e(t){console.groupCollapsed((t.name?t.name:"(no name : "+t.type+")")+" %o",t),t.children.forEach(e),console.groupEnd()}(g):g.traverse(function(e){for(var t="|___",I=e;I.parent!==null;)t=" "+t,I=I.parent;console.log(t+e.name+" <"+e.type+">")}))}function IJ(g){if(g){const A=g;return A.blendMode!==void 0&&A.clampWhenFinished!==void 0&&A.enabled!==void 0&&A.fadeIn!==void 0&&A.getClip!==void 0}return!1}const yh=class{static createBlitMaterial(g){return new je({uniforms:{map:new kA(null)},vertexShader:this.vertex,fragmentShader:g})}static copyTexture(g,A){const e=A??this.blipMaterial;e.uniforms.map.value=g,e.needsUpdate=!0,e.uniformsNeedUpdate=!0;const t=this.mesh;t.material=e,t.frustumCulled=!1,this.scene.children.length=0,this.scene.add(t),this.renderer.setSize(g.image.width,g.image.height),this.renderer.clear(),this.renderer.render(this.scene,this.perspectiveCam);const I=new Ye(this.renderer.domElement);return I.name="Copy",I.needsUpdate=!0,I}static textureToCanvas(g,A){if(!g)return null;(A===!0||g.isCompressedTexture===!0)&&(g=iJ(g));const e=g.image;if(HW(e)){const t=document.createElement("canvas");t.width=e.width,t.height=e.height;const I=t.getContext("2d");return I?(I.drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t):(console.error("Failed getting canvas 2d context"),null)}return null}};let wo=yh;B(wo,"planeGeometry",new Ot(2,2,1,1)),B(wo,"renderer",new Sr({antialias:!1})),B(wo,"perspectiveCam",new Xe),B(wo,"scene",new vi),B(wo,"vertex",`
|
|
3244
3244
|
varying vec2 vUv;
|
|
3245
3245
|
void main(){
|
|
3246
3246
|
vUv = uv;
|
|
@@ -3240,7 +3240,7 @@ Please change to:
|
|
|
3240
3240
|
${o}? : AssetReference;
|
|
3241
3241
|
|
|
3242
3242
|
in script ${t}.ts
|
|
3243
|
-
<a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(t,o,i[o],i);continue}}}}function KW(i,A){for(const e of Object.keys(A)){const t=A[e];if(typeof t=="object"&&t!==null&&t!==void 0){const g=i[e];if(!g){ls&&console.log(e,"is undefined on",i);continue}for(const I of Object.keys(t))if(g[I]===void 0&&IN(t[I])&&!IN(g)){const C=JW(g,I);if(C!=null&&C.writable||C&&C.set===void 0){ls&&console.warn('Property is not writable "'+I+'"',g,C,t[I],g[I]);continue}g[I]=t[I]}}}}function JW(i,A){for(;i;){const e=Object.getOwnPropertyDescriptor(i,A);if(e)return e;i=Object.getPrototypeOf(i)}}function IN(i){switch(typeof i){case"number":case"string":case"boolean":return!0}return!1}function pk(i,A,e,t,g){let I=typeof A=="function"&&A.prototype===void 0,o=A;if(I)try{if(o=A==null?void 0:A.call(A,g),I=!1,o==null)return}catch(a){console.error("Error in callback",a,i)}if(e.type=o,!I&&g instanceof o)return g;if(g&&typeof g=="object"&&MW(g)){if(g.__concreteInstance)return g.__concreteInstance;const a=g;if(!a.$serializedTypes&&o.prototype.$serializedTypes&&(a.$serializedTypes=o.prototype.$serializedTypes),a.$serializedTypes&&pp(a,i,e),g&&o!==void 0)try{const B=new o;kg&&console.log("Create concrete instance for persistent asset",g,"instance:",B),Rr(B,g),g.__concreteInstance=B,g=B}catch(B){console.error("Error creating instance or creating values on instance",B,g,o)}return g}if(t||(t={serializer:Dp.getSerializerForConstructor(o)}),Array.isArray(i)){const a=[];for(let B=0;B<i.length;B++){const Q=i[B],E=pk(Q,A,e,t,Q);a.push(E)}return a}const C=t.serializer;if(C)return C.onDeserialize(i,e);let s;if(i&&(i.isMaterial||i.isTexture||i.isObject3D))s=i;else{if(i===void 0)return;if(i===null&&(o===Ke||o===He||o===fA||o===Do))return null;s=new o(...qW(i))}const n=s;return n.$serializedTypes&&pp(n,i,e),s}function qW(i){if(yD.length=0,typeof i=="object"&&i!==null&&i!==void 0)for(const A of Object.keys(i))yD.push(i[A]);return yD}const fk=Symbol("assigned component properties");function Rr(i,A,e){var g;if(A==null||i==null)return;i[fk]=!0;const t=((g=i.constructor)==null?void 0:g.name)??"unknown";e==null||e.registerDefinedKeys(t,i);for(const I of Object.keys(A)){const o=bW(i,I);typeof(o==null?void 0:o.value)!="function"&&(!o||o.writable===!0||(o==null?void 0:o.set)!==void 0)&&(i[I]=A[I])}delete i[fk]}function bW(i,A){let e;do e=Object.getOwnPropertyDescriptor(i,A);while(!e&&(i=Object.getPrototypeOf(i)));return e}const PI=QA("debuginput");class SD{constructor(A){r(this,"key");r(this,"keyType");r(this,"source");this.key=A.key,this.keyType=A.type,this.source=A}}var dC=(i=>(i.PointerDown="pointerdown",i.PointerUp="pointerup",i.PointerMove="pointermove",i.KeyDown="keydown",i.KeyUp="keyup",i.KeyPressed="keypress",i))(dC||{}),wL=(i=>(i.Mouse="mouse",i.Touch="touch",i))(wL||{});class yL extends EventTarget{constructor(e){super();r(this,"_doubleClickTimeThreshold",.2);r(this,"_longPressTimeThreshold",1);r(this,"_specialCursorTrigger",0);r(this,"context");r(this,"_pointerDown",[!1]);r(this,"_pointerUp",[!1]);r(this,"_pointerClick",[!1]);r(this,"_pointerDoubleClick",[!1]);r(this,"_pointerPressed",[!1]);r(this,"_pointerPositions",[new j]);r(this,"_pointerPositionsLastFrame",[new j]);r(this,"_pointerPositionsDelta",[new j]);r(this,"_pointerPositionsRC",[new j]);r(this,"_pointerPositionDown",[new j]);r(this,"_pointerDownTime",[]);r(this,"_pointerUpTime",[]);r(this,"_pointerUpTimestamp",[]);r(this,"_pointerIds",[]);r(this,"_pointerTypes",[""]);r(this,"_mouseWheelChanged",[!1]);r(this,"_mouseWheelDeltaY",[0]);r(this,"_pointerEvent",[]);r(this,"_pointerUsed",[]);r(this,"keysPressed",{});this.context=e,this.context.post_render_callbacks.push(this.onEndOfFrame.bind(this)),window.addEventListener("touchstart",this.onTouchStart.bind(this),!1),window.addEventListener("touchmove",this.onTouchMove.bind(this),{passive:!0}),window.addEventListener("touchend",this.onTouchUp.bind(this),!1),window.addEventListener("mousedown",this.onMouseDown.bind(this),!1),window.addEventListener("mousemove",this.onMouseMove.bind(this),!1),window.addEventListener("mouseup",this.onMouseUp.bind(this),!1),window.addEventListener("wheel",this.onMouseWheel.bind(this),{passive:!0}),window.addEventListener("keydown",this.onKeyDown.bind(this),!1),window.addEventListener("keypress",this.onKeyPressed.bind(this),!1),window.addEventListener("keyup",this.onKeyUp.bind(this),!1),window.addEventListener("blur",this.onLostFocus.bind(this))}get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}setCursorPointer(){this._specialCursorTrigger+=1,this.context.domElement.style.cursor="pointer"}setCursorNormal(){this._specialCursorTrigger-=1,this._specialCursorTrigger=Math.max(0,this._specialCursorTrigger),this._specialCursorTrigger===0&&(this.context.domElement.style.cursor="default")}setPointerUsed(e,t=!0){if(e>=this._pointerUsed.length){if(e>=this._pointerIds.length)return;for(;this._pointerUsed.length<=e;)this._pointerUsed.push(!1)}this._pointerUsed[e]=t}getPointerUsed(e){return e>=this._pointerUsed.length?!1:this._pointerUsed[e]}getPointerPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&e++;return e}getPointerPosition(e){return e>=this._pointerPositions.length?null:this._pointerPositions[e]}getPointerPositionLastFrame(e){return e>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[e]}getPointerPositionDelta(e){return e>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[e]}getPointerPositionRC(e){return e>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[e]}getPointerDown(e){return e>=this._pointerDown.length?!1:this._pointerDown[e]}getPointerUp(e){return e>=this._pointerUp.length?!1:this._pointerUp[e]}getPointerPressed(e){return e>=this._pointerPressed.length?!1:this._pointerPressed[e]}getPointerClicked(e){return e>=this._pointerClick.length?!1:this._pointerClick[e]}getPointerDoubleClicked(e){return e>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[e]}getPointerDownTime(e){return e>=this._pointerDownTime.length?-1:this._pointerDownTime[e]}getPointerUpTime(e){return e>=this._pointerUpTime.length?-1:this._pointerUpTime[e]}getPointerLongPress(e){return e>=this._pointerDownTime.length?!1:this.getPointerPressed(e)&&this.context.time.time-this._pointerDownTime[e]>this._longPressTimeThreshold}getIsMouse(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="mouse"}getIsTouch(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="touch"}getTouchesPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&this.getIsTouch(t)&&e++;return e}getMouseWheelChanged(e=0){return e>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[e]}getMouseWheelDeltaY(e=0){return e>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[e]}getPointerEvent(e){if(!(e>=this._pointerEvent.length))return this._pointerEvent[e]??void 0}*foreachPointerId(e){for(let t=0;t<this._pointerTypes.length;t++)if(this._pointerIsActive(t)){if(e!==void 0){const g=this._pointerTypes[t];if(Array.isArray(e)){let I=!1;for(const o of e)if(g===o){I=!0;break}if(!I)continue}else if(e!==g)continue}yield t}}*foreachTouchId(){for(let e=0;e<this._pointerTypes.length;e++)this._pointerTypes[e]==="touch"&&this._pointerIsActive[e]&&(yield e)}_pointerIsActive(e){return e<0?!1:this._pointerPressed[e]||this._pointerDown[e]||this._pointerUp[e]}getKeyDown(){for(const e in this.keysPressed){const t=this.keysPressed[e];if(t.startFrame===this.context.time.frameCount)return t.key}return null}getKeyPressed(){for(const e in this.keysPressed){const t=this.keysPressed[e];if(t.pressed)return t.key}return null}isKeyDown(e){var g;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const I of t)if(this.isKeyDown(I))return!0;return!1}return((g=this.keysPressed[e])==null?void 0:g.startFrame)===this.context.time.frameCount&&this.keysPressed[e].pressed}isKeyUp(e){var g;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const I of t)if(this.isKeyUp(I))return!0;return!1}return((g=this.keysPressed[e])==null?void 0:g.frame)===this.context.time.frameCount&&!this.keysPressed[e].pressed}isKeyPressed(e){var g;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const I of t)if(this.isKeyPressed(I))return!0;return!1}return(g=this.keysPressed[e])==null?void 0:g.pressed}getCodeForCommonKeyName(e){if(e.length===1){if(e>="0"&&e<="9")return["Digit"+e];if(e>="a"&&e<="z")return["Key"+e.toUpperCase()];if(e==" ")return["Space"]}switch(e){case"Shift":return["ShiftLeft","ShiftRight"];case"Control":return["ControlLeft","ControlRight"];case"Alt":return["AltLeft","AltRight"]}return null}createPointerDown(e){PI&&Bg("Create Pointer down"),this.onDown(e)}createPointerMove(e){PI&&Bg("Create Pointer move"),this.onMove(e)}createPointerUp(e){PI&&Bg("Create Pointer up"),this.onUp(e)}convertScreenspaceToRaycastSpace(e){e.x=(e.x-this.context.domX)/this.context.domWidth*2-1,e.y=-((e.y-this.context.domY)/this.context.domHeight)*2+1}onLostFocus(){for(const e in this.keysPressed)this.keysPressed[e].pressed=!1}onEndOfFrame(){for(let e=0;e<this._pointerUp.length;e++)this._pointerUp[e]=!1;for(let e=0;e<this._pointerDown.length;e++)this._pointerDown[e]=!1;for(let e=0;e<this._pointerClick.length;e++)this._pointerClick[e]=!1;for(let e=0;e<this._pointerDoubleClick.length;e++)this._pointerDoubleClick[e]=!1;for(const e of this._pointerPositionsDelta)e.set(0,0);for(let e=0;e<this._mouseWheelChanged.length;e++)this._mouseWheelChanged[e]=!1;for(let e=0;e<this._mouseWheelDeltaY.length;e++)this._mouseWheelDeltaY[e]=0}canReceiveInput(e){return e.target===this.context.renderer.domElement}onKeyDown(e){if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];t&&t.pressed||(this.keysPressed[e.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:e.key,code:e.code},this.onDispatchEvent("keydown",new SD(e)))}onKeyPressed(e){if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];t&&(t.pressed=!0,t.frame=this.context.time.frameCount+1,this.onDispatchEvent("keypress",new SD(e)))}onKeyUp(e){if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];t&&(t.pressed=!1,t.frame=this.context.time.frameCount+1,this.onDispatchEvent("keyup",new SD(e)))}onMouseWheel(e){if(this.canReceiveInput(e)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const t=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=t+e.deltaY}onTouchStart(e){if(!(e.changedTouches.length<=0)&&this.canReceiveInput(e)!==!1)for(let t=0;t<e.changedTouches.length;t++){const g=e.changedTouches[t],I=this.getPointerIndex(g.identifier);PI&&Bg(`touch start #${I}, identifier:${g.identifier}`);const o={button:I,clientX:g.clientX,clientY:g.clientY,pointerType:"touch",source:e};this.onDown(o)}}onTouchMove(e){if(!(e.changedTouches.length<=0))for(let t=0;t<e.changedTouches.length;t++){const g=e.changedTouches[t],o={button:this.getPointerIndex(g.identifier),clientX:g.clientX,clientY:g.clientY,pointerType:"touch",source:e};this.onMove(o)}}onTouchUp(e){if(!(e.changedTouches.length<=0))for(let t=0;t<e.changedTouches.length;t++){const g=e.changedTouches[t],I=this.getPointerIndex(g.identifier);if(!this.isNewEvent(e.timeStamp,I,this._pointerUpTimestamp))continue;PI&&Bg(`touch up #${I}, identifier:${g.identifier}`);const o={button:I,clientX:g.clientX,clientY:g.clientY,pointerType:"touch",source:e};this.onUp(o)}}onMouseDown(e){if(e.defaultPrevented||this.canReceiveInput(e)===!1)return;let t=e.button;this.onDown({button:t,clientX:e.clientX,clientY:e.clientY,pointerType:"mouse",source:e})}onMouseMove(e){if(e.defaultPrevented)return;const g={button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:"mouse",source:e,movementX:e.movementX,movementY:e.movementY};this.onMove(g)}onMouseUp(e){if(e.defaultPrevented)return;let t=e.button;this.isNewEvent(e.timeStamp,t,this._pointerUpTimestamp)&&this.onUp({button:t,clientX:e.clientX,clientY:e.clientY,pointerType:"mouse",source:e})}isNewEvent(e,t,g){for(;g.length<=t;)g.push(-1);return e===g[t]?!1:(g[t]=e,!0)}isInRect(e){if(this.context.isInXR)return!0;const t=this.context.domElement.getBoundingClientRect(),g=e.clientX,I=e.clientY,o=g>=t.x&&g<=t.right&&I>=t.y&&I<=t.bottom;return PI&&!o&&console.log("Not in rect",t,g,I),o}onDown(e){var t;if(PI&&console.log(e.pointerType,"DOWN",e.button),!!this.isInRect(e)){if(e.pointerType==="mouse"){const g=this._pointerUpTimestamp[e.button];if(g>0&&g===((t=e.source)==null?void 0:t.timeStamp)){PI&&console.log("Ignoring mouse.down for touch.up");return}}for(this.setPointerState(e.button,this._pointerPressed,!0),this.setPointerState(e.button,this._pointerDown,!0),this.setPointerStateT(e.button,this._pointerEvent,e.source);e.button>=this._pointerTypes.length;)this._pointerTypes.push(e.pointerType);for(this._pointerTypes[e.button]=e.pointerType;e.button>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new j);for(this._pointerPositionDown[e.button].set(e.clientX,e.clientY);e.button>=this._pointerPositions.length;)this._pointerPositions.push(new j);this._pointerPositions[e.button].set(e.clientX,e.clientY),e.button>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[e.button]=this.context.time.time,this.updatePointerPosition(e),this.onDispatchEvent("pointerdown",e)}}onMove(e){const t=this.getPointerPressed(e.button);t===!1&&!this.isInRect(e)||e.pointerType==="touch"&&!t||(PI&&console.log(e.pointerType,"MOVE",e.button),this.updatePointerPosition(e),this.setPointerStateT(e.button,this._pointerEvent,e.source),this.onDispatchEvent("pointermove",e))}onUp(e){var o;if(((o=this._pointerIds)==null?void 0:o.length)>=e.button&&(this._pointerIds[e.button]=-1),!this._pointerPressed[e.button]){PI&&console.log(e.pointerType,"UP",e.button,"was not down");return}for(PI&&console.log(e.pointerType,"UP",e.button),this.setPointerState(e.button,this._pointerPressed,!1),this.setPointerStateT(e.button,this._pointerEvent,e.source),this.setPointerState(e.button,this._pointerUp,!0);e.button>=this._pointerUsed.length;)this._pointerUsed.push(!1);if(this.setPointerState(e.button,this._pointerUsed,!1),this.updatePointerPosition(e),!this._pointerPositionDown[e.button]){PI&&tC("Received pointer up event without matching down event for button: "+e.button),console.warn("Received pointer up event without matching down event for button: "+e.button);return}const g=e.clientX-this._pointerPositionDown[e.button].x,I=e.clientY-this._pointerPositionDown[e.button].y;if(e.button>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),Math.abs(g)<5&&Math.abs(I)<5){this.setPointerState(e.button,this._pointerClick,!0);const C=this._pointerUpTime[e.button],s=this.context.time.time-C;s<this._doubleClickTimeThreshold&&s>0&&this.setPointerState(e.button,this._pointerDoubleClick,!0)}this._pointerUpTime[e.button]=this.context.time.time,this.onDispatchEvent("pointerup",e)}updatePointerPosition(e){for(;e.button>=this._pointerPositions.length;)this._pointerPositions.push(new j);for(;e.button>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new j);for(;e.button>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new j);const t=this._pointerPositionsLastFrame[e.button];t.copy(this._pointerPositions[e.button]);const g=this._pointerPositionsDelta[e.button],I=e.clientX-t.x,o=e.clientY-t.y;g.x+=I,g.y+=o,this._pointerPositions[e.button].x=e.clientX,this._pointerPositions[e.button].y=e.clientY;const C=e.clientX,s=e.clientY;for(;e.button>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new j);const n=this._pointerPositionsRC[e.button];n.set(C,s),this.convertScreenspaceToRaycastSpace(n)}getPointerIndex(e){const t=this._pointerIds;let g=-1;for(let I=0;I<t.length;I++){if(t[I]===e)return I;g===-1&&t[I]===-1&&(g=I)}return g!==-1?(t[g]=e,g):(t.push(e),t.length-1)}setPointerState(e,t,g){for(;t.length<=e;)t.push(!1);t[e]=g}setPointerStateT(e,t,g){for(;t.length<=e;)t.push(null);t[e]=g}onDispatchEvent(e,t){const g=pe.Current;try{pe.Current=this.context;const I=new Event(e);Rr(I,t),this.dispatchEvent(I)}finally{pe.Current=g}}}class LW{constructor(){r(this,"Rad2Deg",180/Math.PI);r(this,"Deg2Rad",Math.PI/180);r(this,"Epsilon",1e-5)}random(){return Math.random()}clamp(A,e,t){return A<e?e:A>t?t:A}clamp01(A){return this.clamp(A,0,1)}lerp(A,e,t){return t=t<0?0:t,t=t>1?1:t,A+(e-A)*t}inverseLerp(A,e,t){return(t-A)/(e-A)}remap(A,e,t,g,I){return g+(I-g)*(A-e)/(t-e)}moveTowards(A,e,t){return A+=t,(t<0&&A<e||t>0&&A>e)&&(A=e),A}toDegrees(A){return A*180/Math.PI}toRadians(A){return A*Math.PI/180}tan(A){return Math.tan(A)}gammaToLinear(A){return Math.pow(A,2.2)}linearToGamma(A){return Math.pow(A,1/2.2)}}const ee=new LW;function SL(i,A,e){const t=i.length(),g=A.length(),I=ee.lerp(t,g,e);return i.lerp(A,e).normalize().multiplyScalar(I)}const vW=new SA().setFromAxisAngle(new k(0,1,0),Math.PI);function xW(i,A){i.lookAt(A),i.quaternion.multiply(vW)}const kM=new Sr(()=>new k,100);function Se(i,A=null,e=!0){const t=A??kM.get();return i?i.parent?(e&&i.updateWorldMatrix(!0,!1),i.matrixWorldNeedsUpdate&&i.updateMatrixWorld(),t.setFromMatrixPosition(i.matrixWorld),t):t.copy(i.position):t.set(0,0,0)}function Mi(i,A){if(!i)return;const e=kM.get();A!==e&&e.copy(A),((i==null?void 0:i.parent)??i).worldToLocal(e),i.position.set(e.x,e.y,e.z)}function NQ(i,A,e,t){const g=kM.get();g.set(A,e,t),Mi(i,g)}const dr=new SA,xh=new SA,dS=new SA;function Ag(i,A=null){if(!i)return xh.set(0,0,0,1);const e=A??xh;return i.parent?(i.getWorldQuaternion(e),e):e.copy(i.quaternion)}function cI(i,A){if(!i)return;A!==dr&&dr.copy(A);const e=dr,t=i==null?void 0:i.parent;t==null||t.getWorldQuaternion(dS),dS.invert();const g=dS.multiply(e);i.quaternion.set(g.x,g.y,g.z,g.w)}function kL(i,A,e,t,g){dr.set(A,e,t,g),cI(i,dr)}const Ru=new k,YW=new k;function ag(i,A=null){return i?i.parent?(i.getWorldScale(A??Ru),A??Ru):Ru.copy(i.scale):Ru.set(0,0,0)}function wk(i,A){if(!i)return;if(!i.parent){i.scale.copy(A);return}const e=YW;i.parent.getWorldScale(e),i.scale.copy(A),i.scale.divide(e)}const TW=new k,oN=new SA;function HW(i){return Ag(i,oN),TW.set(0,0,1).applyQuaternion(oN)}const CN=new Gi,sN=new Gi,_W=new k;function GL(i){return i.getWorldQuaternion(xh),sN.setFromQuaternion(xh),sN}function ML(i,A){cI(i,xh.setFromEuler(A))}function GM(i){const A=GL(i),e=_W;return e.set(A.x,A.y,A.z),e.x=ee.toDegrees(e.x),e.y=ee.toDegrees(e.y),e.z=ee.toDegrees(e.z),e}function OW(i,A){Of(i,A.x,A.y,A.z,!0)}function Of(i,A,e,t,g=!0){g&&(A=ee.toRadians(A),e=ee.toRadians(e),t=ee.toRadians(t)),CN.set(A,e,t),dr.setFromEuler(CN),cI(i,dr)}function fp(i,A=!0){i&&(A?function e(t){console.groupCollapsed((t.name?t.name:"(no name : "+t.type+")")+" %o",t),t.children.forEach(e),console.groupEnd()}(i):i.traverse(function(e){for(var t="|___",g=e;g.parent!==null;)t=" "+t,g=g.parent;console.log(t+e.name+" <"+e.type+">")}))}function mL(i){if(i){const A=i;return A.blendMode!==void 0&&A.clampWhenFinished!==void 0&&A.enabled!==void 0&&A.fadeIn!==void 0&&A.getClip!==void 0}return!1}const CQ=class{static createBlitMaterial(A){return new Ze({uniforms:{map:new yA(null)},vertexShader:this.vertex,fragmentShader:A})}static copyTexture(A,e){const t=e??this.blipMaterial;t.uniforms.map.value=A,t.needsUpdate=!0,t.uniformsNeedUpdate=!0;const g=this.mesh;g.material=t,g.frustumCulled=!1,this.scene.children.length=0,this.scene.add(g),this.renderer.setSize(A.image.width,A.image.height),this.renderer.clear(),this.renderer.render(this.scene,this.perspectiveCam);const I=new He(this.renderer.domElement);return I.name="Copy",I.needsUpdate=!0,I}static textureToCanvas(A,e){if(!A)return null;(e===!0||A.isCompressedTexture===!0)&&(A=RL(A));const t=A.image;if(WW(t)){const g=document.createElement("canvas");g.width=t.width,g.height=t.height;const I=g.getContext("2d");return I?(I.drawImage(t,0,0,t.width,t.height,0,0,g.width,g.height),g):(console.error("Failed getting canvas 2d context"),null)}return null}};let GI=CQ;r(GI,"planeGeometry",new ig(2,2,1,1)),r(GI,"renderer",new jQ({antialias:!1})),r(GI,"perspectiveCam",new it),r(GI,"scene",new uo),r(GI,"vertex",`
|
|
3243
|
+
<a href="https://docs.needle.tools/serializable" target="_blank">documentation</a>`),console.warn(t,o,i[o],i);continue}}}}function KW(i,A){for(const e of Object.keys(A)){const t=A[e];if(typeof t=="object"&&t!==null&&t!==void 0){const g=i[e];if(!g){ls&&console.log(e,"is undefined on",i);continue}for(const I of Object.keys(t))if(g[I]===void 0&&IN(t[I])&&!IN(g)){const C=JW(g,I);if((C==null?void 0:C.writable)===!1&&C&&C.set===void 0){ls&&console.warn('Property is not writable "'+I+'"',g,C,t[I],g[I]);continue}g[I]=t[I]}}}}function JW(i,A){for(;i;){const e=Object.getOwnPropertyDescriptor(i,A);if(e)return e;i=Object.getPrototypeOf(i)}}function IN(i){switch(typeof i){case"number":case"string":case"boolean":return!0}return!1}function pk(i,A,e,t,g){let I=typeof A=="function"&&A.prototype===void 0,o=A;if(I)try{if(o=A==null?void 0:A.call(A,g),I=!1,o==null)return}catch(a){console.error("Error in callback",a,i)}if(e.type=o,!I&&g instanceof o)return g;if(g&&typeof g=="object"&&MW(g)){if(g.__concreteInstance)return g.__concreteInstance;const a=g;if(!a.$serializedTypes&&o.prototype.$serializedTypes&&(a.$serializedTypes=o.prototype.$serializedTypes),a.$serializedTypes&&pp(a,i,e),g&&o!==void 0)try{const B=new o;kg&&console.log("Create concrete instance for persistent asset",g,"instance:",B),Rr(B,g),g.__concreteInstance=B,g=B}catch(B){console.error("Error creating instance or creating values on instance",B,g,o)}return g}if(t||(t={serializer:Dp.getSerializerForConstructor(o)}),Array.isArray(i)){const a=[];for(let B=0;B<i.length;B++){const Q=i[B],E=pk(Q,A,e,t,Q);a.push(E)}return a}const C=t.serializer;if(C)return C.onDeserialize(i,e);let s;if(i&&(i.isMaterial||i.isTexture||i.isObject3D))s=i;else{if(i===void 0)return;if(i===null&&(o===Ke||o===He||o===fA||o===Do))return null;s=new o(...qW(i))}const n=s;return n.$serializedTypes&&pp(n,i,e),s}function qW(i){if(yD.length=0,typeof i=="object"&&i!==null&&i!==void 0)for(const A of Object.keys(i))yD.push(i[A]);return yD}const fk=Symbol("assigned component properties");function Rr(i,A,e){var g;if(A==null||i==null)return;i[fk]=!0;const t=((g=i.constructor)==null?void 0:g.name)??"unknown";e==null||e.registerDefinedKeys(t,i);for(const I of Object.keys(A)){const o=bW(i,I);typeof(o==null?void 0:o.value)!="function"&&(!o||o.writable===!0||(o==null?void 0:o.set)!==void 0)&&(i[I]=A[I])}delete i[fk]}function bW(i,A){let e;do e=Object.getOwnPropertyDescriptor(i,A);while(!e&&(i=Object.getPrototypeOf(i)));return e}const PI=QA("debuginput");class SD{constructor(A){r(this,"key");r(this,"keyType");r(this,"source");this.key=A.key,this.keyType=A.type,this.source=A}}var dC=(i=>(i.PointerDown="pointerdown",i.PointerUp="pointerup",i.PointerMove="pointermove",i.KeyDown="keydown",i.KeyUp="keyup",i.KeyPressed="keypress",i))(dC||{}),wL=(i=>(i.Mouse="mouse",i.Touch="touch",i))(wL||{});class yL extends EventTarget{constructor(e){super();r(this,"_doubleClickTimeThreshold",.2);r(this,"_longPressTimeThreshold",1);r(this,"_specialCursorTrigger",0);r(this,"context");r(this,"_pointerDown",[!1]);r(this,"_pointerUp",[!1]);r(this,"_pointerClick",[!1]);r(this,"_pointerDoubleClick",[!1]);r(this,"_pointerPressed",[!1]);r(this,"_pointerPositions",[new j]);r(this,"_pointerPositionsLastFrame",[new j]);r(this,"_pointerPositionsDelta",[new j]);r(this,"_pointerPositionsRC",[new j]);r(this,"_pointerPositionDown",[new j]);r(this,"_pointerDownTime",[]);r(this,"_pointerUpTime",[]);r(this,"_pointerUpTimestamp",[]);r(this,"_pointerIds",[]);r(this,"_pointerTypes",[""]);r(this,"_mouseWheelChanged",[!1]);r(this,"_mouseWheelDeltaY",[0]);r(this,"_pointerEvent",[]);r(this,"_pointerUsed",[]);r(this,"keysPressed",{});this.context=e,this.context.post_render_callbacks.push(this.onEndOfFrame.bind(this)),window.addEventListener("touchstart",this.onTouchStart.bind(this),!1),window.addEventListener("touchmove",this.onTouchMove.bind(this),{passive:!0}),window.addEventListener("touchend",this.onTouchUp.bind(this),!1),window.addEventListener("mousedown",this.onMouseDown.bind(this),!1),window.addEventListener("mousemove",this.onMouseMove.bind(this),!1),window.addEventListener("mouseup",this.onMouseUp.bind(this),!1),window.addEventListener("wheel",this.onMouseWheel.bind(this),{passive:!0}),window.addEventListener("keydown",this.onKeyDown.bind(this),!1),window.addEventListener("keypress",this.onKeyPressed.bind(this),!1),window.addEventListener("keyup",this.onKeyUp.bind(this),!1),window.addEventListener("blur",this.onLostFocus.bind(this))}get mousePosition(){return this._pointerPositions[0]}get mousePositionRC(){return this._pointerPositionsRC[0]}get mouseDown(){return this._pointerDown[0]}get mouseUp(){return this._pointerUp[0]}get mouseClick(){return this._pointerClick[0]}get mouseDoubleClick(){return this._pointerDoubleClick[0]}get mousePressed(){return this._pointerPressed[0]}get mouseWheelChanged(){return this.getMouseWheelChanged(0)}setCursorPointer(){this._specialCursorTrigger+=1,this.context.domElement.style.cursor="pointer"}setCursorNormal(){this._specialCursorTrigger-=1,this._specialCursorTrigger=Math.max(0,this._specialCursorTrigger),this._specialCursorTrigger===0&&(this.context.domElement.style.cursor="default")}setPointerUsed(e,t=!0){if(e>=this._pointerUsed.length){if(e>=this._pointerIds.length)return;for(;this._pointerUsed.length<=e;)this._pointerUsed.push(!1)}this._pointerUsed[e]=t}getPointerUsed(e){return e>=this._pointerUsed.length?!1:this._pointerUsed[e]}getPointerPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&e++;return e}getPointerPosition(e){return e>=this._pointerPositions.length?null:this._pointerPositions[e]}getPointerPositionLastFrame(e){return e>=this._pointerPositionsLastFrame.length?null:this._pointerPositionsLastFrame[e]}getPointerPositionDelta(e){return e>=this._pointerPositionsDelta.length?null:this._pointerPositionsDelta[e]}getPointerPositionRC(e){return e>=this._pointerPositionsRC.length?null:this._pointerPositionsRC[e]}getPointerDown(e){return e>=this._pointerDown.length?!1:this._pointerDown[e]}getPointerUp(e){return e>=this._pointerUp.length?!1:this._pointerUp[e]}getPointerPressed(e){return e>=this._pointerPressed.length?!1:this._pointerPressed[e]}getPointerClicked(e){return e>=this._pointerClick.length?!1:this._pointerClick[e]}getPointerDoubleClicked(e){return e>=this._pointerDoubleClick.length?!1:this._pointerDoubleClick[e]}getPointerDownTime(e){return e>=this._pointerDownTime.length?-1:this._pointerDownTime[e]}getPointerUpTime(e){return e>=this._pointerUpTime.length?-1:this._pointerUpTime[e]}getPointerLongPress(e){return e>=this._pointerDownTime.length?!1:this.getPointerPressed(e)&&this.context.time.time-this._pointerDownTime[e]>this._longPressTimeThreshold}getIsMouse(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="mouse"}getIsTouch(e){return e<0||e>=this._pointerTypes.length?!1:this._pointerTypes[e]==="touch"}getTouchesPressedCount(){let e=0;for(let t=0;t<this._pointerPressed.length;t++)this._pointerPressed[t]&&this.getIsTouch(t)&&e++;return e}getMouseWheelChanged(e=0){return e>=this._mouseWheelChanged.length?!1:this._mouseWheelChanged[e]}getMouseWheelDeltaY(e=0){return e>=this._mouseWheelDeltaY.length?0:this._mouseWheelDeltaY[e]}getPointerEvent(e){if(!(e>=this._pointerEvent.length))return this._pointerEvent[e]??void 0}*foreachPointerId(e){for(let t=0;t<this._pointerTypes.length;t++)if(this._pointerIsActive(t)){if(e!==void 0){const g=this._pointerTypes[t];if(Array.isArray(e)){let I=!1;for(const o of e)if(g===o){I=!0;break}if(!I)continue}else if(e!==g)continue}yield t}}*foreachTouchId(){for(let e=0;e<this._pointerTypes.length;e++)this._pointerTypes[e]==="touch"&&this._pointerIsActive[e]&&(yield e)}_pointerIsActive(e){return e<0?!1:this._pointerPressed[e]||this._pointerDown[e]||this._pointerUp[e]}getKeyDown(){for(const e in this.keysPressed){const t=this.keysPressed[e];if(t.startFrame===this.context.time.frameCount)return t.key}return null}getKeyPressed(){for(const e in this.keysPressed){const t=this.keysPressed[e];if(t.pressed)return t.key}return null}isKeyDown(e){var g;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const I of t)if(this.isKeyDown(I))return!0;return!1}return((g=this.keysPressed[e])==null?void 0:g.startFrame)===this.context.time.frameCount&&this.keysPressed[e].pressed}isKeyUp(e){var g;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const I of t)if(this.isKeyUp(I))return!0;return!1}return((g=this.keysPressed[e])==null?void 0:g.frame)===this.context.time.frameCount&&!this.keysPressed[e].pressed}isKeyPressed(e){var g;if(!this.context.application.isVisible||!this.context.application.hasFocus)return!1;const t=this.getCodeForCommonKeyName(e);if(t!==null){for(const I of t)if(this.isKeyPressed(I))return!0;return!1}return(g=this.keysPressed[e])==null?void 0:g.pressed}getCodeForCommonKeyName(e){if(e.length===1){if(e>="0"&&e<="9")return["Digit"+e];if(e>="a"&&e<="z")return["Key"+e.toUpperCase()];if(e==" ")return["Space"]}switch(e){case"Shift":return["ShiftLeft","ShiftRight"];case"Control":return["ControlLeft","ControlRight"];case"Alt":return["AltLeft","AltRight"]}return null}createPointerDown(e){PI&&Bg("Create Pointer down"),this.onDown(e)}createPointerMove(e){PI&&Bg("Create Pointer move"),this.onMove(e)}createPointerUp(e){PI&&Bg("Create Pointer up"),this.onUp(e)}convertScreenspaceToRaycastSpace(e){e.x=(e.x-this.context.domX)/this.context.domWidth*2-1,e.y=-((e.y-this.context.domY)/this.context.domHeight)*2+1}onLostFocus(){for(const e in this.keysPressed)this.keysPressed[e].pressed=!1}onEndOfFrame(){for(let e=0;e<this._pointerUp.length;e++)this._pointerUp[e]=!1;for(let e=0;e<this._pointerDown.length;e++)this._pointerDown[e]=!1;for(let e=0;e<this._pointerClick.length;e++)this._pointerClick[e]=!1;for(let e=0;e<this._pointerDoubleClick.length;e++)this._pointerDoubleClick[e]=!1;for(const e of this._pointerPositionsDelta)e.set(0,0);for(let e=0;e<this._mouseWheelChanged.length;e++)this._mouseWheelChanged[e]=!1;for(let e=0;e<this._mouseWheelDeltaY.length;e++)this._mouseWheelDeltaY[e]=0}canReceiveInput(e){return e.target===this.context.renderer.domElement}onKeyDown(e){if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];t&&t.pressed||(this.keysPressed[e.code]={pressed:!0,frame:this.context.time.frameCount+1,startFrame:this.context.time.frameCount+1,key:e.key,code:e.code},this.onDispatchEvent("keydown",new SD(e)))}onKeyPressed(e){if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];t&&(t.pressed=!0,t.frame=this.context.time.frameCount+1,this.onDispatchEvent("keypress",new SD(e)))}onKeyUp(e){if(!this.context.application.hasFocus)return;const t=this.keysPressed[e.code];t&&(t.pressed=!1,t.frame=this.context.time.frameCount+1,this.onDispatchEvent("keyup",new SD(e)))}onMouseWheel(e){if(this.canReceiveInput(e)===!1)return;this._mouseWheelDeltaY.length<=0&&this._mouseWheelDeltaY.push(0),this._mouseWheelChanged.length<=0&&this._mouseWheelChanged.push(!1),this._mouseWheelChanged[0]=!0;const t=this._mouseWheelDeltaY[0];this._mouseWheelDeltaY[0]=t+e.deltaY}onTouchStart(e){if(!(e.changedTouches.length<=0)&&this.canReceiveInput(e)!==!1)for(let t=0;t<e.changedTouches.length;t++){const g=e.changedTouches[t],I=this.getPointerIndex(g.identifier);PI&&Bg(`touch start #${I}, identifier:${g.identifier}`);const o={button:I,clientX:g.clientX,clientY:g.clientY,pointerType:"touch",source:e};this.onDown(o)}}onTouchMove(e){if(!(e.changedTouches.length<=0))for(let t=0;t<e.changedTouches.length;t++){const g=e.changedTouches[t],o={button:this.getPointerIndex(g.identifier),clientX:g.clientX,clientY:g.clientY,pointerType:"touch",source:e};this.onMove(o)}}onTouchUp(e){if(!(e.changedTouches.length<=0))for(let t=0;t<e.changedTouches.length;t++){const g=e.changedTouches[t],I=this.getPointerIndex(g.identifier);if(!this.isNewEvent(e.timeStamp,I,this._pointerUpTimestamp))continue;PI&&Bg(`touch up #${I}, identifier:${g.identifier}`);const o={button:I,clientX:g.clientX,clientY:g.clientY,pointerType:"touch",source:e};this.onUp(o)}}onMouseDown(e){if(e.defaultPrevented||this.canReceiveInput(e)===!1)return;let t=e.button;this.onDown({button:t,clientX:e.clientX,clientY:e.clientY,pointerType:"mouse",source:e})}onMouseMove(e){if(e.defaultPrevented)return;const g={button:e.button,clientX:e.clientX,clientY:e.clientY,pointerType:"mouse",source:e,movementX:e.movementX,movementY:e.movementY};this.onMove(g)}onMouseUp(e){if(e.defaultPrevented)return;let t=e.button;this.isNewEvent(e.timeStamp,t,this._pointerUpTimestamp)&&this.onUp({button:t,clientX:e.clientX,clientY:e.clientY,pointerType:"mouse",source:e})}isNewEvent(e,t,g){for(;g.length<=t;)g.push(-1);return e===g[t]?!1:(g[t]=e,!0)}isInRect(e){if(this.context.isInXR)return!0;const t=this.context.domElement.getBoundingClientRect(),g=e.clientX,I=e.clientY,o=g>=t.x&&g<=t.right&&I>=t.y&&I<=t.bottom;return PI&&!o&&console.log("Not in rect",t,g,I),o}onDown(e){var t;if(PI&&console.log(e.pointerType,"DOWN",e.button),!!this.isInRect(e)){if(e.pointerType==="mouse"){const g=this._pointerUpTimestamp[e.button];if(g>0&&g===((t=e.source)==null?void 0:t.timeStamp)){PI&&console.log("Ignoring mouse.down for touch.up");return}}for(this.setPointerState(e.button,this._pointerPressed,!0),this.setPointerState(e.button,this._pointerDown,!0),this.setPointerStateT(e.button,this._pointerEvent,e.source);e.button>=this._pointerTypes.length;)this._pointerTypes.push(e.pointerType);for(this._pointerTypes[e.button]=e.pointerType;e.button>=this._pointerPositionDown.length;)this._pointerPositionDown.push(new j);for(this._pointerPositionDown[e.button].set(e.clientX,e.clientY);e.button>=this._pointerPositions.length;)this._pointerPositions.push(new j);this._pointerPositions[e.button].set(e.clientX,e.clientY),e.button>=this._pointerDownTime.length&&this._pointerDownTime.push(0),this._pointerDownTime[e.button]=this.context.time.time,this.updatePointerPosition(e),this.onDispatchEvent("pointerdown",e)}}onMove(e){const t=this.getPointerPressed(e.button);t===!1&&!this.isInRect(e)||e.pointerType==="touch"&&!t||(PI&&console.log(e.pointerType,"MOVE",e.button),this.updatePointerPosition(e),this.setPointerStateT(e.button,this._pointerEvent,e.source),this.onDispatchEvent("pointermove",e))}onUp(e){var o;if(((o=this._pointerIds)==null?void 0:o.length)>=e.button&&(this._pointerIds[e.button]=-1),!this._pointerPressed[e.button]){PI&&console.log(e.pointerType,"UP",e.button,"was not down");return}for(PI&&console.log(e.pointerType,"UP",e.button),this.setPointerState(e.button,this._pointerPressed,!1),this.setPointerStateT(e.button,this._pointerEvent,e.source),this.setPointerState(e.button,this._pointerUp,!0);e.button>=this._pointerUsed.length;)this._pointerUsed.push(!1);if(this.setPointerState(e.button,this._pointerUsed,!1),this.updatePointerPosition(e),!this._pointerPositionDown[e.button]){PI&&tC("Received pointer up event without matching down event for button: "+e.button),console.warn("Received pointer up event without matching down event for button: "+e.button);return}const g=e.clientX-this._pointerPositionDown[e.button].x,I=e.clientY-this._pointerPositionDown[e.button].y;if(e.button>=this._pointerUpTime.length&&this._pointerUpTime.push(-99),Math.abs(g)<5&&Math.abs(I)<5){this.setPointerState(e.button,this._pointerClick,!0);const C=this._pointerUpTime[e.button],s=this.context.time.time-C;s<this._doubleClickTimeThreshold&&s>0&&this.setPointerState(e.button,this._pointerDoubleClick,!0)}this._pointerUpTime[e.button]=this.context.time.time,this.onDispatchEvent("pointerup",e)}updatePointerPosition(e){for(;e.button>=this._pointerPositions.length;)this._pointerPositions.push(new j);for(;e.button>=this._pointerPositionsLastFrame.length;)this._pointerPositionsLastFrame.push(new j);for(;e.button>=this._pointerPositionsDelta.length;)this._pointerPositionsDelta.push(new j);const t=this._pointerPositionsLastFrame[e.button];t.copy(this._pointerPositions[e.button]);const g=this._pointerPositionsDelta[e.button],I=e.clientX-t.x,o=e.clientY-t.y;g.x+=I,g.y+=o,this._pointerPositions[e.button].x=e.clientX,this._pointerPositions[e.button].y=e.clientY;const C=e.clientX,s=e.clientY;for(;e.button>=this._pointerPositionsRC.length;)this._pointerPositionsRC.push(new j);const n=this._pointerPositionsRC[e.button];n.set(C,s),this.convertScreenspaceToRaycastSpace(n)}getPointerIndex(e){const t=this._pointerIds;let g=-1;for(let I=0;I<t.length;I++){if(t[I]===e)return I;g===-1&&t[I]===-1&&(g=I)}return g!==-1?(t[g]=e,g):(t.push(e),t.length-1)}setPointerState(e,t,g){for(;t.length<=e;)t.push(!1);t[e]=g}setPointerStateT(e,t,g){for(;t.length<=e;)t.push(null);t[e]=g}onDispatchEvent(e,t){const g=pe.Current;try{pe.Current=this.context;const I=new Event(e);Rr(I,t),this.dispatchEvent(I)}finally{pe.Current=g}}}class LW{constructor(){r(this,"Rad2Deg",180/Math.PI);r(this,"Deg2Rad",Math.PI/180);r(this,"Epsilon",1e-5)}random(){return Math.random()}clamp(A,e,t){return A<e?e:A>t?t:A}clamp01(A){return this.clamp(A,0,1)}lerp(A,e,t){return t=t<0?0:t,t=t>1?1:t,A+(e-A)*t}inverseLerp(A,e,t){return(t-A)/(e-A)}remap(A,e,t,g,I){return g+(I-g)*(A-e)/(t-e)}moveTowards(A,e,t){return A+=t,(t<0&&A<e||t>0&&A>e)&&(A=e),A}toDegrees(A){return A*180/Math.PI}toRadians(A){return A*Math.PI/180}tan(A){return Math.tan(A)}gammaToLinear(A){return Math.pow(A,2.2)}linearToGamma(A){return Math.pow(A,1/2.2)}}const ee=new LW;function SL(i,A,e){const t=i.length(),g=A.length(),I=ee.lerp(t,g,e);return i.lerp(A,e).normalize().multiplyScalar(I)}const vW=new SA().setFromAxisAngle(new k(0,1,0),Math.PI);function xW(i,A){i.lookAt(A),i.quaternion.multiply(vW)}const kM=new Sr(()=>new k,100);function Se(i,A=null,e=!0){const t=A??kM.get();return i?i.parent?(e&&i.updateWorldMatrix(!0,!1),i.matrixWorldNeedsUpdate&&i.updateMatrixWorld(),t.setFromMatrixPosition(i.matrixWorld),t):t.copy(i.position):t.set(0,0,0)}function Mi(i,A){if(!i)return;const e=kM.get();A!==e&&e.copy(A),((i==null?void 0:i.parent)??i).worldToLocal(e),i.position.set(e.x,e.y,e.z)}function NQ(i,A,e,t){const g=kM.get();g.set(A,e,t),Mi(i,g)}const dr=new SA,xh=new SA,dS=new SA;function Ag(i,A=null){if(!i)return xh.set(0,0,0,1);const e=A??xh;return i.parent?(i.getWorldQuaternion(e),e):e.copy(i.quaternion)}function cI(i,A){if(!i)return;A!==dr&&dr.copy(A);const e=dr,t=i==null?void 0:i.parent;t==null||t.getWorldQuaternion(dS),dS.invert();const g=dS.multiply(e);i.quaternion.set(g.x,g.y,g.z,g.w)}function kL(i,A,e,t,g){dr.set(A,e,t,g),cI(i,dr)}const Ru=new k,YW=new k;function ag(i,A=null){return i?i.parent?(i.getWorldScale(A??Ru),A??Ru):Ru.copy(i.scale):Ru.set(0,0,0)}function wk(i,A){if(!i)return;if(!i.parent){i.scale.copy(A);return}const e=YW;i.parent.getWorldScale(e),i.scale.copy(A),i.scale.divide(e)}const TW=new k,oN=new SA;function HW(i){return Ag(i,oN),TW.set(0,0,1).applyQuaternion(oN)}const CN=new Gi,sN=new Gi,_W=new k;function GL(i){return i.getWorldQuaternion(xh),sN.setFromQuaternion(xh),sN}function ML(i,A){cI(i,xh.setFromEuler(A))}function GM(i){const A=GL(i),e=_W;return e.set(A.x,A.y,A.z),e.x=ee.toDegrees(e.x),e.y=ee.toDegrees(e.y),e.z=ee.toDegrees(e.z),e}function OW(i,A){Of(i,A.x,A.y,A.z,!0)}function Of(i,A,e,t,g=!0){g&&(A=ee.toRadians(A),e=ee.toRadians(e),t=ee.toRadians(t)),CN.set(A,e,t),dr.setFromEuler(CN),cI(i,dr)}function fp(i,A=!0){i&&(A?function e(t){console.groupCollapsed((t.name?t.name:"(no name : "+t.type+")")+" %o",t),t.children.forEach(e),console.groupEnd()}(i):i.traverse(function(e){for(var t="|___",g=e;g.parent!==null;)t=" "+t,g=g.parent;console.log(t+e.name+" <"+e.type+">")}))}function mL(i){if(i){const A=i;return A.blendMode!==void 0&&A.clampWhenFinished!==void 0&&A.enabled!==void 0&&A.fadeIn!==void 0&&A.getClip!==void 0}return!1}const CQ=class{static createBlitMaterial(A){return new Ze({uniforms:{map:new yA(null)},vertexShader:this.vertex,fragmentShader:A})}static copyTexture(A,e){const t=e??this.blipMaterial;t.uniforms.map.value=A,t.needsUpdate=!0,t.uniformsNeedUpdate=!0;const g=this.mesh;g.material=t,g.frustumCulled=!1,this.scene.children.length=0,this.scene.add(g),this.renderer.setSize(A.image.width,A.image.height),this.renderer.clear(),this.renderer.render(this.scene,this.perspectiveCam);const I=new He(this.renderer.domElement);return I.name="Copy",I.needsUpdate=!0,I}static textureToCanvas(A,e){if(!A)return null;(e===!0||A.isCompressedTexture===!0)&&(A=RL(A));const t=A.image;if(WW(t)){const g=document.createElement("canvas");g.width=t.width,g.height=t.height;const I=g.getContext("2d");return I?(I.drawImage(t,0,0,t.width,t.height,0,0,g.width,g.height),g):(console.error("Failed getting canvas 2d context"),null)}return null}};let GI=CQ;r(GI,"planeGeometry",new ig(2,2,1,1)),r(GI,"renderer",new jQ({antialias:!1})),r(GI,"perspectiveCam",new it),r(GI,"scene",new uo),r(GI,"vertex",`
|
|
3244
3244
|
varying vec2 vUv;
|
|
3245
3245
|
void main(){
|
|
3246
3246
|
vUv = uv;
|
|
@@ -359,7 +359,7 @@ function implictlyAssignPrimitiveTypes(obj, serializedData) {
|
|
|
359
359
|
// resolve serialized primitive types
|
|
360
360
|
if (isPrimitiveType(data[key]) && !isPrimitiveType(member)) {
|
|
361
361
|
const prop = tryFindPropertyDescriptor(member, key);
|
|
362
|
-
if (
|
|
362
|
+
if (prop?.writable === false && (prop && prop.set === undefined)) {
|
|
363
363
|
if (debug)
|
|
364
364
|
console.warn("Property is not writable \"" + key + "\"", member, prop, data[key], member[key]);
|
|
365
365
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine_serialization_core.js","sourceRoot":"","sources":["../../src/engine/engine_serialization_core.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,M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