hj-gis-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +824 -0
- package/README_UERPC.md +667 -0
- package/dist/sdk.esm.js +4143 -0
- package/dist/sdk.esm.js.map +1 -0
- package/dist/sdk.js +4148 -0
- package/dist/sdk.js.map +1 -0
- package/dist/sdk.umd.js +2 -0
- package/dist/sdk.umd.js.map +1 -0
- package/dist/types/hj-gis-sdk/addons/animation/animate-clip.d.ts +39 -0
- package/dist/types/hj-gis-sdk/addons/animation/animate-clip.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/animation/animation-action.d.ts +31 -0
- package/dist/types/hj-gis-sdk/addons/animation/animation-action.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/animation/animation-mixer.d.ts +18 -0
- package/dist/types/hj-gis-sdk/addons/animation/animation-mixer.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/animation/index.d.ts +5 -0
- package/dist/types/hj-gis-sdk/addons/animation/index.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/camera.d.ts +59 -0
- package/dist/types/hj-gis-sdk/addons/camera.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/clock.d.ts +40 -0
- package/dist/types/hj-gis-sdk/addons/clock.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/commander/context.d.ts +24 -0
- package/dist/types/hj-gis-sdk/addons/commander/context.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/commander/dispatcher.d.ts +43 -0
- package/dist/types/hj-gis-sdk/addons/commander/dispatcher.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/commander/excutor/base.d.ts +22 -0
- package/dist/types/hj-gis-sdk/addons/commander/excutor/base.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/loader/index.d.ts +6 -0
- package/dist/types/hj-gis-sdk/addons/loader/index.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/loader/loader.d.ts +4 -0
- package/dist/types/hj-gis-sdk/addons/loader/loader.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/node/base.d.ts +63 -0
- package/dist/types/hj-gis-sdk/addons/node/base.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/node/ue-node.d.ts +82 -0
- package/dist/types/hj-gis-sdk/addons/node/ue-node.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/proxy.d.ts +83 -0
- package/dist/types/hj-gis-sdk/addons/proxy.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/base.d.ts +7 -0
- package/dist/types/hj-gis-sdk/addons/tools/base.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/building.d.ts +36 -0
- package/dist/types/hj-gis-sdk/addons/tools/building.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/daytime.d.ts +7 -0
- package/dist/types/hj-gis-sdk/addons/tools/daytime.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/fence.d.ts +61 -0
- package/dist/types/hj-gis-sdk/addons/tools/fence.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/ghost.d.ts +14 -0
- package/dist/types/hj-gis-sdk/addons/tools/ghost.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/heat-map.d.ts +65 -0
- package/dist/types/hj-gis-sdk/addons/tools/heat-map.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/index.d.ts +26 -0
- package/dist/types/hj-gis-sdk/addons/tools/index.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/match-view.d.ts +7 -0
- package/dist/types/hj-gis-sdk/addons/tools/match-view.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/measurement.d.ts +13 -0
- package/dist/types/hj-gis-sdk/addons/tools/measurement.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/pick-cast.d.ts +26 -0
- package/dist/types/hj-gis-sdk/addons/tools/pick-cast.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/scatter.d.ts +57 -0
- package/dist/types/hj-gis-sdk/addons/tools/scatter.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/tools/weather.d.ts +31 -0
- package/dist/types/hj-gis-sdk/addons/tools/weather.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/transform.d.ts +91 -0
- package/dist/types/hj-gis-sdk/addons/transform.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/addons/world.d.ts +76 -0
- package/dist/types/hj-gis-sdk/addons/world.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/core/ue-rpc.d.ts +54 -0
- package/dist/types/hj-gis-sdk/core/ue-rpc.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/index.d.ts +27 -0
- package/dist/types/hj-gis-sdk/index.d.ts.map +1 -0
- package/dist/types/hj-gis-sdk/utils.d.ts +16 -0
- package/dist/types/hj-gis-sdk/utils.d.ts.map +1 -0
- package/dist/types/src/animation.d.ts +2 -0
- package/dist/types/src/animation.d.ts.map +1 -0
- package/dist/types/src/building.d.ts +2 -0
- package/dist/types/src/building.d.ts.map +1 -0
- package/dist/types/src/common.d.ts +5 -0
- package/dist/types/src/common.d.ts.map +1 -0
- package/dist/types/src/fence.d.ts +2 -0
- package/dist/types/src/fence.d.ts.map +1 -0
- package/dist/types/src/ghost.d.ts +2 -0
- package/dist/types/src/ghost.d.ts.map +1 -0
- package/dist/types/src/heatmap.d.ts +2 -0
- package/dist/types/src/heatmap.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/keyframe.d.ts +2 -0
- package/dist/types/src/keyframe.d.ts.map +1 -0
- package/dist/types/src/measurement.d.ts +2 -0
- package/dist/types/src/measurement.d.ts.map +1 -0
- package/dist/types/src/scatter.d.ts +2 -0
- package/dist/types/src/scatter.d.ts.map +1 -0
- package/dist/types/src/weather.d.ts +2 -0
- package/dist/types/src/weather.d.ts.map +1 -0
- package/package.json +55 -0
package/dist/sdk.umd.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@epicgames-ps/lib-pixelstreamingfrontend-ue5.5")):"function"==typeof define&&define.amd?define(["exports","@epicgames-ps/lib-pixelstreamingfrontend-ue5.5"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).HJGISSDK={},t.libPixelstreamingfrontendUe5_5)}(this,function(t,e){"use strict";class s{constructor(t,e="handle_responses"){this.stream=t,this.responseEventName=e,this.pendingRequests=new Map,this.timeoutMs=3e4;try{this.stream.addResponseEventListener(this.responseEventName,this.handleResponse.bind(this))}catch(t){}}getStream(){return this.stream}bind(t,e=this.responseEventName){this.stream=t,this.responseEventName=e,this.stream.addResponseEventListener(this.responseEventName,this.handleResponse.bind(this))}emitCommand(t){this.stream.emitCommand(t)}call(t,e={},s){const r=this.generateUUID(),i={Type:"RPC_CALL",Command:t,ReqId:r,...e};return new Promise((e,n)=>{const a=window.setTimeout(()=>{this.pendingRequests.has(r)&&(this.pendingRequests.delete(r),n(new Error(`UE RPC Timeout: ${t}`)))},s||this.timeoutMs);this.pendingRequests.set(r,{resolve:e,reject:n,timer:a});try{this.stream.emitUIInteraction(i)}catch(t){window.clearTimeout(a),this.pendingRequests.delete(r),n(t)}})}handleResponse(t){let e=t;try{"string"==typeof t&&(e=JSON.parse(t))}catch{return}if(!e||"RPC_RESPONSE"!==e.Type)return;const s=e.ReqId;if(!s)return;const r=this.pendingRequests.get(s);if(!r)return;window.clearTimeout(r.timer),this.pendingRequests.delete(s);if("success"===e.Status)r.resolve(e.Data);else{const t=e.Message||"Unknown UE Error";r.reject(new Error(t))}}callModule(t,s,r={},i=3e4){const n=this.generateUUID(),a={Type:"RPC_CALL",ReqId:n,ModuleName:t,ActionName:s,Params:r};return e.Logger.Info(JSON.stringify(a)),new Promise((e,r)=>{const h=window.setTimeout(()=>{this.pendingRequests.has(n)&&(this.pendingRequests.delete(n),r(new Error(`UE Call Timeout: ${t}/${s}`)))},i||this.timeoutMs);this.pendingRequests.set(n,{resolve:e,reject:r,timer:h});try{this.stream.emitUIInteraction(a)}catch(t){window.clearTimeout(h),this.pendingRequests.delete(n),r(t)}})}loadLevelByName(t){return this.call("LoadLevelByName",{LevelName:t})}unLoadMap(t){return this.call("UnLoadMap",{LevelName:t})}spawnStaticMeshActor(t){return this.call("SpawnStaticMeshActor",t)}spawnLocalBlueprintActor(t){return this.call("SpawnLocalBlueprintActor",t)}setActorTransformByHandle(t,e){return this.call("SetActorTransformByHandle",{Handle:t,Transform:e})}destroyActorByHandle(t){return this.call("DestroyActorByHandle",{Handle:t})}pickPointByScreen(t,e,s=1e7,r=!1){return this.call("PickPointByScreen",{Screen:{X:t,Y:e},MaxDistance:s,Highlight:r})}getCameraTransform(){return this.call("GetCameraTransform",{})}setCameraTransform(t){return this.call("SetCameraTransform",{Transform:t})}setCameraResetTransform(t){return this.call("SetCameraResetTransform",{Transform:t})}resetCameraToSavedTransform(){return this.call("ResetCameraToSavedTransform",{})}generateUUID(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)})}}globalThis.mathgl=globalThis.mathgl||{config:{EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1}};const r=globalThis.mathgl.config;function i(t,{precision:e=r.precision}={}){return t=function(t){return Math.round(t/r.EPSILON)*r.EPSILON}(t),`${parseFloat(t.toPrecision(e))}`}function n(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function a(t,e,s){return function(t,e,s){if(n(t)){const r=t;s=s||function(t){return t.clone?t.clone():new Array(t.length)}(r);for(let i=0;i<s.length&&i<r.length;++i){const r="number"==typeof t?t:t[i];s[i]=e(r,i,s)}return s}return e(t)}(t,t=>Math.max(e,Math.min(s,t)))}function h(t,e,s){const i=r.EPSILON;s&&(r.EPSILON=s);try{if(t===e)return!0;if(n(t)&&n(e)){if(t.length!==e.length)return!1;for(let s=0;s<t.length;++s)if(!h(t[s],e[s]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):"number"==typeof t&&"number"==typeof e&&Math.abs(t-e)<=r.EPSILON*Math.max(1,Math.abs(t),Math.abs(e))}finally{r.EPSILON=i}}class o extends Array{clone(){return(new this.constructor).copy(this)}fromArray(t,e=0){for(let s=0;s<this.ELEMENTS;++s)this[s]=t[s+e];return this.check()}toArray(t=[],e=0){for(let s=0;s<this.ELEMENTS;++s)t[e+s]=this[s];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:n(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(r)}formatString(t){let e="";for(let s=0;s<this.ELEMENTS;++s)e+=(s>0?", ":"")+i(this[s],t);return`${t.printTypes?this.constructor.name:""}[${e}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(!h(this[e],t[e]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let e=0;e<this.ELEMENTS;++e)if(this[e]!==t[e])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,e,s){if(void 0===s)return this.lerp(this,t,e);for(let r=0;r<this.ELEMENTS;++r){const i=t[r],n="number"==typeof e?e:e[r];this[r]=i+s*(n-i)}return this.check()}min(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.min(t[e],this[e]);return this.check()}max(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=Math.max(t[e],this[e]);return this.check()}clamp(t,e){for(let s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],t[s]),e[s]);return this.check()}add(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]+=e[t];return this.check()}subtract(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]-=e[t];return this.check()}scale(t){if("number"==typeof t)for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;else for(let e=0;e<this.ELEMENTS&&e<t.length;++e)this[e]*=t[e];return this.check()}multiplyByScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}check(){if(r.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let e=0;e<this.ELEMENTS;++e)t=t&&Number.isFinite(this[e]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]=t;return this.check()}addScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let e=0;e<this.ELEMENTS;++e)this[e]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,e){for(let s=0;s<this.ELEMENTS;++s)this[s]=Math.min(Math.max(this[s],t),e);return this.check()}get elements(){return this}}function c(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function l(t,e,s=""){if(r.debug&&!function(t,e){if(t.length!==e)return!1;for(let e=0;e<t.length;++e)if(!Number.isFinite(t[e]))return!1;return!0}(t,e))throw new Error(`math.gl: ${s} some fields set to invalid numbers'`);return t}function u(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}class d extends o{get x(){return this[0]}set x(t){this[0]=c(t)}get y(){return this[1]}set y(t){this[1]=c(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let e=0;e<this.ELEMENTS;++e)t+=this[e]*this[e];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let e=0;for(let s=0;s<this.ELEMENTS;++s){const r=this[s]-t[s];e+=r*r}return c(e)}dot(t){let e=0;for(let s=0;s<this.ELEMENTS;++s)e+=this[s]*t[s];return c(e)}normalize(){const t=this.magnitude();if(0!==t)for(let e=0;e<this.ELEMENTS;++e)this[e]/=t;return this.check()}multiply(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]*=e[t];return this.check()}divide(...t){for(const e of t)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e[t];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return u(t>=0&&t<this.ELEMENTS,"index is out of range"),c(this[t])}setComponent(t,e){return u(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=e,this.check()}addVectors(t,e){return this.copy(t).add(e)}subVectors(t,e){return this.copy(t).subtract(e)}multiplyVectors(t,e){return this.copy(t).multiply(e)}addScaledVector(t,e){return this.add(new this.constructor(t).multiplyScalar(e))}}let p="undefined"!=typeof Float32Array?Float32Array:Array;function m(){const t=new p(3);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function f(t,e,s){const r=new p(3);return r[0]=t,r[1]=e,r[2]=s,r}function g(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function y(t,e,s){const r=e[0],i=e[1],n=e[2],a=s[0],h=s[1],o=s[2];return t[0]=i*o-n*h,t[1]=n*a-r*o,t[2]=r*h-i*a,t}function M(t,e,s){const r=e[0],i=e[1],n=e[2];let a=s[3]*r+s[7]*i+s[11]*n+s[15];return a=a||1,t[0]=(s[0]*r+s[4]*i+s[8]*n+s[12])/a,t[1]=(s[1]*r+s[5]*i+s[9]*n+s[13])/a,t[2]=(s[2]*r+s[6]*i+s[10]*n+s[14])/a,t}function _(t,e,s){const r=s[0],i=s[1],n=s[2],a=s[3],h=e[0],o=e[1],c=e[2];let l=i*c-n*o,u=n*h-r*c,d=r*o-i*h,p=i*d-n*u,m=n*l-r*d,f=r*u-i*l;const g=2*a;return l*=g,u*=g,d*=g,p*=2,m*=2,f*=2,t[0]=h+l+p,t[1]=o+u+m,t[2]=c+d+f,t}const w=function(t){const e=t[0],s=t[1],r=t[2];return Math.sqrt(e*e+s*s+r*r)};!function(){const t=m()}();const E=[0,0,0];let S,T;class x extends d{static get ZERO(){return S||(S=new x(0,0,0),Object.freeze(S)),S}constructor(t=0,e=0,s=0){super(-0,-0,-0),1===arguments.length&&n(t)?this.copy(t):(r.debug&&(c(t),c(e),c(s)),this[0]=t,this[1]=e,this[2]=s)}set(t,e,s){return this[0]=t,this[1]=e,this[2]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return r.debug&&(c(t.x),c(t.y),c(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=c(t)}angle(t){return function(t,e){const s=t[0],r=t[1],i=t[2],n=e[0],a=e[1],h=e[2],o=Math.sqrt((s*s+r*r+i*i)*(n*n+a*a+h*h)),c=o&&g(t,e)/o;return Math.acos(Math.min(Math.max(c,-1),1))}(this,t)}cross(t){return y(this,this,t),this.check()}rotateX({radians:t,origin:e=E}){return function(t,e,s,r){const i=[],n=[];i[0]=e[0]-s[0],i[1]=e[1]-s[1],i[2]=e[2]-s[2],n[0]=i[0],n[1]=i[1]*Math.cos(r)-i[2]*Math.sin(r),n[2]=i[1]*Math.sin(r)+i[2]*Math.cos(r),t[0]=n[0]+s[0],t[1]=n[1]+s[1],t[2]=n[2]+s[2]}(this,this,e,t),this.check()}rotateY({radians:t,origin:e=E}){return function(t,e,s,r){const i=[],n=[];i[0]=e[0]-s[0],i[1]=e[1]-s[1],i[2]=e[2]-s[2],n[0]=i[2]*Math.sin(r)+i[0]*Math.cos(r),n[1]=i[1],n[2]=i[2]*Math.cos(r)-i[0]*Math.sin(r),t[0]=n[0]+s[0],t[1]=n[1]+s[1],t[2]=n[2]+s[2]}(this,this,e,t),this.check()}rotateZ({radians:t,origin:e=E}){return function(t,e,s,r){const i=[],n=[];i[0]=e[0]-s[0],i[1]=e[1]-s[1],i[2]=e[2]-s[2],n[0]=i[0]*Math.cos(r)-i[1]*Math.sin(r),n[1]=i[0]*Math.sin(r)+i[1]*Math.cos(r),n[2]=i[2],t[0]=n[0]+s[0],t[1]=n[1]+s[1],t[2]=n[2]+s[2]}(this,this,e,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return M(this,this,t),this.check()}transformAsVector(t){return function(t,e,s){const r=e[0],i=e[1],n=e[2],a=s[3]*r+s[7]*i+s[11]*n||1;t[0]=(s[0]*r+s[4]*i+s[8]*n)/a,t[1]=(s[1]*r+s[5]*i+s[9]*n)/a,t[2]=(s[2]*r+s[6]*i+s[10]*n)/a}(this,this,t),this.check()}transformByMatrix3(t){return function(t,e,s){const r=e[0],i=e[1],n=e[2];t[0]=r*s[0]+i*s[3]+n*s[6],t[1]=r*s[1]+i*s[4]+n*s[7],t[2]=r*s[2]+i*s[5]+n*s[8]}(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,s){const r=e[0],i=e[1];t[0]=s[0]*r+s[2]*i,t[1]=s[1]*r+s[3]*i,t[2]=e[2]}(this,this,t),this.check()}transformByQuaternion(t){return _(this,this,t),this.check()}}class k extends d{static get ZERO(){return T||(T=new k(0,0,0,0),Object.freeze(T)),T}constructor(t=0,e=0,s=0,i=0){super(-0,-0,-0,-0),n(t)&&1===arguments.length?this.copy(t):(r.debug&&(c(t),c(e),c(s),c(i)),this[0]=t,this[1]=e,this[2]=s,this[3]=i)}set(t,e,s,r){return this[0]=t,this[1]=e,this[2]=s,this[3]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return r.debug&&(c(t.x),c(t.y),c(t.z),c(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=c(t)}get w(){return this[3]}set w(t){this[3]=c(t)}transform(t){return M(this,this,t),this.check()}transformByMatrix3(t){return function(t,e,s){const r=e[0],i=e[1],n=e[2];t[0]=s[0]*r+s[3]*i+s[6]*n,t[1]=s[1]*r+s[4]*i+s[7]*n,t[2]=s[2]*r+s[5]*i+s[8]*n,t[3]=e[3]}(this,this,t),this.check()}transformByMatrix2(t){return function(t,e,s){const r=e[0],i=e[1];t[0]=s[0]*r+s[2]*i,t[1]=s[1]*r+s[3]*i,t[2]=e[2],t[3]=e[3]}(this,this,t),this.check()}transformByQuaternion(t){return _(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}}function R(){const t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function b(t,e,s){s*=.5;const r=Math.sin(s);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(s),t}function C(t,e,s){const r=e[0],i=e[1],n=e[2],a=e[3],h=s[0],o=s[1],c=s[2],l=s[3];return t[0]=r*l+a*h+i*c-n*o,t[1]=i*l+a*o+n*h-r*c,t[2]=n*l+a*c+r*o-i*h,t[3]=a*l-r*h-i*o-n*c,t}function P(t,e,s,r){const i=e[0],n=e[1],a=e[2],h=e[3];let o,c,l,u,d,p=s[0],m=s[1],f=s[2],g=s[3];return o=i*p+n*m+a*f+h*g,o<0&&(o=-o,p=-p,m=-m,f=-f,g=-g),1-o>1e-6?(c=Math.acos(o),d=Math.sin(c),l=Math.sin((1-r)*c)/d,u=Math.sin(r*c)/d):(l=1-r,u=r),t[0]=l*i+u*p,t[1]=l*n+u*m,t[2]=l*a+u*f,t[3]=l*h+u*g,t}function v(t,e){const s=e[0]+e[4]+e[8];let r;if(s>0)r=Math.sqrt(s+1),t[3]=.5*r,r=.5/r,t[0]=(e[5]-e[7])*r,t[1]=(e[6]-e[2])*r,t[2]=(e[1]-e[3])*r;else{let s=0;e[4]>e[0]&&(s=1),e[8]>e[3*s+s]&&(s=2);const i=(s+1)%3,n=(s+2)%3;r=Math.sqrt(e[3*s+s]-e[3*i+i]-e[3*n+n]+1),t[s]=.5*r,r=.5/r,t[3]=(e[3*i+n]-e[3*n+i])*r,t[i]=(e[3*i+s]+e[3*s+i])*r,t[n]=(e[3*n+s]+e[3*s+n])*r}return t}!function(){const t=function(){const t=new p(4);return p!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}()}();const A=function(t,e,s){return t[0]=e[0]+s[0],t[1]=e[1]+s[1],t[2]=e[2]+s[2],t[3]=e[3]+s[3],t},N=function(t,e,s){return t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t},L=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},Y=function(t,e,s,r){const i=e[0],n=e[1],a=e[2],h=e[3];return t[0]=i+r*(s[0]-i),t[1]=n+r*(s[1]-n),t[2]=a+r*(s[2]-a),t[3]=h+r*(s[3]-h),t},X=function(t){const e=t[0],s=t[1],r=t[2],i=t[3];return Math.sqrt(e*e+s*s+r*r+i*i)},Z=function(t){const e=t[0],s=t[1],r=t[2],i=t[3];return e*e+s*s+r*r+i*i},B=function(t,e){const s=e[0],r=e[1],i=e[2],n=e[3];let a=s*s+r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),t[0]=s*a,t[1]=r*a,t[2]=i*a,t[3]=n*a,t},O=function(){const t=m(),e=f(1,0,0),s=f(0,1,0);return function(r,i,n){const a=g(i,n);return a<-.999999?(y(t,e,i),w(t)<1e-6&&y(t,s,i),function(t,e){const s=e[0],r=e[1],i=e[2];let n=s*s+r*r+i*i;n>0&&(n=1/Math.sqrt(n)),t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n}(t,t),b(r,t,Math.PI),r):a>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(y(t,i,n),r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=1+a,B(r,r))}}();!function(){const t=R(),e=R()}(),function(){const t=function(){const t=new p(9);return p!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}()}();const U=[0,0,0,1];class q extends o{constructor(t=0,e=0,s=0,r=1){super(-0,-0,-0,-0),Array.isArray(t)&&1===arguments.length?this.copy(t):this.set(t,e,s,r)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,e,s,r){return this[0]=t,this[1]=e,this[2]=s,this[3]=r,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return v(this,t),this.check()}fromAxisRotation(t,e){return b(this,t,e),this.check()}identity(){var t;return(t=this)[0]=0,t[1]=0,t[2]=0,t[3]=1,this.check()}setAxisAngle(t,e){return this.fromAxisRotation(t,e)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=c(t)}get y(){return this[1]}set y(t){this[1]=c(t)}get z(){return this[2]}set z(t){this[2]=c(t)}get w(){return this[3]}set w(t){this[3]=c(t)}len(){return X(this)}lengthSquared(){return Z(this)}dot(t){return L(this,t)}rotationTo(t,e){return O(this,t,e),this.check()}add(t){return A(this,this,t),this.check()}calculateW(){return function(t,e){const s=e[0],r=e[1],i=e[2];t[0]=s,t[1]=r,t[2]=i,t[3]=Math.sqrt(Math.abs(1-s*s-r*r-i*i))}(this,this),this.check()}conjugate(){var t,e;return e=this,(t=this)[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],this.check()}invert(){return function(t,e){const s=e[0],r=e[1],i=e[2],n=e[3],a=s*s+r*r+i*i+n*n,h=a?1/a:0;t[0]=-s*h,t[1]=-r*h,t[2]=-i*h,t[3]=n*h}(this,this),this.check()}lerp(t,e,s){return void 0===s?this.lerp(this,t,e):(Y(this,t,e,s),this.check())}multiplyRight(t){return C(this,this,t),this.check()}multiplyLeft(t){return C(this,t,this),this.check()}normalize(){const t=this.len(),e=t>0?1/t:0;return this[0]=this[0]*e,this[1]=this[1]*e,this[2]=this[2]*e,this[3]=this[3]*e,0===t&&(this[3]=1),this.check()}rotateX(t){return function(t,e,s){s*=.5;const r=e[0],i=e[1],n=e[2],a=e[3],h=Math.sin(s),o=Math.cos(s);t[0]=r*o+a*h,t[1]=i*o+n*h,t[2]=n*o-i*h,t[3]=a*o-r*h}(this,this,t),this.check()}rotateY(t){return function(t,e,s){s*=.5;const r=e[0],i=e[1],n=e[2],a=e[3],h=Math.sin(s),o=Math.cos(s);t[0]=r*o-n*h,t[1]=i*o+a*h,t[2]=n*o+r*h,t[3]=a*o-i*h}(this,this,t),this.check()}rotateZ(t){return function(t,e,s){s*=.5;const r=e[0],i=e[1],n=e[2],a=e[3],h=Math.sin(s),o=Math.cos(s);t[0]=r*o+i*h,t[1]=i*o-r*h,t[2]=n*o+a*h,t[3]=a*o-n*h}(this,this,t),this.check()}scale(t){return N(this,this,t),this.check()}slerp(t,e,s){let r,i,n;switch(arguments.length){case 1:({start:r=U,target:i,ratio:n}=t);break;case 2:r=this,i=t,n=e;break;default:r=t,i=e,n=s}return P(this,r,i,n),this.check()}transformVector4(t,e=new k){return function(t,e,s){const r=e[0],i=e[1],n=e[2],a=s[0],h=s[1],o=s[2],c=s[3],l=c*r+h*n-o*i,u=c*i+o*r-a*n,d=c*n+a*i-h*r,p=-a*r-h*i-o*n;t[0]=l*c+p*-a+u*-o-d*-h,t[1]=u*c+p*-h+d*-a-l*-o,t[2]=d*c+p*-o+l*-h-u*-a,t[3]=e[3]}(e,t,this),l(e,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,e){return this.setAxisAngle(t,e)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}}const D="Unknown Euler angle order",I=.99999;var F,H;!function(t){t[t.ZYX=0]="ZYX",t[t.YXZ=1]="YXZ",t[t.XZY=2]="XZY",t[t.ZXY=3]="ZXY",t[t.YZX=4]="YZX",t[t.XYZ=5]="XYZ"}(F||(F={}));class z extends o{static get ZYX(){return F.ZYX}static get YXZ(){return F.YXZ}static get XZY(){return F.XZY}static get ZXY(){return F.ZXY}static get YZX(){return F.YZX}static get XYZ(){return F.XYZ}static get RollPitchYaw(){return F.ZYX}static get DefaultOrder(){return F.ZYX}static get RotationOrders(){return F}static rotationOrder(t){return F[t]}get ELEMENTS(){return 4}constructor(t=0,e=0,s=0,r=z.DefaultOrder){super(-0,-0,-0,-0),arguments.length>0&&Array.isArray(arguments[0])?this.fromVector3(...arguments):this.set(t,e,s,r)}fromQuaternion(t){const[e,s,r,i]=t,n=s*s,a=-2*(n+r*r)+1,h=2*(e*s+i*r);let o=-2*(e*r-i*s);const c=2*(s*r+i*e),l=-2*(e*e+n)+1;o=o>1?1:o,o=o<-1?-1:o;const u=Math.atan2(c,l),d=Math.asin(o),p=Math.atan2(h,a);return this.set(u,d,p,z.RollPitchYaw)}fromObject(t){throw new Error("not implemented")}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=Number.isFinite(t[3])||this.order,this.check()}set(t=0,e=0,s=0,r){return this[0]=t,this[1]=e,this[2]=s,this[3]=Number.isFinite(r)?r:this[3],this.check()}validate(){return(t=this[3])>=0&&t<6&&Number.isFinite(this[0])&&Number.isFinite(this[1])&&Number.isFinite(this[2]);var t}toArray(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t}toArray4(t=[],e=0){return t[e]=this[0],t[e+1]=this[1],t[e+2]=this[2],t[e+3]=this[3],t}toVector3(t=[-0,-0,-0]){return t[0]=this[0],t[1]=this[1],t[2]=this[2],t}get x(){return this[0]}set x(t){this[0]=c(t)}get y(){return this[1]}set y(t){this[1]=c(t)}get z(){return this[2]}set z(t){this[2]=c(t)}get alpha(){return this[0]}set alpha(t){this[0]=c(t)}get beta(){return this[1]}set beta(t){this[1]=c(t)}get gamma(){return this[2]}set gamma(t){this[2]=c(t)}get phi(){return this[0]}set phi(t){this[0]=c(t)}get theta(){return this[1]}set theta(t){this[1]=c(t)}get psi(){return this[2]}set psi(t){this[2]=c(t)}get roll(){return this[0]}set roll(t){this[0]=c(t)}get pitch(){return this[1]}set pitch(t){this[1]=c(t)}get yaw(){return this[2]}set yaw(t){this[2]=c(t)}get order(){return this[3]}set order(t){this[3]=function(t){if(t<0&&t>=6)throw new Error(D);return t}(t)}fromVector3(t,e){return this.set(t[0],t[1],t[2],Number.isFinite(e)?e:this[3])}fromArray(t,e=0){return this[0]=t[0+e],this[1]=t[1+e],this[2]=t[2+e],void 0!==t[3]&&(this[3]=t[3]),this.check()}fromRollPitchYaw(t,e,s){return this.set(t,e,s,F.ZYX)}fromRotationMatrix(t,e=z.DefaultOrder){return this._fromRotationMatrix(t,e),this.check()}getRotationMatrix(t){return this._getRotationMatrix(t)}getQuaternion(){const t=new q;switch(this[3]){case F.XYZ:return t.rotateX(this[0]).rotateY(this[1]).rotateZ(this[2]);case F.YXZ:return t.rotateY(this[0]).rotateX(this[1]).rotateZ(this[2]);case F.ZXY:return t.rotateZ(this[0]).rotateX(this[1]).rotateY(this[2]);case F.ZYX:return t.rotateZ(this[0]).rotateY(this[1]).rotateX(this[2]);case F.YZX:return t.rotateY(this[0]).rotateZ(this[1]).rotateX(this[2]);case F.XZY:return t.rotateX(this[0]).rotateZ(this[1]).rotateY(this[2]);default:throw new Error(D)}}_fromRotationMatrix(t,e=z.DefaultOrder){const s=t[0],r=t[4],i=t[8],n=t[1],h=t[5],o=t[9],c=t[2],l=t[6],u=t[10];switch(e=e||this[3]){case z.XYZ:this[1]=Math.asin(a(i,-1,1)),Math.abs(i)<I?(this[0]=Math.atan2(-o,u),this[2]=Math.atan2(-r,s)):(this[0]=Math.atan2(l,h),this[2]=0);break;case z.YXZ:this[0]=Math.asin(-a(o,-1,1)),Math.abs(o)<I?(this[1]=Math.atan2(i,u),this[2]=Math.atan2(n,h)):(this[1]=Math.atan2(-c,s),this[2]=0);break;case z.ZXY:this[0]=Math.asin(a(l,-1,1)),Math.abs(l)<I?(this[1]=Math.atan2(-c,u),this[2]=Math.atan2(-r,h)):(this[1]=0,this[2]=Math.atan2(n,s));break;case z.ZYX:this[1]=Math.asin(-a(c,-1,1)),Math.abs(c)<I?(this[0]=Math.atan2(l,u),this[2]=Math.atan2(n,s)):(this[0]=0,this[2]=Math.atan2(-r,h));break;case z.YZX:this[2]=Math.asin(a(n,-1,1)),Math.abs(n)<I?(this[0]=Math.atan2(-o,h),this[1]=Math.atan2(-c,s)):(this[0]=0,this[1]=Math.atan2(i,u));break;case z.XZY:this[2]=Math.asin(-a(r,-1,1)),Math.abs(r)<I?(this[0]=Math.atan2(l,h),this[1]=Math.atan2(i,s)):(this[0]=Math.atan2(-o,u),this[1]=0);break;default:throw new Error(D)}return this[3]=e,this}_getRotationMatrix(t){const e=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],s=this.x,r=this.y,i=this.z,n=Math.cos(s),a=Math.cos(r),h=Math.cos(i),o=Math.sin(s),c=Math.sin(r),l=Math.sin(i);switch(this[3]){case z.XYZ:{const t=n*h,s=n*l,r=o*h,i=o*l;e[0]=a*h,e[4]=-a*l,e[8]=c,e[1]=s+r*c,e[5]=t-i*c,e[9]=-o*a,e[2]=i-t*c,e[6]=r+s*c,e[10]=n*a;break}case z.YXZ:{const t=a*h,s=a*l,r=c*h,i=c*l;e[0]=t+i*o,e[4]=r*o-s,e[8]=n*c,e[1]=n*l,e[5]=n*h,e[9]=-o,e[2]=s*o-r,e[6]=i+t*o,e[10]=n*a;break}case z.ZXY:{const t=a*h,s=a*l,r=c*h,i=c*l;e[0]=t-i*o,e[4]=-n*l,e[8]=r+s*o,e[1]=s+r*o,e[5]=n*h,e[9]=i-t*o,e[2]=-n*c,e[6]=o,e[10]=n*a;break}case z.ZYX:{const t=n*h,s=n*l,r=o*h,i=o*l;e[0]=a*h,e[4]=r*c-s,e[8]=t*c+i,e[1]=a*l,e[5]=i*c+t,e[9]=s*c-r,e[2]=-c,e[6]=o*a,e[10]=n*a;break}case z.YZX:{const t=n*a,s=n*c,r=o*a,i=o*c;e[0]=a*h,e[4]=i-t*l,e[8]=r*l+s,e[1]=l,e[5]=n*h,e[9]=-o*h,e[2]=-c*h,e[6]=s*l+r,e[10]=t-i*l;break}case z.XZY:{const t=n*a,s=n*c,r=o*a,i=o*c;e[0]=a*h,e[4]=-l,e[8]=c*h,e[1]=t*l+i,e[5]=n*h,e[9]=s*l-r,e[2]=r*l-s,e[6]=o*h,e[10]=i*l+t;break}default:throw new Error(D)}return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}toQuaternion(){const t=Math.cos(.5*this.yaw),e=Math.sin(.5*this.yaw),s=Math.cos(.5*this.roll),r=Math.sin(.5*this.roll),i=Math.cos(.5*this.pitch),n=Math.sin(.5*this.pitch);return new q(t*r*i-e*s*n,t*s*n+e*r*i,e*s*i-t*r*n,t*s*i+e*r*n)}}class j{constructor(t,e,s){this.position=t,this.rotation=e,this.scale=s}static default(t){return new j(t?.position||new x,t?.rotation||new z,t?.scale||new x(1,1,1))}}class V extends j{constructor(t,e,s){super(t,e,s)}toRPCJSON(){return{Location:{X:this.position.x,Y:this.position.y,Z:this.position.z},Rotation:{Pitch:this.rotation.pitch,Yaw:this.rotation.yaw,Roll:this.rotation.roll},Scale:{X:this.scale.x,Y:this.scale.y,Z:this.scale.z}}}static default(){return new V(new x,new z,new x(1,1,1))}static fromRPCObject(t){return new V(t.Location?new x(t.Location.X,t.Location.Y,t.Location.Z):new x,t.Rotation?new z(t.Rotation.Pitch,t.Rotation.Yaw,t.Rotation.Roll):new z,t.Scale?new x(t.Scale.X,t.Scale.Y,t.Scale.Z):new x(1,1,1))}}class J{constructor(t,e,s){this._children=[],this._key=t,this.isRoot=!0,this.data=e,this._transform=s?new j(new x,new z,new x(1,1,1)):j.default()}get key(){return this._key}get transform(){return this._transform}get children(){return this._children}add(t){t.parent=this,this._children.push(t),t.isRoot=!1}detach(){this.parent&&this.parent.removeChild(this),this.isRoot=!0}remove(){this.parent&&this.detach()}removeChild(t){t.parent=void 0;let e=this._children.findIndex(e=>e!==t);e>-1&&this._children.splice(e,1)}findChild(t){if(this.key===t)return this;for(let e=0;e<this._children.length;e++){let s=this._children[e].findChild(t);if(s)return s}}}class W{constructor(t){this.changes=[],this.isTimeoutSet=!1,this.callback=t}addChange(t){this.changes.push(t),this.scheduleCallback()}scheduleCallback(){this.isTimeoutSet||(this.isTimeoutSet=!0,Promise.resolve().then(()=>this.triggerCallback()))}triggerCallback(){this.changes.length>0&&(this.callback([...this.changes]),this.changes=[]),this.isTimeoutSet=!1}}function $(t,e={},s){const r={get(t,r,i){e.get&&e.get(t,r,i);const n=Reflect.get(t,r,i);return null===n||"object"!=typeof n&&!Array.isArray(n)?n:$(n,e,s)},set(t,r,i,n){e.set&&e.set(t,r,i,n);const a=null===i||"object"!=typeof i&&!Array.isArray(i)?i:$(i,e,s);return s&&s.addChange({target:t,prop:r,value:a,type:"set"}),Reflect.set(t,r,a,n)},deleteProperty:(t,r)=>(e.deleteProperty&&e.deleteProperty(t,r),s&&s.addChange({target:t,prop:r,value:void 0,type:"delete"}),Reflect.deleteProperty(t,r)),...e};return new Proxy(t,r)}!function(t){t.Other="other",t.Map="map",t.Blueprint="blueprint",t.StaticMesh="static_mesh",t.SkeletalMesh="skeletal_mesh"}(H||(H={}));class G extends J{constructor(t,e,s,r,i){super(e,s),this._rpc=t,this._transform=r||V.default(),this._remoteUpdateFlag=!1,this._collector=new W(this._triggerRemoteUpdate.bind(this)),this.tag=i}get transform(){return $(this._transform,{},this._collector)}set transform(t){this._transform=t,this._triggerRemoteUpdate()}add(t){if(!this.isRoot)throw new Error("UERPCNode can't add child , except root node");super.add(t),t.world=this.world}__dangerousRawAdd(t){super.add(t)}async detach(){super.detach()}async remove(){super.remove(),await this._rpc.destroyActorByHandle(this.key)}async removeChild(t){super.removeChild(t),await this._rpc.destroyActorByHandle(this.key)}_triggerRemoteUpdate(){this._remoteUpdateFlag||(this._remoteUpdateFlag=!0,Promise.resolve().then(()=>this._remoteUpdate()))}_remoteUpdate(){this._rpc.setActorTransformByHandle(this.key,this.transform.toRPCJSON()),this._remoteUpdateFlag=!1}}class Q{constructor(t){this._rpc=t}excute(t){throw new Error("Method not implemented.")}}const K=(t,e)=>{if(t>3840||e>2160){const s=Math.min(3840/t,2160/e);return{width:Math.ceil(t*s),height:Math.ceil(e*s)}}return{width:t,height:e}};var tt,et,st,rt;!function(t){t.SUNNY="Sunny",t.Foggy="Foggy",t.RAIN="Rain",t.SNOW="Snow"}(tt||(tt={}));class it{get pointsMap(){return this.children.reduce((t,e)=>(t[e.id]=e,t),{})}get tagMap(){return this.children.reduce((t,e)=>(t[e.tag]||(t[e.tag]=[]),t[e.tag].push(e),t),{})}constructor(t){this.children=[],this._rpc=t}getById(t){return this.pointsMap[t]}async removeById(t){let e=this.getById(t);e&&(this.children=this.children.filter(e=>e.id!==t),e.group=void 0,await e.remove())}async removeAll(){let t=this.children.map(t=>t.id);this.children=[],await this._rpc.callModule("Point","DeleteByIds",{IDs:t})}async removeByTag(t){let e=this.tagMap[t].map(t=>t.id);this.children=this.children.filter(e=>e.tag!==t),await this._rpc.callModule("Point","DeleteByIds",{IDs:e})}}class nt{constructor(t,e){this._id=t,this._rpc=e.rpc,this._transform=e.transform||V.default(),this._textContent=e.textContent,this._tag=e.tag||"",this._remoteUpdateFlag=!1,this._collector=new W(this._triggerRemoteUpdate.bind(this)),this.group=e.group}get tag(){return this._tag}get id(){return this._id}get transform(){return $(this._transform,{},this._collector)}get textContent(){return this._textContent}set textContent(t){this._textContent=t,this._triggerRemoteUpdate()}_triggerRemoteUpdate(){this._remoteUpdateFlag||(this._remoteUpdateFlag=!0,this.remoteUpdate())}remoteUpdate(){let t=this.transform.toRPCJSON();this._rpc.callModule("Point","Update",{textContent:this.textContent,Location:t.Location,Rotation:t.Rotation,Scale:t.Scale}),this._remoteUpdateFlag=!1}async remove(){if(this.group)return this.group.removeById(this.id);await this._rpc.callModule("Point","DeleteByIds",{IDs:[this.id]})}}!function(t){t.UnCreated="UnCreated",t.Created="Created",t.Removed="Removed"}(et||(et={}));class at{get id(){return this._id}constructor(t,e,s){this._id=e,this._rpc=t,this._status=s||et.UnCreated}get status(){return this._status}async remove(){return this._rpc.callModule("Box","Delete",{FenceID:this.id})}}!function(t){t.Expanded="Expanded",t.ExpandFloor="ExpandFloor",t.Collapsed="Collapsed"}(st||(st={}));class ht{constructor(t,e,s){this._id=t,this._rpc=e,this._status=s||st.Collapsed}get status(){return this._status}get id(){return this._id}async expand(t){await this._rpc.callModule("Building","ExpandFloor",{BuildingId:this._id,Spacing:t.spacing,Duration:t.duration||2})}async expandFloor(t){let e={BuildingId:this._id,Distance:t.distance,ExpandHeight:t.expandHeight,Duration:t.duration||2};return t.direction&&(e.Direction={X:t.direction.X,Y:t.direction.Y,Z:t.direction.Z}),this._rpc.callModule("Building","ExpandFloor",e)}async collapse(t=2){return this._rpc.callModule("Building","Collapse",{BuildingId:this._id,duration:t||2})}}!function(t){t.Path="Path",t.Height="Height",t.Area="Area"}(rt||(rt={}));class ot{constructor(t,e){this._node=t,this._rpc=e}async restore(){await this._rpc.callModule("Visual","Ghost",{handle:this._node.key,Ghost:!1})}}var ct,lt,ut={Tool:Q,MatchViewTool:class extends Q{constructor(t){super(t)}excute(){this._rpc.emitCommand({Command:"MatchView","Resolution.Width":K(window.innerWidth,window.innerHeight).width,"Resolution.Height":K(window.innerWidth,window.innerHeight).height})}},WeatherTool:class{constructor(t){this._rpc=t}async setWeather(t){return this._rpc.callModule("Enviorment","SetWeather",{Preset:t})}},PickCastTool:class extends Q{constructor(t){super(t)}hover(t,e=1e6,s=!1){let r=this._rpc.getStream().videoElementParent;const i=function(t,e){let s=!1;return function(...r){const i=this;s||(t.apply(i,r),s=!0,setTimeout(()=>s=!1,e))}}(async r=>{const i=r.offsetX,n=r.offsetY;let a=await this._rpc.pickPointByScreen(i,n,e,s);t&&t(a)},50);return r.addEventListener("mousemove",i),function(){r.removeEventListener("mousemove",i)}}pick(t,e=1e6,s=!0){let r=this._rpc.getStream().videoElementParent,i=this._rpc;async function n(r){const n=r.offsetX,a=r.offsetY;let h=await i.pickPointByScreen(n,a,e,s);t&&t(h)}return r.addEventListener("click",n),function(){r.removeEventListener("click",n)}}},HeatMapTool:class extends Q{constructor(t,e){super(t),this._world=e}async create(t){let e=t.transform||V.default(),s=await this._rpc.callModule("HeatMap","Create",{url:t.url,X:e.position.x,Y:e.position.y,Z:e.position.z,ScaleX:e.scale.x,ScaleY:e.scale.y,ScaleZ:e.scale.z,Pitch:e.rotation.pitch,Yaw:e.rotation.yaw,Roll:e.rotation.roll,Tag:t.tag,MeshSize:t.meshSize,MeshSegment:t.meshSegment,LerpScale:t.lerpScale,Opacity:t.opacity,HeightScale:t.heightScale,ZeroValueOpacity:t.zeroValueOpacity,InfluenceSize:t.influenceSize,EmissiveStrength:t.emissiveStrength,HeatMapPoints:t.heatMapPoints}),r=new G(this._rpc,s.Handle,{assetType:H.Other},e,t.tag);return this._world.root.__dangerousRawAdd(r),r}},ScatterTool:class extends Q{constructor(t){super(t)}async create(t){let e=await this._rpc.callModule("Point","Create",{WidgetSpace:t.widgetSpace,PointParams:t.pointParams.map(t=>({Id:t.id,Location:t.location,Rotation:t.rotation,Scale:t.scale,Tag:t.tag,TextContent:t.textContent}))}),s=[];for(let r=0;r<e.CreatedIDs.length;r++){let i=e.CreatedIDs[r],n=t.pointParams[r];s.push({...n,id:i})}return function(t,e){let s=new it(t),r=e.map(e=>function(t,e,s){let r=new nt(e.id,{rpc:t,transform:V.fromRPCObject({}),textContent:e.textContent,tag:e.tag,group:s});return r}(t,{...e},s));return s.children=r,s}(this._rpc,s)}},FenceTool:class extends Q{constructor(t){super(t)}async create(t){let e=this._rpc.callModule("Box","Create",{VectorArray:t.vectorArray,Height:t.height,MaterialEnum:t.materialEnum,Color:t.color});const{FenceID:s}=await e;return new at(this._rpc,s,et.Created)}},BuildingTool:class extends Q{constructor(t){super(t)}async expand(t,e){return await this._rpc.callModule("Building","Expand",{BuildingId:t,Spacing:e.spacing,Duration:e.duration||2e3}),new ht(t,this._rpc)}},MeasurementTool:class extends Q{constructor(t){super(t)}draw(t){return this._rpc.callModule("Measurement","SetDrawType",{Type:t})}clean(){return this._rpc.callModule("Measurement","SetDrawType",{Type:"Null"})}},DaytimeTool:class extends Q{constructor(t){super(t)}setDaytime(t,e){return this._rpc.callModule("Environment","SetDaytime",{value:`${t}${e}`})}},GhostTool:class extends Q{constructor(t){super(t)}async ghost(t){return await this._rpc.callModule("Visual","Ghost",{Ghost:!0,handle:t.key}),new ot(t,this._rpc)}}};class dt extends G{constructor(t,e){super(t,e)}}class pt{constructor(t){this.clip=t}_play(t,e){t.mixer?.rpc.callModule("Animation","Play",{...e,Animation:this.clip.animateName})}_pause(t,e){t.mixer?.rpc.callModule("Animation","Pause",{handle:e.Handle})}_resume(t,e){t.mixer?.rpc.callModule("Animation","Resume",{handle:e.Handle})}}class mt{constructor(t){this.clip=t}_play(t,e){t.mixer?.rpc.callModule("Animation","MoveBetweenTransforms",{Handle:t.handle,StartTransform:this.clip.startTransform?.toRPCJSON(),EndTransform:this.clip.endTransform?.toRPCJSON(),Duration:t.duration})}_pause(t,e){t.mixer?.rpc.callModule("Animation","PauseMoveBetweenTransforms",{Handle:t.handle})}_resume(t,e){t.mixer?.rpc.callModule("Animation","ResumeMoveBetweenTransforms",{Handle:t.handle})}}!function(t){t.Playing="playing",t.Paused="paused",t.Stopped="stopped"}(ct||(ct={})),function(t){t.Loop="loop",t.Once="once"}(lt||(lt={}));class ft{constructor(t,e,s){this._status=ct.Stopped,this._handle=t,this.type=lt.Once,this.rate=1,this.clip=e,this.playDuration=0,this.mixer=s}get duration(){return this._duration}set duration(t){this._duration=t}get handle(){return this._handle}get status(){return this._status}async play(){if(this._status==ct.Paused){return this.clip._clipCall()._resume(this,{Handle:this._handle})}let t={Handle:this._handle,Rate:this.rate,Loop:this.type==lt.Loop},e=this.clip._clipCall();this.playDuration=0,this._status=ct.Playing,e._play(this,t)}pause(){let t={Handle:this._handle,Rate:this.rate,Loop:this.type==lt.Loop},e=this.clip._clipCall();return this._status=ct.Paused,e._pause(this,t)}update(t){this.status==ct.Playing&&(this.playDuration+=t,this.type===lt.Once&&this.duration&&this.playDuration>=this.duration&&(this._status=ct.Stopped))}}class gt{constructor(){this.startTime=0,this.previousTime=0,this.elapsedTime=0,this.isRunning=!1}start(){this.startTime=performance.now(),this.previousTime=this.startTime,this.elapsedTime=0,this.isRunning=!0}stop(){this.getDelta(),this.isRunning=!1}getDelta(){let t=performance.now(),e=0;return this.isRunning&&(e=t-this.previousTime,this.elapsedTime+=e,this.previousTime=t),e}getElapsedTime(){return this.isRunning&&this.getDelta(),this.elapsedTime}getStartTime(){return this.startTime}isRunningState(){return this.isRunning}reset(){this.startTime=performance.now(),this.previousTime=this.startTime,this.elapsedTime=0}}var yt=Object.freeze({__proto__:null,AnimationMixer:class{constructor(t){this._actions=[],this._rpc=t,this._duration=0,this._actions=[],this.init()}get rpc(){return this._rpc}init(){this._clock=new gt,this._clock.start(),setTimeout(()=>{this._duration+=this._clock.getDelta(),this.updateAction()},1e3/60)}get duration(){return this._duration}updateAction(){this._actions.forEach(t=>{t.update(this._duration)})}clipAction(t,e){return new ft(e.key,t,this)}removeAction(t){let e=this._actions.findIndex(e=>e===t);e>-1&&this._actions.splice(e,1)}},AnimationAction:ft,PresetAnimateClip:class{constructor(t){this.animateName=t}_clipCall(){return new pt(this)}},KeyFrameAnimateClip:class{constructor(t){this.startTransform=t.startTransform,this.endTransform=t.endTransform}_clipCall(){return new mt(this)}}});const Mt={UERPC:s},_t={World:class{constructor(t){this._rpc=new s(t),this.root=new G(this._rpc),this.root.world=this,this.tools={ghost:new ut.GhostTool(this._rpc),weather:new ut.WeatherTool(this._rpc),matchView:new ut.MatchViewTool(this._rpc),pickCast:new ut.PickCastTool(this._rpc),scatter:new ut.ScatterTool(this._rpc),heatMap:new ut.HeatMapTool(this._rpc,this),fence:new ut.FenceTool(this._rpc),building:new ut.BuildingTool(this._rpc),measurement:new ut.MeasurementTool(this._rpc),daytime:new ut.DaytimeTool(this._rpc)}}get rpc(){return this._rpc}async loadLevelByName(t){let e=(await this._rpc.loadLevelByName(t)).Handle||"map",s=new G(this._rpc,e,{assetType:H.Map});return s.data={assetType:H.Map},this.root.add(s),s}async spawnSkeletalMesh(t){let e=t.transform||V.default(),s=(await this._rpc.callModule("Mesh","Spawn",{Type:"SkeletalMesh",AssetPath:t.assetPath,Transform:e.toRPCJSON(),Tag:t.tag})).Handle,r=new G(this._rpc,s,{assetType:H.SkeletalMesh},e);return this.root.add(r),r}async spawnStaticMeshActor(t){let e=t.transform||V.default(),s=(await this._rpc.callModule("Mesh","Spawn",{Type:"StaticMesh",AssetPath:t.assetPath,Transform:e.toRPCJSON(),Tag:t.tag})).Handle,r=new G(this._rpc,s,{assetType:H.StaticMesh},e);return this.root.add(r),r}async spawnLocalBlueprintActor(t){let e=t.transform||V.default(),s=(await this._rpc.callModule("Mesh","Spawn",{Type:"Blueprint",AssetPath:t.assetPath,Transform:e.toRPCJSON(),Tag:t.tag})).Handle,r=new G(this._rpc,s,{assetType:H.Blueprint},e);return this.root.add(r),r}},Transform:V,PerspectiveCamera:class extends dt{constructor(t){super(t,"camera"),this._transform=V.default(),this._collector=new W(this._triggerRemoteUpdate.bind(this)),this._remoteUpdateFlag=!1}async forceSyncRemoteToLocal(){let t=await this._rpc.getCameraTransform();if(console.log(t),t.Transform){let e=V.fromRPCObject(t.Transform);this._transform=e}}get transform(){return $(this._transform,{},this._collector)}_triggerRemoteUpdate(){this._remoteUpdateFlag=!0,this._remoteUpdate()}_remoteUpdate(){this._rpc.setCameraTransform(this._transform.toRPCJSON()),this._remoteUpdateFlag=!0}},UERPCNode:G,WeatherType:tt,MeasurementType:rt,Animation:{...yt}};t.Addons=_t,t.Core=Mt,Object.defineProperty(t,"__esModule",{value:!0})});
|
|
2
|
+
//# sourceMappingURL=sdk.umd.js.map
|