@realsee/five 6.4.0-alpha.0 → 6.4.0-alpha.10

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.
Files changed (86) hide show
  1. package/docs/assets/navigation.js +1 -1
  2. package/docs/assets/search.js +1 -1
  3. package/docs/classes/five.Camera.html +5 -4
  4. package/docs/classes/five.Five.html +45 -35
  5. package/docs/classes/five.InternalWebGLRenderer.html +1 -1
  6. package/docs/classes/five.Model.html +24 -37
  7. package/docs/classes/five.ModelViewLayer.html +6 -6
  8. package/docs/classes/five.PBMMeshMaterial.html +37 -37
  9. package/docs/classes/five.PBMPointCloudMaterial.html +34 -34
  10. package/docs/classes/five.Tile.html +2 -1
  11. package/docs/classes/five.Tile3DModel.html +5 -4
  12. package/docs/classes/five.TileRequestScheduler.html +2 -2
  13. package/docs/classes/five.Tileset.html +12 -2
  14. package/docs/classes/five.Trajectory.html +2 -2
  15. package/docs/classes/five.Work.html +14 -14
  16. package/docs/classes/plugins-1.TrajectoryController.html +4 -4
  17. package/docs/functions/five.loadB3dm.html +1 -1
  18. package/docs/functions/five.loadDome.html +1 -1
  19. package/docs/functions/five.loadDomez.html +1 -1
  20. package/docs/functions/five.loadPbm.html +1 -1
  21. package/docs/functions/five.loadPly.html +1 -1
  22. package/docs/functions/five.loadX3p.html +1 -0
  23. package/docs/functions/five.parseWork.html +1 -1
  24. package/docs/functions/react.useFiveAction.html +1 -1
  25. package/docs/functions/vue.useFiveAction.html +1 -1
  26. package/docs/interfaces/five.FiveInitArgs.html +2 -2
  27. package/docs/interfaces/five.FiveLoadOptions.html +13 -26
  28. package/docs/interfaces/five.PBMParameters.html +13 -13
  29. package/docs/interfaces/five.Tile3DModelLoaderOptions.html +2 -2
  30. package/docs/interfaces/five.Tile3dLayerOptions.html +27 -0
  31. package/docs/interfaces/five.TileHeader.html +2 -2
  32. package/docs/interfaces/five.TilesetHeader.html +16 -3
  33. package/docs/interfaces/five.TrajectoryHeader.html +2 -2
  34. package/docs/interfaces/five.WorkCubeImage.html +8 -8
  35. package/docs/interfaces/five.WorkImage.html +10 -10
  36. package/docs/interfaces/five.WorkInitial.html +8 -8
  37. package/docs/interfaces/five.WorkModel.html +6 -6
  38. package/docs/interfaces/five.WorkModelLayer.html +5 -0
  39. package/docs/interfaces/five.WorkObserver.html +20 -20
  40. package/docs/interfaces/five.WorkResolvedObserver.html +20 -20
  41. package/docs/interfaces/five.WorkTile.html +2 -2
  42. package/docs/interfaces/five.WorkVideo.html +4 -4
  43. package/docs/interfaces/react.FiveActionReactCallbacks.html +19 -8
  44. package/docs/interfaces/react.FiveInjectionTypes.html +32 -23
  45. package/docs/interfaces/vue.FiveActionVueCallbacks.html +20 -9
  46. package/docs/modules/five.html +4 -0
  47. package/docs/types/five.ModelMaterialValues.html +1 -1
  48. package/docs/types/five.Models.html +5 -5
  49. package/docs/types/five.ParseWorkOptions.html +1 -1
  50. package/docs/types/five.ParsedResultType.html +1 -1
  51. package/docs/types/five.Tile3dOptions.html +1 -0
  52. package/docs/types/five.TileRequestOrder.html +1 -1
  53. package/docs/types/five.TileRequestSchedulerOptions.html +1 -1
  54. package/docs/types/five.TrajectoryContentData.html +1 -1
  55. package/docs/types/five.Works.html +1 -1
  56. package/five/index.d.ts +122 -79
  57. package/five/index.js +88 -88
  58. package/five/index.mjs +6386 -6037
  59. package/gltf-loader/index.js +5 -5
  60. package/gltf-loader/index.mjs +534 -515
  61. package/line/index.js +3 -3
  62. package/line/index.mjs +3 -3
  63. package/package.json +1 -1
  64. package/plugins/index.js +10 -10
  65. package/plugins/index.mjs +237 -231
  66. package/react/index.d.ts +26 -1
  67. package/react/index.js +3 -3
  68. package/react/index.mjs +33 -39
  69. package/shader-lib/index.js +2 -2
  70. package/shader-lib/index.mjs +2 -2
  71. package/sticker/index.js +3 -3
  72. package/sticker/index.mjs +3 -3
  73. package/umd/five-gltf-loader.js +5 -5
  74. package/umd/five-line.js +3 -3
  75. package/umd/five-plugins.js +10 -10
  76. package/umd/five-react.js +3 -3
  77. package/umd/five-shader-lib.js +2 -2
  78. package/umd/five-sticker.js +3 -3
  79. package/umd/five-vfx.js +2 -2
  80. package/umd/five-vue.js +3 -3
  81. package/umd/five.js +45 -45
  82. package/vfx/index.js +2 -2
  83. package/vfx/index.mjs +2 -2
  84. package/vue/index.d.ts +26 -1
  85. package/vue/index.js +3 -3
  86. package/vue/index.mjs +27 -29
