@realsee/five 6.7.0-alpha.11 → 6.7.0-alpha.13
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/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.Camera.html +5 -5
- package/docs/classes/five.Five.html +1 -1
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +1 -1
- package/docs/classes/five.ModelScene.html +1 -1
- package/docs/classes/five.NetworkSubscribe.html +1 -1
- package/docs/classes/five.PBMContainer.html +1 -1
- package/docs/classes/five.PBMGroup.html +1 -1
- package/docs/classes/five.PBMMesh.html +1 -1
- package/docs/classes/five.PBMMeshMaterial.html +1 -1
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +1 -1
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +1 -1
- package/docs/classes/five.PanoCircleMeshCustom.html +1 -1
- package/docs/classes/five.PanoCircleMeshSolid.html +5 -5
- package/docs/classes/five.Parameter.html +1 -1
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.Tile3D.html +1 -1
- package/docs/classes/five.TileNode.html +1 -1
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.Work.html +16 -16
- package/docs/classes/five.WorkResolvedObserver.html +17 -17
- package/docs/classes/gltf-loader.DDSLoader.html +1 -1
- package/docs/classes/gltf-loader.DRACOLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFLoader.html +1 -1
- package/docs/classes/gltf-loader.GLTFObject.html +1 -1
- package/docs/classes/gltf-loader.THREEGLTFLoader.html +1 -1
- package/docs/classes/line.Line.html +1 -1
- package/docs/classes/line.LineGeometry.html +1 -1
- package/docs/classes/line.LineMaterial.html +1 -1
- package/docs/classes/line.LineSegmentsGeometry.html +1 -1
- package/docs/classes/line.THREE_Line2.html +1 -1
- package/docs/classes/line.THREE_LineSegments2.html +1 -1
- package/docs/classes/plugins.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins.RoundedBoxGeometry.html +1 -1
- package/docs/classes/sticker.Sticker.html +1 -1
- package/docs/classes/vfx.Airflow.html +1 -1
- package/docs/classes/vfx.Flame.html +1 -1
- package/docs/classes/vfx.Particle.html +1 -1
- package/docs/classes/vfx.ParticleGPU.html +1 -1
- package/docs/classes/vfx.SpotLight.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/functions/plugins.DynamicPathLinePlugin.html +1 -0
- package/docs/functions/vue.useFiveWorks.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/five.AddableObject.html +1 -1
- package/docs/interfaces/five.AjaxOptions.html +1 -1
- package/docs/interfaces/five.BaseEvent.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.GestureEvent.html +1 -1
- package/docs/interfaces/five.ImageOptions.html +1 -1
- package/docs/interfaces/five.IntersectEvent.html +1 -1
- package/docs/interfaces/five.IntersectMesh.html +1 -1
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.LooseWorkPanorama.html +1 -1
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +6 -6
- package/docs/interfaces/five.ModeChangeEvent.html +1 -1
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +5 -3
- package/docs/interfaces/five.ModelEvent.html +1 -1
- package/docs/interfaces/five.ModelLike.html +1 -1
- package/docs/interfaces/five.ModelSceneEvent.html +1 -1
- package/docs/interfaces/five.MovePanoOptions.html +1 -1
- package/docs/interfaces/five.NetworkAbortError.html +1 -1
- package/docs/interfaces/five.NetworkFirbiddenError.html +1 -1
- package/docs/interfaces/five.NetworkOptions.html +1 -1
- package/docs/interfaces/five.NetworkProxyError.html +1 -1
- package/docs/interfaces/five.NetworkResourceEvent.html +1 -1
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +1 -1
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +1 -1
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshInterface.html +1 -1
- package/docs/interfaces/five.PanoCircleMeshSolidOptions.html +2 -2
- package/docs/interfaces/five.PanoEvent.html +1 -1
- package/docs/interfaces/five.PanoTextureEvent.html +1 -1
- package/docs/interfaces/five.PanoramaControllerCustomInitArgs.html +12 -10
- package/docs/interfaces/five.PanoramaLikeControllerCustomInitArgs.html +5 -3
- package/docs/interfaces/five.ParameterMaterialValue.html +1 -1
- package/docs/interfaces/five.ParameterTilesetValue.html +1 -1
- package/docs/interfaces/five.ParameterValue.html +1 -1
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +1 -1
- package/docs/interfaces/five.ResolvedParameterValue.html +1 -1
- package/docs/interfaces/five.State.html +1 -1
- package/docs/interfaces/five.StateEvent.html +1 -1
- package/docs/interfaces/five.TextureOptions.html +1 -1
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +1 -1
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +12 -10
- package/docs/interfaces/five.ViewLayer.html +1 -1
- package/docs/interfaces/five.WorkCubeImage.html +2 -2
- package/docs/interfaces/five.WorkImage.html +3 -3
- package/docs/interfaces/five.WorkInitial.html +8 -8
- package/docs/interfaces/five.WorkModel.html +8 -8
- package/docs/interfaces/five.WorkModelLayer.html +6 -6
- package/docs/interfaces/five.WorkObserver.html +18 -18
- package/docs/interfaces/five.WorkTile.html +4 -4
- package/docs/interfaces/five.WorkVideo.html +4 -4
- package/docs/interfaces/five.WorksEvent.html +1 -1
- package/docs/interfaces/five.XRControllerEvent.html +1 -1
- package/docs/interfaces/five.XRGestureEvent.html +1 -1
- package/docs/interfaces/five.XRPanoramaControllerCustomInitArgs.html +12 -10
- package/docs/interfaces/five.XRSessionEvent.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginController.html +1 -1
- package/docs/interfaces/plugins.BackgroundPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins.DynamicPathLinePluginController.html +78 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.Config.html +32 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.EventMap.html +26 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.Params.html +6 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.PathConfig.html +22 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.State.html +10 -0
- package/docs/interfaces/plugins.ItemMaskController.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.ItemMaskPluginType.State.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginController.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.OrientationPluginType.State.html +1 -1
- package/docs/interfaces/plugins.PanoAnimeController.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PanoAnimePluginType.State.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.EventMap.html +1 -1
- package/docs/interfaces/plugins.PluginTemplateType.State.html +1 -1
- package/docs/interfaces/plugins.TrajectoryController.html +1 -1
- package/docs/interfaces/react.FiveInjectionTypes.html +1 -1
- package/docs/modules/plugins.DynamicPathLinePluginType.html +1 -0
- package/docs/modules/plugins.html +1 -1
- package/docs/types/five.ParseOptions.html +6 -6
- package/docs/types/plugins.BasePlugin.EventMap.html +1 -1
- package/docs/types/plugins.DynamicPathLinePluginType.PluginData.html +3 -0
- package/docs/types/plugins.DynamicPathLinePluginType.ServerData.html +3 -0
- package/docs/types/vue.FiveProviderComponent.html +1 -1
- package/five/index.d.ts +6 -2
- package/five/index.js +71 -61
- package/five/index.mjs +3108 -3046
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.d.ts +291 -0
- package/plugins/index.js +298 -15
- package/plugins/index.mjs +2384 -1330
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.d.ts +24 -1
- package/shader-lib/index.js +14 -13
- package/shader-lib/index.mjs +397 -169
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +298 -15
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +14 -13
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +71 -61
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.d.ts +1 -1
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +2 -2
- package/work-downloader/index.mjs +2 -2
package/umd/five-react.js
CHANGED
package/umd/five-shader-lib.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 2025/10
|
|
5
|
-
* Version: 6.7.0-alpha.
|
|
4
|
+
* Generated: 2025/11/10
|
|
5
|
+
* Version: 6.7.0-alpha.13
|
|
6
6
|
* Terms:
|
|
7
7
|
* Realsee SDK License Agreement
|
|
8
8
|
* Update: July 28, 2021
|
|
@@ -252,7 +252,7 @@
|
|
|
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
|
-
*/(function(
|
|
255
|
+
*/(function(y,E){typeof exports=="object"&&typeof module!="undefined"?E(exports,require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three"],E):(y=typeof globalThis!="undefined"?globalThis:y||self,E(y.FiveSDK_ShaderLib={},y.FiveSDK,y.THREE))})(this,(function(y,E,R){"use strict";function V(a){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const o=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(n,e,o.get?o:{enumerable:!0,get:()=>a[e]})}}return n.default=a,Object.freeze(n)}const l=V(R);var F=function(a,n){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,o){e.__proto__=o}||function(e,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t])},F(a,n)};function _(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");F(a,n);function e(){this.constructor=a}a.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}function L(a,n,e,o){function t(r){return r instanceof e?r:new e(function(s){s(r)})}return new(e||(e=Promise))(function(r,s){function f(u){try{i(o.next(u))}catch(d){s(d)}}function c(u){try{i(o.throw(u))}catch(d){s(d)}}function i(u){u.done?r(u.value):t(u.value).then(f,c)}i((o=o.apply(a,n||[])).next())})}function W(a,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,t,r,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=f(0),s.throw=f(1),s.return=f(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function f(i){return function(u){return c([i,u])}}function c(i){if(o)throw new TypeError("Generator is already executing.");for(;s&&(s=0,i[0]&&(e=0)),e;)try{if(o=1,t&&(r=i[0]&2?t.return:i[0]?t.throw||((r=t.return)&&r.call(t),0):t.next)&&!(r=r.call(t,i[1])).done)return r;switch(t=0,r&&(i=[i[0]&2,r.value]),i[0]){case 0:case 1:r=i;break;case 4:return e.label++,{value:i[1],done:!1};case 5:e.label++,t=i[1],i=[0];continue;case 7:i=e.ops.pop(),e.trys.pop();continue;default:if(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(i[0]===6||i[0]===2)){e=0;continue}if(i[0]===3&&(!r||i[1]>r[0]&&i[1]<r[3])){e.label=i[1];break}if(i[0]===6&&e.label<r[1]){e.label=r[1],r=i;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(i);break}r[2]&&e.ops.pop(),e.trys.pop();continue}i=n.call(a,e)}catch(u){i=[6,u],t=0}finally{o=r=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function z(a,n,e){if(e||arguments.length===2)for(var o=0,t=n.length,r;o<t;o++)(r||!(o in n))&&(r||(r=Array.prototype.slice.call(n,0,o)),r[o]=n[o]);return a.concat(r||Array.prototype.slice.call(n))}typeof SuppressedError=="function"&&SuppressedError;var j=`
|
|
256
256
|
#if defined(USE_PLANE_DISTANCE)
|
|
257
257
|
struct Plane {
|
|
258
258
|
vec3 normal;
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
uniform float evennessPlaneConstant;
|
|
264
264
|
uniform float evennessPlaneDepth;
|
|
265
265
|
#endif
|
|
266
|
-
`,
|
|
266
|
+
`,J=`
|
|
267
267
|
#if defined(USE_PLANE_DISTANCE)
|
|
268
268
|
|
|
269
269
|
bool inside = true;
|
|
@@ -283,7 +283,7 @@
|
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
#endif
|
|
286
|
-
`,
|
|
286
|
+
`,H="",q={type:["pointcloud"],fragment:{mainBefore:j,mainStart:H,mainEnd:J},uniforms:{evennessPlaneNormal:new l.Uniform(new l.Vector3),evennessPlaneConstant:new l.Uniform(0),evennessPlanes:new l.Uniform([]),evennessPlaneDepth:new l.Uniform(0)},defines:{USE_PLANE_DISTANCE:!1}},G=(function(a){_(n,a);function n(){var e=a.call(this,q)||this;return Object.defineProperties(e,{evennessPlane:{get:function(){return{depth:this.uniforms.evennessPlaneDepth.value,points:this.uniforms.evennessPoints.value}},set:function(o){var t=o.points,r=o.depth,s=!1;if(t.length!==0&&t.length%4===0){s=!0;var f=t[0],c=t[1],i=t[2],u=t[3],d=new l.Vector3().subVectors(c,f),h=new l.Vector3().subVectors(i,f),m=new l.Vector3().crossVectors(d,h).normalize(),P=-m.dot(f),p=r,g=f.clone().add(m.clone().negate().multiplyScalar(p)),v=f.clone().add(m.clone().multiplyScalar(p)),x=c.clone().add(m.clone().negate().multiplyScalar(p)),w=c.clone().add(m.clone().multiplyScalar(p)),S=i.clone().add(m.clone().negate().multiplyScalar(p)),C=i.clone().add(m.clone().multiplyScalar(p)),M=u.clone().add(m.clone().negate().multiplyScalar(p)),b=u.clone().add(m.clone().multiplyScalar(p)),B=new l.Plane().setFromCoplanarPoints(v,w,C),T=new l.Plane().setFromCoplanarPoints(S,x,g),U=new l.Plane().setFromCoplanarPoints(w,v,g),A=new l.Plane().setFromCoplanarPoints(M,b,C),k=new l.Plane().setFromCoplanarPoints(C,w,x),I=new l.Plane().setFromCoplanarPoints(g,v,b);this.uniforms.evennessPlanes.value=[{normal:B.normal,constant:B.constant},{normal:T.normal,constant:T.constant},{normal:U.normal,constant:U.constant},{normal:A.normal,constant:A.constant},{normal:k.normal,constant:k.constant},{normal:I.normal,constant:I.constant}],this.uniforms.evennessPlaneDepth.value=r,this.uniforms.evennessPlaneNormal.value=m,this.uniforms.evennessPlaneConstant.value=P}this.defines.USE_PLANE_DISTANCE=s,this.needsUpdate=!0}}}),e.evennessPlane={depth:0,points:[]},e}return n})(E.CustomShader),$=`
|
|
287
287
|
#if NUM_SWEEP_OBJECTS > 0
|
|
288
288
|
uniform float sweepProgress;
|
|
289
289
|
uniform float sweepRange;
|
|
@@ -296,7 +296,7 @@
|
|
|
296
296
|
};
|
|
297
297
|
uniform SWEEP_OBJECT sweepBoxs[NUM_SWEEP_OBJECTS];
|
|
298
298
|
#endif
|
|
299
|
-
`,
|
|
299
|
+
`,K=`
|
|
300
300
|
|
|
301
301
|
#if NUM_SWEEP_OBJECTS > 0
|
|
302
302
|
#pragma unroll_loop_start
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
}
|
|
330
330
|
#pragma unroll_loop_end
|
|
331
331
|
#endif
|
|
332
|
-
|
|
332
|
+
`,Y="",Q=(function(a){_(n,a);function n(){var e=a.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:$,mainStart:Y,mainEnd:K},uniforms:{sweepProgress:new l.Uniform(0),sweepRange:new l.Uniform(0),sweepBoxs:new l.Uniform([]),interval:new l.Uniform(.04),threshold:new l.Uniform(.002)},defines:{NUM_SWEEP_OBJECTS:0}})||this;return Object.defineProperties(e,{sweepBoxs:{get:function(){return this.uniforms.sweepBoxs.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SWEEP_OBJECTS=t,this.needsUpdate=!0,this.uniforms.sweepBoxs.value=o)}}}),e.sweepBoxs=[],e}return n.prototype.onBeforeCompile=function(e,o){var t=String(this.sweepBoxs.length);e.vertexShader=e.vertexShader.replace(/NUM_SWEEP_OBJECTS/g,t),e.fragmentShader=e.fragmentShader.replace(/NUM_SWEEP_OBJECTS/g,t)},n})(E.CustomShader),Z=`
|
|
333
333
|
uniform float pointCloudExpand_progress;
|
|
334
334
|
|
|
335
335
|
vec4 pointCloudExpand_permute(vec4 x) { return mod(((x * 34.0) + 1.0) * x, 289.0); }
|
|
@@ -402,7 +402,7 @@ float pointCloudExpand_gln_simplex(vec3 v) {
|
|
|
402
402
|
m = m * m;
|
|
403
403
|
return 42.0 * dot(m * m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));
|
|
404
404
|
}
|
|
405
|
-
`,
|
|
405
|
+
`,X=`
|
|
406
406
|
float pointCloudExpand_sizeScale = 1.0;
|
|
407
407
|
float pointCloudExpand_sizeBasis = 0.0;
|
|
408
408
|
vec4 pointCloudExpand_basis = vec4((modelBoundingMax + modelBoundingMin) / 2.0, 1.0);
|
|
@@ -416,7 +416,8 @@ float pointCloudExpand_progress2 = step(pointCloudExpand_progress, 1.0 - pointCl
|
|
|
416
416
|
pointCloudExpand_sizeBasis = mix(0.1 * step(abs(pointCloudExpand_noise), 0.5 / pointCloudExpand_boundingRadius), pointCloudExpand_sizeBasis, pointCloudExpand_progress2);
|
|
417
417
|
gl_PointSize = gl_PointSize * pointCloudExpand_sizeScale + pointCloudExpand_sizeBasis;
|
|
418
418
|
vPointSize = gl_PointSize;
|
|
419
|
-
`,
|
|
419
|
+
`,ee=(function(a){_(n,a);function n(){return a.call(this,{type:["pointcloud"],vertex:{mainBefore:Z,mainEnd:X},uniforms:{pointCloudExpand_progress:new l.Uniform(0)}})||this}return Object.defineProperty(n.prototype,"progress",{get:function(){return this.uniforms.pointCloudExpand_progress.value},set:function(e){this.uniforms.pointCloudExpand_progress.value=e},enumerable:!1,configurable:!0}),n})(E.CustomShader);const O=`(function(){"use strict";function P(n){onmessage=function(a){Promise.resolve(a.data).then(function(t){return n(t)}).then(function(t){var v=t.output,r=t.transfer;return postMessage(v,r)}).catch(function(t){return postMessage({$$error:t})})}}function y(n,a,t){var v=new OffscreenCanvas(a,t),r=v.getContext("2d");if(!r)throw new Error("Failed to get canvas context");r.clearRect(0,0,a,t),r.fillStyle="rgba(0,0,0,1.0)",r.beginPath();var o=n[0][0],i=n[0][0],u=n[0][1],m=n[0][1];n.forEach(function(e){var f=e[0],s=e[1];o=Math.min(o,f),i=Math.max(i,f),u=Math.min(u,s),m=Math.max(m,s)});var g=i-o,c=m-u,h=g>=c?a/g:a/c,x=n.map(function(e){var f=e[0]-o,s=e[1]-u;return[f,s]}),l=x.map(function(e){return[e[0]*h,e[1]*h]});return l.forEach(function(e,f){var s=e[0],D=e[1];f===0?r.moveTo(s,D):r.lineTo(s,D)}),r.closePath(),r.fill(),r.getImageData(0,0,a,t)}function M(n,a,t){for(var v=new ImageData(a,t),r=n.map(function(s){return y(s.polygon,s.width,s.height)}),o=0;o<a;o++)for(var i=0;i<t;i++){for(var u=0,m=0,g=0,c=0;c<r.length;c++){var h=r[c].data,x=(o+i*a)*4;if(h[x+3]===255){var l=c%8,e=Math.floor(c/8);e===0?u=u|1<<l:e===1?m=m|1<<l:e===2&&(g=g|1<<l)}}var f=(o+i*a)*4;v.data[f]=u,v.data[f+1]=m,v.data[f+2]=g,v.data[f+3]=255}return v}P(function(n){return Promise.resolve(n).then(function(a){var t=a.canvasDataList,v=a.width,r=a.height,o=M(t,v,r);return{output:{imageData:o},transfer:[o.data.buffer]}})})})();
|
|
420
|
+
`,D=typeof self!="undefined"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",O],{type:"text/javascript;charset=utf-8"});function ne(a){let n;try{if(n=D&&(self.URL||self.webkitURL).createObjectURL(D),!n)throw"";const e=new Worker(n,{name:a==null?void 0:a.name});return e.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),e}catch(e){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(O),{name:a==null?void 0:a.name})}}var oe=(function(){function a(n,e){this.disposed=!1,this.pool=e,this.workerCreator=n,this.queue=[],this.workers=[],this.workerResolvers=[],this.workerStatus=0}return a.prototype.setWorkerCreator=function(n){this.workerCreator=n},a.prototype.initWorker=function(n){if(!this.workerCreator)throw new Error("workerCreator is not defined");if(!this.workers[n]){var e=this.workerCreator(n);e.addEventListener("message",this.onMessage.bind(this,n)),this.workers[n]=e}},a.prototype.getIdleWorker=function(){for(var n=0;n<this.pool;n++)if(!(this.workerStatus&1<<n))return n;return-1},a.prototype.onMessage=function(n,e){var o=this.workerResolvers[n];if(e.data&&"$$error"in e.data?o==null||o.reject(e.data.$$error):o==null||o.resolve(e.data),this.workerResolvers[n]=void 0,this.queue.length){var t=this.queue.shift(),r=t.resolve,s=t.reject,f=t.input,c=t.transfer;this.workerResolvers[n]={resolve:r,reject:s},this.workers[n].postMessage(f,c)}else this.workerStatus^=1<<n},a.prototype.postMessage=function(n,e){var o=this;return e===void 0&&(e=[]),new Promise(function(t,r){if(o.disposed){r(new Error("disposed"));return}var s=o.getIdleWorker();s!==-1?(o.initWorker(s),o.workerStatus|=1<<s,o.workerResolvers[s]={resolve:t,reject:r},o.workers[s].postMessage(n,e)):o.queue.push({resolve:t,reject:r,input:n,transfer:e})})},a.prototype.dispose=function(){this.disposed=!0,this.workers.forEach(function(n){n.terminate()}),this.workers.length=0,this.workerResolvers.forEach(function(n){n==null||n.reject(new Error("disposed"))}),this.workerResolvers.length=0,this.queue.forEach(function(n){n.reject(new Error("disposed"))}),this.queue.length=0,this.workerStatus=0},a})();function te(a){if(a.length<3)throw new Error("At least 3 points are required to compute alignment matrix");var n=a[0],e=a[1],o=a[2],t=new l.Vector3().subVectors(e,n),r=new l.Vector3().subVectors(o,n),s=new l.Vector3().crossVectors(t,r);if(s.lengthSq()<1e-4)for(var f=3;f<a.length&&(o=a[f],r=new l.Vector3().subVectors(o,n),s=new l.Vector3().crossVectors(t,r),!(s.lengthSq()>=1e-4));f++);if(s.lengthSq()<1e-4)throw new Error("All points are collinear, cannot compute normal");s.normalize();var c=new l.Vector3;a.forEach(function(S){return c.add(S)}),c.divideScalar(a.length);var i=new l.Vector3(0,1,0),u=new l.Quaternion,d=s.dot(i);if(!(Math.abs(d-1)<1e-4))if(Math.abs(d+1)<1e-4){var h=new l.Vector3(1,0,0);u.setFromAxisAngle(h,Math.PI)}else{var h=new l.Vector3().crossVectors(s,i).normalize(),m=Math.acos(d);u.setFromAxisAngle(h,m)}var P=new l.Matrix4().makeTranslation(-c.x,-c.y,-c.z),p=new l.Matrix4().makeRotationFromQuaternion(u),g=new l.Matrix4;g.multiplyMatrices(p,P);var v=a.map(function(S){var C=S.clone().applyMatrix4(g);return[C.x,C.z]});if(v.length>0){var x=v[0],w=v[v.length-1];(x[0]!==w[0]||x[1]!==w[1])&&v.push([x[0],x[1]])}return{transformMatrix:g,points2D:v}}var re=`
|
|
420
421
|
uniform sampler2D polygonTexture;
|
|
421
422
|
|
|
422
423
|
struct PolygonClipper {
|
|
@@ -430,7 +431,7 @@ vPointSize = gl_PointSize;
|
|
|
430
431
|
#if NUM_POLYGON_CLIPPER > 0
|
|
431
432
|
uniform PolygonClipper polygonClippers[NUM_POLYGON_CLIPPER];
|
|
432
433
|
#endif
|
|
433
|
-
`,
|
|
434
|
+
`,ae=`
|
|
434
435
|
|
|
435
436
|
for(int i = 0; i < NUM_POLYGON_CLIPPER; i++){
|
|
436
437
|
PolygonClipper polygonClipper = polygonClippers[i];
|
|
@@ -500,7 +501,7 @@ vPointSize = gl_PointSize;
|
|
|
500
501
|
}
|
|
501
502
|
}
|
|
502
503
|
|
|
503
|
-
`,N=(function(){function
|
|
504
|
+
`,N=(function(){function a(){this.canvasCache=new Map,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512,this.polygonTexture=new l.CanvasTexture(this.canvas),this.polygonCount=0}return a.prototype.setSize=function(n){this.canvas.width=n,this.canvas.height=n},a.prototype.generatePolygonCanvas=function(n){var e=JSON.stringify(n);if(this.canvasCache.has(e))return this.canvasCache.get(e);var o=document.createElement("canvas");o.width=this.canvas.width,o.height=this.canvas.height;var t=o.getContext("2d");if(!t)throw new Error("Failed to get canvas context");if(this.polygonCount>=24)throw new Error("polygon count exceed 24, please clear the canvas");t.clearRect(0,0,this.canvas.width,this.canvas.height),t.fillStyle="rgba(0,0,0,1.0)",t.beginPath();var r=n[0][0],s=n[0][0],f=n[0][1],c=n[0][1];n.forEach(function(p){var g=p[0],v=p[1];r=Math.min(r,g),s=Math.max(s,g),f=Math.min(f,v),c=Math.max(c,v)});var i=s-r,u=c-f,d=this.canvas.width,h=i>=u?d/i:d/u,m=n.map(function(p){var g=p[0]-r,v=p[1]-f;return[g,v]}),P=m.map(function(p){return[p[0]*h,p[1]*h]});return P.forEach(function(p,g){var v=p[0],x=p[1];g===0?t.moveTo(v,x):t.lineTo(v,x)}),t.closePath(),t.fill(),this.polygonCount++,this.canvasCache.set(e,o),o},a.generatePolygonGeometry=function(n,e){for(var o=new l.BufferGeometry,t=n.slice(0,-1),r=t.map(function(h){return[h[0],0,h[1]]}),s=t.map(function(h){return[h[0],e,h[1]]}),f=z(z([],r,!0),s,!0),c=t.length,i=[],u=1;u<c-1;u++)i.push(0,u,u+1);for(var u=1;u<c-1;u++)i.push(c,c+u,c+u+1);for(var u=0;u<c;u++){var d=(u+1)%c;i.push(u,d,c+u),i.push(d,c+d,c+u)}return o.setAttribute("position",new l.Float32BufferAttribute(f.flat(),3)),o.setIndex(i),o.computeVertexNormals(),o},a.prototype.generatePolygonTexture=function(n){var e=this.canvas.getContext("2d",{willReadFrequently:!0});if(!e)throw new Error("Failed to get canvas context");for(var o=e.createImageData(this.canvas.width,this.canvas.height),t=0;t<this.canvas.width;t++)for(var r=0;r<this.canvas.height;r++){for(var s=0,f=0,c=0,i=0;i<n.length;i++){var u=n[i].getContext("2d",{willReadFrequently:!0});if(!u)throw new Error("Failed to get canvas context");var d=u.getImageData(t,r,1,1).data;if(d[3]===255){var h=i%8,m=Math.floor(i/8);m===0?s=s|1<<h:m===1?f=f|1<<h:m===2&&(c=c|1<<h)}}var P=(t+r*this.canvas.width)*4;o.data[P]=s,o.data[P+1]=f,o.data[P+2]=c,o.data[P+3]=255}return e.putImageData(o,0,0),new l.CanvasTexture(this.canvas)},a})(),ie=(function(a){_(n,a);function n(e){e===void 0&&(e=512);var o=a.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:re,mainEnd:ae},uniforms:{polygonClippers:new l.Uniform([]),polygonTexture:new l.Uniform(null)}})||this;return o._polygonClippers=[],o.polygonGenerater=new N,o._radio=512,o.radio=e,o.workerPool=new oe(function(){return new ne},1),o}return n.prototype.setPolygonClippersAsync=function(e){return L(this,void 0,void 0,function(){var o,t,r,s,f,c,i=this;return W(this,function(u){switch(u.label){case 0:return this._polygonClippers=e,o=this.uniforms,o.polygonClippers.value=e.map(function(d){var h=new l.Matrix4().getInverse(d.polygonTransform),m=d.polygonHeight,P=d.cutOutSide,p=d.polygon,g=p[0][0],v=p[0][0],x=p[0][1],w=p[0][1];p.forEach(function(M){var b=M[0],B=M[1];g=Math.min(g,b),v=Math.max(v,b),x=Math.min(x,B),w=Math.max(w,B)});var S=new l.Vector2(g,x),C=v-g>=w-x?v-g:w-x;return{polygonTransformInverse:h,polygonHeight:m,minPos:S,polygonScale:C,cutOutSide:P}}),t=e.map(function(d){return{polygon:d.polygon,width:i.polygonGenerater.canvas.width,height:i.polygonGenerater.canvas.height}}),[4,this.workerPool.postMessage({canvasDataList:t,width:this.polygonGenerater.canvas.width,height:this.polygonGenerater.canvas.height})];case 1:return r=u.sent(),s=document.createElement("canvas"),s.width=this.polygonGenerater.canvas.width,s.height=this.polygonGenerater.canvas.height,f=s.getContext("2d"),f&&(f.putImageData(r.imageData,0,0),c=new l.CanvasTexture(s),this.uniforms.polygonTexture.value=c,this.needsUpdate=!0),[2]}})})},Object.defineProperty(n.prototype,"polygonClippers",{get:function(){return this._polygonClippers},set:function(e){this._polygonClippers=e},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radio",{get:function(){return this._radio},set:function(e){this._radio=e,this.polygonGenerater.setSize(e)},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){this.workerPool.dispose()},n.prototype.onBeforeCompile=function(e,o){var t=String(this.polygonClippers.length);e.vertexShader=e.vertexShader.replace(/NUM_POLYGON_CLIPPER/g,t),e.fragmentShader=e.fragmentShader.replace(/NUM_POLYGON_CLIPPER/g,t)},n})(E.CustomShader),se=`
|
|
504
505
|
#if NUM_SHINE_OBJECTS > 0
|
|
505
506
|
uniform float shineProgress;
|
|
506
507
|
struct SHINE_OBJECT {
|
|
@@ -509,7 +510,7 @@ vPointSize = gl_PointSize;
|
|
|
509
510
|
};
|
|
510
511
|
uniform SHINE_OBJECT shineBoxes[NUM_SHINE_OBJECTS];
|
|
511
512
|
#endif
|
|
512
|
-
`,
|
|
513
|
+
`,le=`
|
|
513
514
|
#if NUM_SHINE_OBJECTS > 0
|
|
514
515
|
#pragma unroll_loop_start
|
|
515
516
|
for ( int i = 0; i < NUM_SHINE_OBJECTS; i ++ ) {
|
|
@@ -525,4 +526,4 @@ vPointSize = gl_PointSize;
|
|
|
525
526
|
}
|
|
526
527
|
#pragma unroll_loop_end
|
|
527
528
|
#endif
|
|
528
|
-
`,
|
|
529
|
+
`,ue="",ce=(function(a){_(n,a);function n(){var e=a.call(this,{type:["basic","phong","none"],fragment:{mainBefore:se,mainStart:ue,mainEnd:le},uniforms:{shineProgress:new l.Uniform(0),shineBoxes:new l.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}})||this;return Object.defineProperties(e,{shineBoxes:{get:function(){return this.uniforms.shineBoxes.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SHINE_OBJECTS=t,this.uniforms.shineBoxes.value=o)}}}),e.shineBoxes=[],e}return n.prototype.onBeforeCompile=function(e,o){var t=String(this.shineBoxes.length);e.vertexShader=e.vertexShader.replace(/NUM_SHINE_OBJECTS/g,t),e.fragmentShader=e.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,t)},n})(E.CustomShader);y.EvenessPlaneShader=G,y.PointCloudExpandShader=ee,y.PolygonCuterShader=ie,y.PolygonGenerater=N,y.ShineModelShader=ce,y.SweepModelShader=Q,y.computeAlignmentMatrix=te,Object.defineProperty(y,Symbol.toStringTag,{value:"Module"})}));
|
package/umd/five-sticker.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 2025/10
|
|
5
|
-
* Version: 6.7.0-alpha.
|
|
4
|
+
* Generated: 2025/11/10
|
|
5
|
+
* Version: 6.7.0-alpha.13
|
|
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
|
-
*/(function(s,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],u):(s=typeof globalThis!="undefined"?globalThis:s||self,u(s.FiveSDK_Sticker={},s.THREE))})(this,(function(s,u){"use strict";function w(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const o=w(u);var m=function(t,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},m(t,n)};function T(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");m(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;var E=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_=new Float32Array([0,0,1,0,0,1,1,1]),R=new Uint8Array([0,1,2,1,3,2]),c=new o.BufferGeometry;c.setAttribute("position",new o.BufferAttribute(E,3)),c.setAttribute("uv",new o.BufferAttribute(_,2)),c.setIndex(new o.BufferAttribute(R,1));var l=window,g=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame||(function(t){return setTimeout(t,16)}),S=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),v=typeof performance!="undefined"?(function(){return S+performance.now()}):(function(){return Date.now()});function A(t,n){t.naturalWidth>0&&g(function(){return n()});var e=function(){return n()};return t.addEventListener("load",e,!1),function(){return t.removeEventListener("load",e,!1)}}function b(t,n){var e=v(),r=!1,i=function(){r=!0,n();var f=v();f-e<3e3?g(i):r=!1},a=function(){e=v(),r===!1&&i()};return t.addEventListener("timeupdate",a,!1),function(){t.removeEventListener("timeupdate",a,!1),r=!1}}function h(t,n){var e=t.dispose;t.dispose=function(){n(),e.call(t)}}var O=(function(t){T(n,t);function n(e,r,i){var a=this,f=new o.MeshBasicMaterial;if(a=t.call(this,c,f)||this,a._needsRender=!1,a.scale.set(e,r,1),typeof i=="string"){f.transparent=/\.png$/.test(i);var y=new Image;y.src=i,y.crossOrigin="",i=y}if(i instanceof HTMLImageElement){var p=f.map=new o.Texture;p.wrapS=o.ClampToEdgeWrapping,p.wrapT=o.ClampToEdgeWrapping,p.minFilter=o.LinearFilter,p.encoding=o.sRGBEncoding,h(p,A(i,function(){p.image=i,p.needsUpdate=!0,a._needsRender=!0}))}else if(i instanceof HTMLCanvasElement)f.map=new o.CanvasTexture(i);else if(i instanceof HTMLVideoElement){var d=f.map=new o.VideoTexture(i);d.wrapS=o.ClampToEdgeWrapping,d.wrapT=o.ClampToEdgeWrapping,d.minFilter=o.LinearFilter,d.encoding=o.sRGBEncoding,h(d,b(i,function(){a._needsRender=!0}))}return a}return Object.defineProperty(n,"version",{get:function(){return"6.7.0-alpha.
|
|
255
|
+
*/(function(s,u){typeof exports=="object"&&typeof module!="undefined"?u(exports,require("three")):typeof define=="function"&&define.amd?define(["exports","three"],u):(s=typeof globalThis!="undefined"?globalThis:s||self,u(s.FiveSDK_Sticker={},s.THREE))})(this,(function(s,u){"use strict";function w(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const o=w(u);var m=function(t,n){return m=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])},m(t,n)};function T(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");m(t,n);function e(){this.constructor=t}t.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}typeof SuppressedError=="function"&&SuppressedError;var E=new Float32Array([-.5,-.5,0,.5,-.5,0,-.5,.5,0,.5,.5,0]),_=new Float32Array([0,0,1,0,0,1,1,1]),R=new Uint8Array([0,1,2,1,3,2]),c=new o.BufferGeometry;c.setAttribute("position",new o.BufferAttribute(E,3)),c.setAttribute("uv",new o.BufferAttribute(_,2)),c.setIndex(new o.BufferAttribute(R,1));var l=window,g=l.requestAnimationFrame||l.mozRequestAnimationFrame||l.webkitRequestAnimationFrame||l.msRequestAnimationFrame||(function(t){return setTimeout(t,16)}),S=typeof performance!="undefined"&&typeof performance.timing!="undefined"?performance.timing.navigationStart:Date.now(),v=typeof performance!="undefined"?(function(){return S+performance.now()}):(function(){return Date.now()});function A(t,n){t.naturalWidth>0&&g(function(){return n()});var e=function(){return n()};return t.addEventListener("load",e,!1),function(){return t.removeEventListener("load",e,!1)}}function b(t,n){var e=v(),r=!1,i=function(){r=!0,n();var f=v();f-e<3e3?g(i):r=!1},a=function(){e=v(),r===!1&&i()};return t.addEventListener("timeupdate",a,!1),function(){t.removeEventListener("timeupdate",a,!1),r=!1}}function h(t,n){var e=t.dispose;t.dispose=function(){n(),e.call(t)}}var O=(function(t){T(n,t);function n(e,r,i){var a=this,f=new o.MeshBasicMaterial;if(a=t.call(this,c,f)||this,a._needsRender=!1,a.scale.set(e,r,1),typeof i=="string"){f.transparent=/\.png$/.test(i);var y=new Image;y.src=i,y.crossOrigin="",i=y}if(i instanceof HTMLImageElement){var p=f.map=new o.Texture;p.wrapS=o.ClampToEdgeWrapping,p.wrapT=o.ClampToEdgeWrapping,p.minFilter=o.LinearFilter,p.encoding=o.sRGBEncoding,h(p,A(i,function(){p.image=i,p.needsUpdate=!0,a._needsRender=!0}))}else if(i instanceof HTMLCanvasElement)f.map=new o.CanvasTexture(i);else if(i instanceof HTMLVideoElement){var d=f.map=new o.VideoTexture(i);d.wrapS=o.ClampToEdgeWrapping,d.wrapT=o.ClampToEdgeWrapping,d.minFilter=o.LinearFilter,d.encoding=o.sRGBEncoding,h(d,b(i,function(){a._needsRender=!0}))}return a}return Object.defineProperty(n,"version",{get:function(){return"6.7.0-alpha.13"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"needsRender",{get:function(){return this._needsRender},set:function(e){this._needsRender=e,e===!0&&this.material.map&&(this.material.map.needsUpdate=!0)},enumerable:!1,configurable:!0}),n.prototype.setSize=function(e,r){this.scale.set(e,r,1),this._needsRender=!0},n.prototype.setTransparent=function(e){this.material.transparent=e,this._needsRender=!0},n.prototype.locationWithIntersection=function(e,r){r===void 0&&(r=.005);var i=e.point,a=e.face;this.position.copy(i),a&&(this.position.add(a.normal.clone().setLength(r)),this.lookAt(i.clone().add(a.normal))),this._needsRender=!0},n.prototype.dispose=function(){var e;(e=this.material.map)===null||e===void 0||e.dispose(),this.material.dispose()},n})(o.Mesh);s.Sticker=O,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})}));
|
package/umd/five-vfx.js
CHANGED