@realsee/five 6.4.2 → 6.4.4
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/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/plugins-1.BasePlugin.Controller.html +1 -1
- package/docs/classes/plugins-1.PanoAnimeController.html +33 -0
- package/docs/functions/plugins-1.PanoAnimePlugin.html +1 -0
- package/docs/hierarchy.html +1 -1
- package/docs/interfaces/plugins-1.BasePlugin.State.html +1 -1
- package/docs/interfaces/plugins-1.PanoAnimePluginType.Config.html +2 -0
- package/docs/interfaces/plugins-1.PanoAnimePluginType.EventMap.html +11 -0
- package/docs/interfaces/plugins-1.PanoAnimePluginType.Params.html +4 -0
- package/docs/interfaces/plugins-1.PanoAnimePluginType.State.html +8 -0
- package/docs/modules/plugins-1.PanoAnimePluginType.html +7 -0
- package/docs/modules/plugins-1.html +3 -0
- package/docs/types/plugins-1.PanoAnimePluginType.PluginData.html +1 -0
- package/docs/types/plugins-1.PanoAnimePluginType.ServerData.html +1 -0
- package/five/index.js +3 -3
- package/five/index.mjs +4 -4
- 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 +77 -0
- package/plugins/index.js +39 -12
- package/plugins/index.mjs +781 -644
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +42 -20
- package/shader-lib/index.mjs +69 -47
- 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 +39 -12
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +43 -21
- 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 +3 -3
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- 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-shader-lib.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated:
|
|
5
|
-
* Version: 6.4.
|
|
4
|
+
* Generated: 2025/7/23
|
|
5
|
+
* Version: 6.4.4
|
|
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(x,P){typeof exports=="object"&&typeof module!="undefined"?P(exports,require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three"],P):(x=typeof globalThis!="undefined"?globalThis:x||self,P(x.FiveSDK_ShaderLib={},x.FiveSDK,x.THREE))})(this,function(x,P,J){"use strict";function
|
|
255
|
+
*/(function(x,P){typeof exports=="object"&&typeof module!="undefined"?P(exports,require("@realsee/five"),require("three")):typeof define=="function"&&define.amd?define(["exports","@realsee/five","three"],P):(x=typeof globalThis!="undefined"?globalThis:x||self,P(x.FiveSDK_ShaderLib={},x.FiveSDK,x.THREE))})(this,function(x,P,J){"use strict";function V(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const n in r)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>r[n]})}}return e.default=r,Object.freeze(e)}const a=V(J);var F=function(r,e){return F=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var t in o)Object.prototype.hasOwnProperty.call(o,t)&&(n[t]=o[t])},F(r,e)};function S(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");F(r,e);function n(){this.constructor=r}r.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}function z(r,e,n){if(n||arguments.length===2)for(var o=0,t=e.length,l;o<t;o++)(l||!(o in e))&&(l||(l=Array.prototype.slice.call(e,0,o)),l[o]=e[o]);return r.concat(l||Array.prototype.slice.call(e))}typeof SuppressedError=="function"&&SuppressedError;var W=`
|
|
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
|
+
`,H=`
|
|
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
|
+
`,R="",L={type:["pointcloud"],fragment:{mainBefore:W,mainStart:R,mainEnd:H},uniforms:{evennessPlaneNormal:new a.Uniform(new a.Vector3),evennessPlaneConstant:new a.Uniform(0),evennessPlanes:new a.Uniform([]),evennessPlaneDepth:new a.Uniform(0)},defines:{USE_PLANE_DISTANCE:!1}},j=function(r){S(e,r);function e(){var n=r.call(this,L)||this;return Object.defineProperties(n,{evennessPlane:{get:function(){return{depth:this.uniforms.evennessPlaneDepth.value,points:this.uniforms.evennessPoints.value}},set:function(o){var t=o.points,l=o.depth,m=!1;if(t.length!==0&&t.length%4===0){m=!0;var d=t[0],u=t[1],p=t[2],i=t[3],g=new a.Vector3().subVectors(u,d),y=new a.Vector3().subVectors(p,d),c=new a.Vector3().crossVectors(g,y).normalize(),h=-c.dot(d),s=l,f=d.clone().add(c.clone().negate().multiplyScalar(s)),v=d.clone().add(c.clone().multiplyScalar(s)),E=u.clone().add(c.clone().negate().multiplyScalar(s)),_=u.clone().add(c.clone().multiplyScalar(s)),w=p.clone().add(c.clone().negate().multiplyScalar(s)),C=p.clone().add(c.clone().multiplyScalar(s)),B=i.clone().add(c.clone().negate().multiplyScalar(s)),O=i.clone().add(c.clone().multiplyScalar(s)),T=new a.Plane().setFromCoplanarPoints(v,_,C),b=new a.Plane().setFromCoplanarPoints(w,E,f),D=new a.Plane().setFromCoplanarPoints(_,v,f),I=new a.Plane().setFromCoplanarPoints(B,O,C),U=new a.Plane().setFromCoplanarPoints(C,_,E),A=new a.Plane().setFromCoplanarPoints(f,v,O);this.uniforms.evennessPlanes.value=[{normal:T.normal,constant:T.constant},{normal:b.normal,constant:b.constant},{normal:D.normal,constant:D.constant},{normal:I.normal,constant:I.constant},{normal:U.normal,constant:U.constant},{normal:A.normal,constant:A.constant}],this.uniforms.evennessPlaneDepth.value=l,this.uniforms.evennessPlaneNormal.value=c,this.uniforms.evennessPlaneConstant.value=h}this.defines.USE_PLANE_DISTANCE=m}}}),n.evennessPlane={depth:0,points:[]},n}return e}(P.CustomShader),G=`
|
|
287
287
|
#if NUM_SWEEP_OBJECTS > 0
|
|
288
288
|
uniform float sweepProgress;
|
|
289
289
|
uniform float sweepRange;
|
|
@@ -329,7 +329,7 @@
|
|
|
329
329
|
}
|
|
330
330
|
#pragma unroll_loop_end
|
|
331
331
|
#endif
|
|
332
|
-
`,$="",
|
|
332
|
+
`,$="",k=function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:G,mainStart:$,mainEnd:q},uniforms:{sweepProgress:new a.Uniform(0),sweepRange:new a.Uniform(0),sweepBoxs:new a.Uniform([]),interval:new a.Uniform(.04),threshold:new a.Uniform(.002)},defines:{NUM_SWEEP_OBJECTS:0}})||this;return Object.defineProperties(n,{sweepBoxs:{get:function(){return this.uniforms.sweepBoxs.value},set:function(o){var t=o.length;t>0&&(this.defines.NUM_SWEEP_OBJECTS=t,this.uniforms.sweepBoxs.value=o)}}}),n.sweepBoxs=[],n}return e.prototype.onBeforeCompile=function(n,o){var t=String(this.sweepBoxs.length);n.vertexShader=n.vertexShader.replace(/NUM_SWEEP_OBJECTS/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_SWEEP_OBJECTS/g,t)},e}(P.CustomShader),K=`
|
|
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
|
+
`,Y=`
|
|
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,7 @@ 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
|
-
`,Q=function(r){S(e,r);function e(){return r.call(this,{type:["pointcloud"],vertex:{mainBefore:
|
|
419
|
+
`,Q=function(r){S(e,r);function e(){return r.call(this,{type:["pointcloud"],vertex:{mainBefore:K,mainEnd:Y},uniforms:{pointCloudExpand_progress:new a.Uniform(0)}})||this}return Object.defineProperty(e.prototype,"progress",{get:function(){return this.uniforms.pointCloudExpand_progress.value},set:function(n){this.uniforms.pointCloudExpand_progress.value=n},enumerable:!1,configurable:!0}),e}(P.CustomShader),Z=`
|
|
420
420
|
uniform sampler2D polygonTexture;
|
|
421
421
|
|
|
422
422
|
struct PolygonClipper {
|
|
@@ -455,12 +455,23 @@ vPointSize = gl_PointSize;
|
|
|
455
455
|
vec2 uv = vec2(normalizedPos.x, 1.0 - normalizedPos.y);
|
|
456
456
|
vec4 color = texture2D(polygonTexture, uv);
|
|
457
457
|
int channel = i / 8;
|
|
458
|
-
|
|
459
|
-
float
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
458
|
+
float bit = (float(i) / 8.0 - floor(float(i) / 8.0)) * 8.0;
|
|
459
|
+
float power = pow(2.0, bit);
|
|
460
|
+
|
|
461
|
+
float channelValue;
|
|
462
|
+
if(i < 8) { // 使用r通道
|
|
463
|
+
channelValue = color.r * 255.0;
|
|
464
|
+
} else if(i < 16) { // 使用g通道
|
|
465
|
+
channelValue = color.g * 255.0;
|
|
466
|
+
} else if(i < 24) { // 使用b通道
|
|
467
|
+
channelValue = color.b * 255.0;
|
|
468
|
+
} else { // 使用a通道
|
|
469
|
+
channelValue = color.a * 255.0;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
float masked = floor(channelValue / power + 0.001);
|
|
473
|
+
if(mod(masked, 2.0) < 0.5) {
|
|
474
|
+
discard;
|
|
464
475
|
}
|
|
465
476
|
}
|
|
466
477
|
}else{
|
|
@@ -468,17 +479,28 @@ vPointSize = gl_PointSize;
|
|
|
468
479
|
vec2 uv = vec2(normalizedPos.x, 1.0 - normalizedPos.y);
|
|
469
480
|
vec4 color = texture2D(polygonTexture, uv);
|
|
470
481
|
int channel = i / 8;
|
|
471
|
-
|
|
472
|
-
float
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
482
|
+
|
|
483
|
+
float bit = (float(i) / 8.0 - floor(float(i) / 8.0)) * 8.0;
|
|
484
|
+
float power = pow(2.0, bit);
|
|
485
|
+
float channelValue;
|
|
486
|
+
if(i < 8) { // 使用r通道
|
|
487
|
+
channelValue = color.r * 255.0;
|
|
488
|
+
} else if(i < 16) { // 使用g通道
|
|
489
|
+
channelValue = color.g * 255.0;
|
|
490
|
+
} else if(i < 24) { // 使用b通道
|
|
491
|
+
channelValue = color.b * 255.0;
|
|
492
|
+
} else { // 使用a通道
|
|
493
|
+
channelValue = color.a * 255.0;
|
|
494
|
+
}
|
|
495
|
+
float masked = floor(channelValue / power + 0.001);
|
|
496
|
+
if(mod(masked, 2.0) > 0.0) {
|
|
497
|
+
discard;
|
|
476
498
|
}
|
|
477
499
|
}
|
|
478
500
|
}
|
|
479
501
|
}
|
|
480
502
|
|
|
481
|
-
`,N=function(){function r(){this.canvasCache=new Map,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512,this.polygonTexture=new a.CanvasTexture(this.canvas),this.polygonCount=0}return r.prototype.setSize=function(e){this.canvas.width=e,this.canvas.height=e},r.prototype.generatePolygonCanvas=function(e){var n=JSON.stringify(e);if(this.canvasCache.has(n))return this.canvasCache.get(n);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 l=e[0][0],m=e[0][0],d=e[0][1],u=e[0][1];e.forEach(function(s){var
|
|
503
|
+
`,N=function(){function r(){this.canvasCache=new Map,this.canvas=document.createElement("canvas"),this.canvas.width=512,this.canvas.height=512,this.polygonTexture=new a.CanvasTexture(this.canvas),this.polygonCount=0}return r.prototype.setSize=function(e){this.canvas.width=e,this.canvas.height=e},r.prototype.generatePolygonCanvas=function(e){var n=JSON.stringify(e);if(this.canvasCache.has(n))return this.canvasCache.get(n);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 l=e[0][0],m=e[0][0],d=e[0][1],u=e[0][1];e.forEach(function(s){var f=s[0],v=s[1];l=Math.min(l,f),m=Math.max(m,f),d=Math.min(d,v),u=Math.max(u,v)});var p=m-l,i=u-d,g=this.canvas.width,y=p>=i?g/p:g/i,c=e.map(function(s){var f=s[0]-l,v=s[1]-d;return[f,v]}),h=c.map(function(s){return[s[0]*y,s[1]*y]});return h.forEach(function(s,f){var v=s[0],E=s[1];f===0?t.moveTo(v,E):t.lineTo(v,E)}),t.closePath(),t.fill(),this.polygonCount++,this.canvasCache.set(n,o),o},r.generatePolygonGeometry=function(e,n){for(var o=new a.BufferGeometry,t=e.slice(0,-1),l=t.map(function(g){return[g[0],0,g[1]]}),m=t.map(function(g){return[g[0],n,g[1]]}),d=z(z([],l,!0),m,!0),u=t.length,p=[],i=1;i<u-1;i++)p.push(0,i,i+1);for(var i=1;i<u-1;i++)p.push(u,u+i,u+i+1);for(var i=0;i<u-1;i++)p.push(i,i+1,u+i),p.push(i+1,i+1+u,u+i);return o.setAttribute("position",new a.Float32BufferAttribute(d.flat(),3)),o.setIndex(p),o.computeVertexNormals(),o},r.prototype.generatePolygonTexture=function(e){var n=this.canvas.getContext("2d",{willReadFrequently:!0});if(!n)throw new Error("Failed to get canvas context");for(var o=n.createImageData(this.canvas.width,this.canvas.height),t=0;t<this.canvas.width;t++)for(var l=0;l<this.canvas.height;l++){for(var m=0,d=0,u=0,p=0;p<e.length;p++){var i=e[p].getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("Failed to get canvas context");var g=i.getImageData(t,l,1,1).data;if(g[3]===255){var y=p%8,c=Math.floor(p/8);c===0?m=m|1<<y:c===1?d=d|1<<y:c===2&&(u=u|1<<y)}}var h=(t+l*this.canvas.width)*4;o.data[h]=m,o.data[h+1]=d,o.data[h+2]=u,o.data[h+3]=255}return n.putImageData(o,0,0),new a.CanvasTexture(this.canvas)},r}(),M=new N,nn=function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:Z,mainEnd:X},uniforms:{polygonClippers:new a.Uniform([]),polygonTexture:new a.Uniform(null)}})||this;return n._polygonClippers=[],n._radio=512,n}return Object.defineProperty(e.prototype,"polygonClippers",{get:function(){return this._polygonClippers},set:function(n){this._polygonClippers=n;var o=this.uniforms;o.polygonClippers.value=n.map(function(p){var i=new a.Matrix4().getInverse(p.polygonTransform),g=p.polygonHeight,y=p.cutOutSide,c=p.polygon,h=c[0][0],s=c[0][0],f=c[0][1],v=c[0][1];c.forEach(function(w){var C=w[0],B=w[1];h=Math.min(h,C),s=Math.max(s,C),f=Math.min(f,B),v=Math.max(v,B)});var E=new a.Vector2(h,f),_=s-h>=v-f?s-h:v-f;return{polygonTransformInverse:i,polygonHeight:g,minPos:E,polygonScale:_,cutOutSide:y}});for(var t=[],l=0;l<n.length;l++){var m=n[l].polygon,d=M.generatePolygonCanvas(m);t.push(d)}var u=M.generatePolygonTexture(t);this.uniforms.polygonTexture.value=u},enumerable:!1,configurable:!0}),e.prototype.onBeforeCompile=function(n,o){var t=String(this.polygonClippers.length);n.vertexShader=n.vertexShader.replace(/NUM_POLYGON_CLIPPER/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_POLYGON_CLIPPER/g,t)},e}(P.CustomShader),en=`
|
|
482
504
|
#if NUM_SHINE_OBJECTS > 0
|
|
483
505
|
uniform float shineProgress;
|
|
484
506
|
struct SHINE_OBJECT {
|
|
@@ -503,4 +525,4 @@ vPointSize = gl_PointSize;
|
|
|
503
525
|
}
|
|
504
526
|
#pragma unroll_loop_end
|
|
505
527
|
#endif
|
|
506
|
-
`,tn="",rn=function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","none"],fragment:{mainBefore:en,mainStart:tn,mainEnd:on},uniforms:{shineProgress:new a.Uniform(0),shineBoxes:new a.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}})||this;return Object.defineProperties(n,{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)}}}),n.shineBoxes=[],n}return e.prototype.onBeforeCompile=function(n,o){var t=String(this.shineBoxes.length);n.vertexShader=n.vertexShader.replace(/NUM_SHINE_OBJECTS/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,t)},e}(P.CustomShader);x.EvenessPlaneShader=j,x.PointCloudExpandShader=Q,x.PolygonCuterShader=nn,x.PolygonGenerater=N,x.ShineModelShader=rn,x.SweepModelShader=
|
|
528
|
+
`,tn="",rn=function(r){S(e,r);function e(){var n=r.call(this,{type:["basic","phong","none"],fragment:{mainBefore:en,mainStart:tn,mainEnd:on},uniforms:{shineProgress:new a.Uniform(0),shineBoxes:new a.Uniform([])},defines:{NUM_SHINE_OBJECTS:0}})||this;return Object.defineProperties(n,{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)}}}),n.shineBoxes=[],n}return e.prototype.onBeforeCompile=function(n,o){var t=String(this.shineBoxes.length);n.vertexShader=n.vertexShader.replace(/NUM_SHINE_OBJECTS/g,t),n.fragmentShader=n.fragmentShader.replace(/NUM_SHINE_OBJECTS/g,t)},e}(P.CustomShader);x.EvenessPlaneShader=j,x.PointCloudExpandShader=Q,x.PolygonCuterShader=nn,x.PolygonGenerater=N,x.ShineModelShader=rn,x.SweepModelShader=k,Object.defineProperty(x,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:
|
|
5
|
-
* Version: 6.4.
|
|
4
|
+
* Generated: 2025/7/23
|
|
5
|
+
* Version: 6.4.4
|
|
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.4.
|
|
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.4.4"},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