package/vfx/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 12/10/2024
5
- * Version: 6.4.0-alpha.0
4
+ * Generated: 1/8/2025
5
+ * Version: 6.4.0-alpha.10
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
package/vfx/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 12/10/2024
5
- * Version: 6.4.0-alpha.0
4
+ * Generated: 1/8/2025
5
+ * Version: 6.4.0-alpha.10
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
package/vue/index.d.ts CHANGED
@@ -44,9 +44,34 @@ export declare interface FiveActionVueCallbacks {
44
44
  * @param width - 获取像素区域的宽度
45
45
  * @param height - 获取像素区域的高度
46
46
  * @param pixelRatio - 获取区域的像素比
47
+ * @param flipY - 是否Y轴翻转
48
+ * @param buffer - 存储数组
47
49
  * @returns rgba颜色平铺的 Uint8Array
48
50
  */
49
- getPixels(x: number, y: number, width: number, height: number, pixelRatio?: number): Uint8Array;
51
+ getPixels<T extends Uint8Array | Uint8ClampedArray = Uint8Array>(x: number, y: number, width: number, height: number, pixelRatio?: number, flipY?: boolean, buffer?: T): T;
52
+ /**
53
+ * 获取画面中的像素颜色
54
+ * @param options - 参数
55
+ * @returns
56
+ */
57
+ getPixels<T extends Uint8Array | Uint8ClampedArray = Uint8Array>(options: {
58
+ /** 获取像素区域的起始坐标 x */
59
+ x: number;
60
+ /** 获取像素区域的起始坐标 y */
61
+ y: number;
62
+ /** 获取像素区域的宽度 */
63
+ width: number;
64
+ /** 获取像素区域的高度 */
65
+ height: number;
66
+ /** 获取区域的像素比 */
67
+ pixelRatio?: number;
68
+ helperVisible?: boolean;
69
+ skipPanorama?: boolean;
70
+ /** 是否Y轴翻转 */
71
+ flipY?: boolean;
72
+ /** 存储数组 */
73
+ buffer?: T;
74
+ }): T;
50
75
  /**
51
76
  * 强制渲染
52
77
  * @description
package/vue/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 12/10/2024
5
- * Version: 6.4.0-alpha.0
4
+ * Generated: 1/8/2025
5
+ * Version: 6.4.0-alpha.10
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,4 +252,4 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),F=require("@realsee/five"),B=require("three");function O(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const d=O(B);var g=function(){return g=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},g.apply(this,arguments)};var j=!1;function P(e){j=e}var E=Symbol();function l(){var e=t.inject(E);if(!e)throw new Error("Inject five error!");return e}var x={display:"inline-block",overflow:"hidden"},U=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var r=t.toRef(e,"width"),n=t.toRef(e,"height"),o=l(),a=t.ref(null);return t.watch([r,n,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=r.value/n.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(r.value,n.value),o.refresh({width:r.value,height:n.value}),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:g({width:"".concat(r.value,"px"),height:"".concat(n.value,"px")},x),ref:a})}}}),m=[],p=[];function W(e){var r=e===void 0?{}:e,n=r.backgroundColor,o=n===void 0?1579548:n,a=r.backgroundAlpha,u=a===void 0?1:a,i=r.preserveDrawingBuffer,v=i===void 0?!0:i,f=r.pixelRatio,c=f===void 0?1:f,h=r.webgl2,w=h===void 0?!1:h;if(typeof window!="undefined"){var s=null;if(w?s=m.shift():s=p.shift(),!s){if(w){var b=document.createElement("canvas"),C=b.getContext("webgl2");C?s=new d.WebGLRenderer({preserveDrawingBuffer:v,antialias:!0,alpha:!0,stencil:!0,canvas:b,context:C}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),s=new d.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0}))}else s=new d.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0});s.outputEncoding=d.sRGBEncoding}return s.setPixelRatio(c),s.setClearColor(o,u),s.autoClear=!0,s}}function _(e){if(e){var r=e.capabilities.isWebGL2;r?p.indexOf(e)===-1&&p.push(e):m.indexOf(e)===-1&&m.push(e)}}function A(e,r){var n=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(n[a]!==o[a])return!1;return!0}var D=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var r,n=t.toRefs(e).works,o=F.getViewportScale(),a=o===1?window.devicePixelRatio:1,u=W({pixelRatio:a}),i=new F.Five(g({renderer:u},e.fiveInitArgs)),v=e.works||e.initialWorks;return v&&i.load(v,e.initialState,void 0,(r=e.initialUserAction)!==null&&r!==void 0?r:!0),P(!!e.works),n&&t.watch(n,function(f,c){f&&!A(f,i.works)&&i.load(f,e.initialState)}),t.onBeforeUnmount(function(){i&&(i.dispose(),_(i.renderer))}),i.on("load",function(){e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on("stateChange",function(f,c){e.onStateChange&&e.onStateChange(f,c)}),i.on("currentStateChange",function(f,c){e.onCurrentStateChange&&e.onCurrentStateChange(f,c)}),i.on("error",function(f){e.onError?e.onError(f):console.warn(f.message)}),t.provide(E,i),{five:t.shallowReadonly(i)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function L(){var e=l(),r=t.ref(e.works),n=t.readonly(r),o=function(u,i,v,f){if(j)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(u,i,v,f)},a=e.on("load",function(){r.value=e.works});return t.onBeforeUnmount(function(){a()}),[n,o]}function I(){var e=l(),r=t.ref(g({},e.state)),n=e.on("stateChange",function(a){Object.assign(r.value,g({},a))});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){u===void 0&&(u=!1),i===void 0&&(i=!0);var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function V(){var e=l(),r=t.ref(e.getCurrentState()),n=e.on("currentStateChange",function(){Object.assign(r.value,e.getCurrentState())});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function H(){var e=l(),r=t.reactive(e.getCurrentState()),n=t.ref(e.works.getResolvedObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(r,e.getCurrentState()),n.value=e.works.getResolvedObserver({workCode:r.workCode,panoIndex:r.panoIndex})});return t.onBeforeUnmount(function(){o()}),n}function M(e,r){var n=l(),o=n.on(e,r);t.onBeforeUnmount(function(){o()})}function q(){var e=l(),r=function(v,f){return e.updateCamera(v,f)},n=function(v,f,c,h,w){return e.getPixels(v,f,c,h,w)},o=function(v){return e.render(v)},a=function(){return e.needsRender=!0},u=function(v,f){return e.preloadPano(v,f)},i=function(v,f){return f===void 0&&(f=!1),e.project2d(v,f)};return{updateCamera:r,getPixels:n,render:o,needsRender:a,preloadPano:u,project2d:i}}function N(e,r){r===void 0&&(r=!1);var n=l(),o=t.ref(Symbol()),a=t.shallowRef(e?n.project2d(t.isRef(e)?e.value:e,r):null),u=n.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){u()}),t.watch([o,e],function(){a.value=n.project2d(t.isRef(e)?e.value:e,r)}),a}function G(){return N}function y(e){var r=e.camera.getWorldDirection(new d.Vector3),n=new d.Raycaster(e.camera.position,r);return n}function T(){var e=l(),r=t.shallowRef(y(e)),n=e.on("cameraUpdate",function(){r.value=y(e)});return t.onBeforeUnmount(function(){n()}),r}function S(e){return e.camera.getWorldDirection(new d.Vector3)}function $(){var e=l(),r=t.shallowRef(S(e)),n=e.on("cameraUpdate",function(){r.value=S(e)});return t.onBeforeUnmount(function(){n()}),r}function z(e){var r=l(),n=t.shallowRef([]);return t.watch(e,function(){n.value=r.model.intersectRaycaster(t.isRef(e)?e.value:e)}),n}function K(){return z}function R(e){return e.model.empty?"Empty":"Loaded"}function J(){var e=l(),r=t.ref(R(e)),n=e.on("modelLoaded",function(){r.value=R(e)});return t.onBeforeUnmount(function(){n()}),r}function Q(){var e=l(),r=t.ref(e.model.shownFloor),n=t.ref(e.model.floorLength),o=function(u){typeof u=="number"?e.model.show(u):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){r.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){n.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var u;u=a.shift();)u()}),[r,n,o]}function X(){var e=l(),r=t.ref(e.helperVisible),n=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){r.value=a});return t.onBeforeUnmount(function(){o()}),[r,n]}function Y(){return l()}function k(e){return e.model.bounding.clone()}function Z(){var e=l(),r=t.shallowRef(k(e)),n=e.on("modelLoaded",function(){r.value=k(e)});return t.onBeforeUnmount(function(){n()}),r}function ee(){var e=l();return e.scene}function re(){var e=l(),r=t.shallowRef(e.model),n=e.on("modelLoaded",function(){r.value=e.model});return t.onBeforeUnmount(function(){n()}),r}exports.FiveCanvas=U;exports.FiveProvider=D;exports.unsafe__useFiveInject=Y;exports.useFiveAction=q;exports.useFiveCameraDirection=$;exports.useFiveCameraRaycaster=T;exports.useFiveCurrentObserver=H;exports.useFiveCurrentState=V;exports.useFiveEventCallback=M;exports.useFiveFloor=Q;exports.useFiveHelper=X;exports.useFiveModel=re;exports.useFiveModelBounding=Z;exports.useFiveModelIntersectRaycaster=K;exports.useFiveModelReadyState=J;exports.useFiveProject2d=G;exports.useFiveScene=ee;exports.useFiveState=I;exports.useFiveWorks=L;
255
+ */"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),F=require("@realsee/five"),B=require("three");function O(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const c=O(B);var g=function(){return g=Object.assign||function(r){for(var n,o=1,a=arguments.length;o<a;o++){n=arguments[o];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(r[u]=n[u])}return r},g.apply(this,arguments)};var j=!1;function P(e){j=e}var E=Symbol();function l(){var e=t.inject(E);if(!e)throw new Error("Inject five error!");return e}var x={display:"inline-block",overflow:"hidden"},U=t.defineComponent({props:{width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var r=t.toRef(e,"width"),n=t.toRef(e,"height"),o=l(),a=t.ref(null);return t.watch([r,n,a],function(){if(o.renderer&&a.value){if(o.renderer.domElement.parentNode!==null&&o.renderer.domElement.parentNode!==a.value)throw new Error("There are more than 2 fiveCanvas in this context.");o.renderer.domElement.parentNode!==a.value&&a.value.appendChild(o.renderer.domElement),o.camera.aspect=r.value/n.value,o.camera.updateProjectionMatrix(),o.renderer.setSize(r.value,n.value),o.refresh({width:r.value,height:n.value}),o.needsRender=!0}}),function(){return t.h("div",{id:"five",style:g({width:"".concat(r.value,"px"),height:"".concat(n.value,"px")},x),ref:a})}}}),h=[],w=[];function W(e){var r=e===void 0?{}:e,n=r.backgroundColor,o=n===void 0?1579548:n,a=r.backgroundAlpha,u=a===void 0?1:a,i=r.preserveDrawingBuffer,v=i===void 0?!0:i,f=r.pixelRatio,d=f===void 0?1:f,m=r.webgl2,p=m===void 0?!1:m;if(typeof window!="undefined"){var s=null;if(p?s=h.shift():s=w.shift(),!s){if(p){var b=document.createElement("canvas"),C=b.getContext("webgl2");C?s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!0,alpha:!0,stencil:!0,canvas:b,context:C}):(console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."),s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0}))}else s=new c.WebGLRenderer({preserveDrawingBuffer:v,antialias:!1,alpha:!0,stencil:!0});s.outputEncoding=c.sRGBEncoding}return s.setPixelRatio(d),s.setClearColor(o,u),s.autoClear=!0,s}}function _(e){if(e){var r=e.capabilities.isWebGL2;r?w.indexOf(e)===-1&&w.push(e):h.indexOf(e)===-1&&h.push(e)}}function A(e,r){var n=Array.isArray(e)?e:[e],o=Array.isArray(r)?r:[r];if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++)if(n[a]!==o[a])return!1;return!0}var D=t.defineComponent({props:{works:Object,initialWorks:Object,initialState:Object,initialUserAction:Boolean,onWorksChange:Function,onStateChange:Function,onCurrentStateChange:Function,onError:Function,fiveInitArgs:{type:Object,default:function(){return{}}},style:Object},setup:function(e){var r,n=t.toRefs(e).works,o=F.getViewportScale(),a=o===1?window.devicePixelRatio:1,u=W({pixelRatio:a}),i=new F.Five(g({renderer:u},e.fiveInitArgs)),v=e.works||e.initialWorks;return v&&i.load(v,e.initialState,void 0,(r=e.initialUserAction)!==null&&r!==void 0?r:!0),P(!!e.works),n&&t.watch(n,function(f,d){f&&!A(f,i.works)&&i.load(f,e.initialState)}),t.onBeforeUnmount(function(){i&&(i.dispose(),_(i.renderer))}),i.on("load",function(){e.onWorksChange&&i.works&&e.onWorksChange(i==null?void 0:i.works)}),i.on("stateChange",function(f,d){e.onStateChange&&e.onStateChange(f,d)}),i.on("currentStateChange",function(f,d){e.onCurrentStateChange&&e.onCurrentStateChange(f,d)}),i.on("error",function(f){e.onError?e.onError(f):console.warn(f.message)}),t.provide(E,i),{five:t.shallowReadonly(i)}},render:function(){return t.h("div",{style:this.$props.style},this.$slots)}});function L(){var e=l(),r=t.ref(e.works),n=t.readonly(r),o=function(u,i,v,f){if(j)throw new Error("props 'work' is set in fiveProvider, if you need modify work internal, use 'initialWork' instead.");return e.load(u,i,v,f)},a=e.on("load",function(){r.value=e.works});return t.onBeforeUnmount(function(){a()}),[n,o]}function I(){var e=l(),r=t.ref(g({},e.state)),n=e.on("stateChange",function(a){Object.assign(r.value,g({},a))});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){u===void 0&&(u=!1),i===void 0&&(i=!0);var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function V(){var e=l(),r=t.ref(e.getCurrentState()),n=e.on("currentStateChange",function(){Object.assign(r.value,e.getCurrentState())});t.onBeforeUnmount(function(){n()});var o=function(a,u,i){var v=typeof a=="function"?a(e.getCurrentState()):a;e.setState(v,u,i)};return[r,o]}function H(){var e=l(),r=t.reactive(e.getCurrentState()),n=t.ref(e.works.getResolvedObserver(e.pano)),o=e.on("currentStateChange",function(){Object.assign(r,e.getCurrentState()),n.value=e.works.getResolvedObserver({workCode:r.workCode,panoIndex:r.panoIndex})});return t.onBeforeUnmount(function(){o()}),n}function M(e,r){var n=l(),o=n.on(e,r);t.onBeforeUnmount(function(){o()})}function q(){var e=l(),r=function(v,f){return e.updateCamera(v,f)},n=e.getPixels.bind(e),o=function(v){return e.render(v)},a=function(){return e.needsRender=!0},u=function(v,f){return e.preloadPano(v,f)},i=function(v,f){return f===void 0&&(f=!1),e.project2d(v,f)};return{updateCamera:r,getPixels:n,render:o,needsRender:a,preloadPano:u,project2d:i}}function N(e,r){r===void 0&&(r=!1);var n=l(),o=t.ref(Symbol()),a=t.shallowRef(e?n.project2d(t.isRef(e)?e.value:e,r):null),u=n.on("cameraUpdate",function(){o.value=Symbol()});return t.onBeforeUnmount(function(){u()}),t.watch([o,e],function(){a.value=n.project2d(t.isRef(e)?e.value:e,r)}),a}function G(){return N}function y(e){var r=e.camera.getWorldDirection(new c.Vector3),n=new c.Raycaster(e.camera.position,r);return n}function T(){var e=l(),r=t.shallowRef(y(e)),n=e.on("cameraUpdate",function(){r.value=y(e)});return t.onBeforeUnmount(function(){n()}),r}function S(e){return e.camera.getWorldDirection(new c.Vector3)}function $(){var e=l(),r=t.shallowRef(S(e)),n=e.on("cameraUpdate",function(){r.value=S(e)});return t.onBeforeUnmount(function(){n()}),r}function z(e){var r=l(),n=t.shallowRef([]);return t.watch(e,function(){n.value=r.model.intersectRaycaster(t.isRef(e)?e.value:e)}),n}function K(){return z}function R(e){return e.model.empty?"Empty":"Loaded"}function J(){var e=l(),r=t.ref(R(e)),n=e.on("modelLoaded",function(){r.value=R(e)});return t.onBeforeUnmount(function(){n()}),r}function Q(){var e=l(),r=t.ref(e.model.shownFloor),n=t.ref(e.model.floorLength),o=function(u){typeof u=="number"?e.model.show(u):e.model.show()},a=[];return a.push(e.on("modelShownFloorChange",function(){r.value=e.model.shownFloor})),a.push(e.on("modelLoaded",function(){n.value=e.model.floorLength})),t.onBeforeUnmount(function(){for(var u;u=a.shift();)u()}),[r,n,o]}function X(){var e=l(),r=t.ref(e.helperVisible),n=function(a){e.helperVisible=a},o=e.on("helpersVisibleChange",function(a){r.value=a});return t.onBeforeUnmount(function(){o()}),[r,n]}function Y(){return l()}function k(e){return e.model.bounding.clone()}function Z(){var e=l(),r=t.shallowRef(k(e)),n=e.on("modelLoaded",function(){r.value=k(e)});return t.onBeforeUnmount(function(){n()}),r}function ee(){var e=l();return e.scene}function re(){var e=l(),r=t.shallowRef(e.model),n=e.on("modelLoaded",function(){r.value=e.model});return t.onBeforeUnmount(function(){n()}),r}exports.FiveCanvas=U;exports.FiveProvider=D;exports.unsafe__useFiveInject=Y;exports.useFiveAction=q;exports.useFiveCameraDirection=$;exports.useFiveCameraRaycaster=T;exports.useFiveCurrentObserver=H;exports.useFiveCurrentState=V;exports.useFiveEventCallback=M;exports.useFiveFloor=Q;exports.useFiveHelper=X;exports.useFiveModel=re;exports.useFiveModelBounding=Z;exports.useFiveModelIntersectRaycaster=K;exports.useFiveModelReadyState=J;exports.useFiveProject2d=G;exports.useFiveScene=ee;exports.useFiveState=I;exports.useFiveWorks=L;
package/vue/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 12/10/2024
5
- * Version: 6.4.0-alpha.0
4
+ * Generated: 1/8/2025
5
+ * Version: 6.4.0-alpha.10
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,9 +252,9 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import { inject as _, defineComponent as P, toRef as R, ref as s, watch as b, h as O, toRefs as B, onBeforeUnmount as l, provide as D, shallowReadonly as I, readonly as V, reactive as U, shallowRef as p, isRef as C } from "vue";
255
+ */import { inject as _, defineComponent as P, toRef as R, ref as s, watch as w, h as O, toRefs as B, onBeforeUnmount as l, provide as D, shallowReadonly as I, readonly as V, reactive as U, shallowRef as p, isRef as m } from "vue";
256
256
  import { getViewportScale as G, Five as H } from "@realsee/five";
257
- import * as g from "three";
257
+ import * as d from "three";
258
258
  var h = function() {
259
259
  return h = Object.assign || function(r) {
260
260
  for (var n, o = 1, t = arguments.length; o < t; o++) {
@@ -291,7 +291,7 @@ var q = {
291
291
  },
292
292
  setup: function(e) {
293
293
  var r = R(e, "width"), n = R(e, "height"), o = v(), t = s(null);
294
- return b([r, n, t], function() {
294
+ return w([r, n, t], function() {
295
295
  if (o.renderer && t.value) {
296
296
  if (o.renderer.domElement.parentNode !== null && o.renderer.domElement.parentNode !== t.value)
297
297
  throw new Error("There are more than 2 fiveCanvas in this context.");
@@ -305,26 +305,26 @@ var q = {
305
305
  });
306
306
  };
307
307
  }
308
- }), y = [], S = [];
308
+ }), b = [], C = [];
309
309
  function T(e) {
310
- var r = e === void 0 ? {} : e, n = r.backgroundColor, o = n === void 0 ? 1579548 : n, t = r.backgroundAlpha, i = t === void 0 ? 1 : t, a = r.preserveDrawingBuffer, f = a === void 0 ? !0 : a, u = r.pixelRatio, d = u === void 0 ? 1 : u, w = r.webgl2, m = w === void 0 ? !1 : w;
310
+ var r = e === void 0 ? {} : e, n = r.backgroundColor, o = n === void 0 ? 1579548 : n, t = r.backgroundAlpha, i = t === void 0 ? 1 : t, a = r.preserveDrawingBuffer, f = a === void 0 ? !0 : a, u = r.pixelRatio, g = u === void 0 ? 1 : u, y = r.webgl2, S = y === void 0 ? !1 : y;
311
311
  if (typeof window != "undefined") {
312
312
  var c = null;
313
- if (m ? c = y.shift() : c = S.shift(), !c) {
314
- if (m) {
313
+ if (S ? c = b.shift() : c = C.shift(), !c) {
314
+ if (S) {
315
315
  var k = document.createElement("canvas"), F = k.getContext("webgl2");
316
- F ? c = new g.WebGLRenderer({ preserveDrawingBuffer: f, antialias: !0, alpha: !0, stencil: !0, canvas: k, context: F }) : (console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."), c = new g.WebGLRenderer({ preserveDrawingBuffer: f, antialias: !1, alpha: !0, stencil: !0 }));
316
+ F ? c = new d.WebGLRenderer({ preserveDrawingBuffer: f, antialias: !0, alpha: !0, stencil: !0, canvas: k, context: F }) : (console.error("error occurred when getting webgl2 canvas context, mybe webgl2 not support, fallback to webgl."), c = new d.WebGLRenderer({ preserveDrawingBuffer: f, antialias: !1, alpha: !0, stencil: !0 }));
317
317
  } else
318
- c = new g.WebGLRenderer({ preserveDrawingBuffer: f, antialias: !1, alpha: !0, stencil: !0 });
319
- c.outputEncoding = g.sRGBEncoding;
318
+ c = new d.WebGLRenderer({ preserveDrawingBuffer: f, antialias: !1, alpha: !0, stencil: !0 });
319
+ c.outputEncoding = d.sRGBEncoding;
320
320
  }
321
- return c.setPixelRatio(d), c.setClearColor(o, i), c.autoClear = !0, c;
321
+ return c.setPixelRatio(g), c.setClearColor(o, i), c.autoClear = !0, c;
322
322
  }
323
323
  }
324
324
  function $(e) {
325
325
  if (e) {
326
326
  var r = e.capabilities.isWebGL2;
327
- r ? S.indexOf(e) === -1 && S.push(e) : y.indexOf(e) === -1 && y.push(e);
327
+ r ? C.indexOf(e) === -1 && C.push(e) : b.indexOf(e) === -1 && b.push(e);
328
328
  }
329
329
  }
330
330
  function z(e, r) {
@@ -356,16 +356,16 @@ var Y = P({
356
356
  },
357
357
  setup: function(e) {
358
358
  var r, n = B(e).works, o = G(), t = o === 1 ? window.devicePixelRatio : 1, i = T({ pixelRatio: t }), a = new H(h({ renderer: i }, e.fiveInitArgs)), f = e.works || e.initialWorks;
359
- return f && a.load(f, e.initialState, void 0, (r = e.initialUserAction) !== null && r !== void 0 ? r : !0), N(!!e.works), n && b(n, function(u, d) {
359
+ return f && a.load(f, e.initialState, void 0, (r = e.initialUserAction) !== null && r !== void 0 ? r : !0), N(!!e.works), n && w(n, function(u, g) {
360
360
  u && !z(u, a.works) && a.load(u, e.initialState);
361
361
  }), l(function() {
362
362
  a && (a.dispose(), $(a.renderer));
363
363
  }), a.on("load", function() {
364
364
  e.onWorksChange && a.works && e.onWorksChange(a == null ? void 0 : a.works);
365
- }), a.on("stateChange", function(u, d) {
366
- e.onStateChange && e.onStateChange(u, d);
367
- }), a.on("currentStateChange", function(u, d) {
368
- e.onCurrentStateChange && e.onCurrentStateChange(u, d);
365
+ }), a.on("stateChange", function(u, g) {
366
+ e.onStateChange && e.onStateChange(u, g);
367
+ }), a.on("currentStateChange", function(u, g) {
368
+ e.onCurrentStateChange && e.onCurrentStateChange(u, g);
369
369
  }), a.on("error", function(u) {
370
370
  e.onError ? e.onError(u) : console.warn(u.message);
371
371
  }), D(L, a), {
@@ -435,9 +435,7 @@ function te(e, r) {
435
435
  function oe() {
436
436
  var e = v(), r = function(f, u) {
437
437
  return e.updateCamera(f, u);
438
- }, n = function(f, u, d, w, m) {
439
- return e.getPixels(f, u, d, w, m);
440
- }, o = function(f) {
438
+ }, n = e.getPixels.bind(e), o = function(f) {
441
439
  return e.render(f);
442
440
  }, t = function() {
443
441
  return e.needsRender = !0;
@@ -457,20 +455,20 @@ function oe() {
457
455
  }
458
456
  function K(e, r) {
459
457
  r === void 0 && (r = !1);
460
- var n = v(), o = s(Symbol()), t = p(e ? n.project2d(C(e) ? e.value : e, r) : null), i = n.on("cameraUpdate", function() {
458
+ var n = v(), o = s(Symbol()), t = p(e ? n.project2d(m(e) ? e.value : e, r) : null), i = n.on("cameraUpdate", function() {
461
459
  o.value = Symbol();
462
460
  });
463
461
  return l(function() {
464
462
  i();
465
- }), b([o, e], function() {
466
- t.value = n.project2d(C(e) ? e.value : e, r);
463
+ }), w([o, e], function() {
464
+ t.value = n.project2d(m(e) ? e.value : e, r);
467
465
  }), t;
468
466
  }
469
467
  function ae() {
470
468
  return K;
471
469
  }
472
470
  function j(e) {
473
- var r = e.camera.getWorldDirection(new g.Vector3()), n = new g.Raycaster(e.camera.position, r);
471
+ var r = e.camera.getWorldDirection(new d.Vector3()), n = new d.Raycaster(e.camera.position, r);
474
472
  return n;
475
473
  }
476
474
  function ie() {
@@ -482,7 +480,7 @@ function ie() {
482
480
  }), r;
483
481
  }
484
482
  function E(e) {
485
- return e.camera.getWorldDirection(new g.Vector3());
483
+ return e.camera.getWorldDirection(new d.Vector3());
486
484
  }
487
485
  function ue() {
488
486
  var e = v(), r = p(E(e)), n = e.on("cameraUpdate", function() {
@@ -494,8 +492,8 @@ function ue() {
494
492
  }
495
493
  function M(e) {
496
494
  var r = v(), n = p([]);
497
- return b(e, function() {
498
- n.value = r.model.intersectRaycaster(C(e) ? e.value : e);
495
+ return w(e, function() {
496
+ n.value = r.model.intersectRaycaster(m(e) ? e.value : e);
499
497
  }), n;
500
498
  }
501
499
  function fe() {