@realsee/five 6.7.0-alpha.8 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/hierarchy.js +1 -1
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/five.AdaptiveLuminancePass.html +22 -0
- package/docs/classes/five.AnimationFrameLoop.html +4 -4
- package/docs/classes/five.BoundingMesh.html +4 -0
- package/docs/classes/five.Camera.html +6 -5
- package/docs/classes/five.EffectComposer.html +21 -0
- package/docs/classes/five.EyeDomeLightingPass.html +21 -0
- package/docs/classes/five.Five.html +90 -76
- package/docs/classes/five.FivePass.html +18 -0
- package/docs/classes/five.FiveRenderer.html +9 -0
- package/docs/classes/five.FullScreenQuad.html +6 -0
- package/docs/classes/five.InternalWebGLRenderer.html +1 -1
- package/docs/classes/five.Model.html +32 -31
- package/docs/classes/five.ModelScene.html +23 -20
- 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 +6 -7
- package/docs/classes/five.PBMPointCloud.html +1 -1
- package/docs/classes/five.PBMPointCloudMaterial.html +5 -6
- package/docs/classes/five.PBMSkinnedMesh.html +1 -1
- package/docs/classes/five.PanoCircleMesh.html +3 -3
- package/docs/classes/five.PanoCircleMeshCustom.html +4 -4
- package/docs/classes/five.PanoCircleMeshSolid.html +5 -5
- package/docs/classes/five.Parameter.html +44 -47
- package/docs/classes/five.Scene.html +1 -1
- package/docs/classes/five.Subscribe.html +1 -1
- package/docs/classes/five.TextureLoader.html +2 -2
- package/docs/classes/five.Tile3D.html +21 -21
- package/docs/classes/five.TileNode.html +4 -3
- package/docs/classes/five.Tileset.html +4 -4
- package/docs/classes/five.TrajectoryNode.html +1 -1
- package/docs/classes/five.Work.html +16 -16
- package/docs/classes/five.WorkResolvedObserver.html +20 -21
- 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.loadAt3d.html +1 -1
- package/docs/functions/five.parseWork.html +1 -1
- package/docs/functions/five.workToJson.html +1 -1
- package/docs/functions/plugins.DynamicPathLinePlugin.html +1 -0
- package/docs/functions/react.withFive.html +1 -1
- 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.AnimationFrame.html +3 -2
- package/docs/interfaces/five.AnimationFrameContext.html +2 -2
- package/docs/interfaces/five.BaseEvent.html +1 -1
- package/docs/interfaces/five.EventCallback.html +1 -1
- package/docs/interfaces/five.FiveInitArgs.html +3 -3
- package/docs/interfaces/five.FiveLoadOptions.html +8 -10
- 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 +2 -2
- package/docs/interfaces/five.IntersectMeshInterface.html +1 -1
- package/docs/interfaces/five.Intersection.html +1 -1
- package/docs/interfaces/five.LoosePanoWork.html +2 -2
- package/docs/interfaces/five.LooseWork.html +2 -2
- package/docs/interfaces/five.LooseWorkInitial.html +2 -2
- package/docs/interfaces/five.LooseWorkModel.html +3 -2
- package/docs/interfaces/five.LooseWorkObserver.html +3 -2
- package/docs/interfaces/five.LooseWorkPanorama.html +8 -8
- package/docs/interfaces/five.LooseWorkVideo.html +2 -2
- package/docs/interfaces/five.LooseWorkWithExtrinsics.html +7 -7
- package/docs/interfaces/five.ModeChangeEvent.html +2 -2
- package/docs/interfaces/five.ModelControllerCustomInitArgs.html +5 -3
- package/docs/interfaces/five.ModelEvent.html +2 -2
- package/docs/interfaces/five.ModelOptions.html +11 -0
- package/docs/interfaces/five.ModelSceneEvent.html +2 -2
- 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 +2 -2
- package/docs/interfaces/five.NetworkResponseError.html +1 -1
- package/docs/interfaces/five.NetworkTimeoutError.html +1 -1
- package/docs/interfaces/five.ObjectEvent.html +2 -2
- package/docs/interfaces/five.PBMMaterial.html +1 -1
- package/docs/interfaces/five.PBMMeshMaterialParameters.html +2 -3
- package/docs/interfaces/five.PBMPointCloudMaterialParameters.html +2 -3
- 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 +29 -31
- package/docs/interfaces/five.ParameterTilesetValue.html +15 -16
- package/docs/interfaces/five.ParameterValue.html +43 -46
- package/docs/interfaces/five.Pass.html +9 -0
- package/docs/interfaces/five.Pose.html +1 -1
- package/docs/interfaces/five.RenderEvent.html +2 -2
- package/docs/interfaces/five.ResolvedParameterValue.html +43 -46
- 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.TilesetOptions.html +2 -2
- package/docs/interfaces/five.TopviewControllerCustomInitArgs.html +7 -3
- package/docs/interfaces/five.VRPanoramaControllerCustomInitArgs.html +12 -10
- package/docs/interfaces/five.ViewLayer.html +21 -21
- package/docs/interfaces/five.WorkCubeImage.html +2 -2
- package/docs/interfaces/five.WorkImage.html +5 -3
- package/docs/interfaces/five.WorkInitial.html +8 -8
- package/docs/interfaces/five.WorkModel.html +9 -7
- package/docs/interfaces/five.WorkModelJson.html +3 -2
- package/docs/interfaces/five.WorkModelLayer.html +7 -2
- package/docs/interfaces/five.WorkModelLayerJson.html +2 -2
- package/docs/interfaces/five.WorkObserver.html +21 -22
- package/docs/interfaces/five.WorkObserverJson.html +4 -2
- package/docs/interfaces/five.WorkPanoramaJson.html +2 -2
- package/docs/interfaces/five.WorkPanoramasJson.html +2 -2
- package/docs/interfaces/five.WorkTile.html +4 -4
- package/docs/interfaces/five.WorkVideo.html +4 -4
- package/docs/interfaces/five.WorksEvent.html +2 -3
- 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 +83 -0
- package/docs/interfaces/plugins.DynamicPathLinePluginType.Config.html +36 -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 +28 -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 +4 -4
- package/docs/modules/five.html +1 -1
- package/docs/modules/plugins.DynamicPathLinePluginType.html +1 -0
- package/docs/modules/plugins.html +1 -1
- package/docs/types/five.AnimationFrameLoopType.html +1 -1
- package/docs/types/five.Models.html +4 -4
- package/docs/types/five.ParseOptions.html +6 -6
- package/docs/types/five.PostProcessingType.html +1 -1
- package/docs/types/five.RequestAnimationFrameArgs.html +1 -0
- package/docs/types/five.TilesetFrameState.html +2 -3
- 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 +311 -85
- package/five/index.js +299 -198
- package/five/index.mjs +6822 -6456
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +146 -146
- package/line/index.js +3 -3
- package/line/index.mjs +10 -10
- package/package.json +1 -1
- package/plugins/index.d.ts +314 -0
- package/plugins/index.js +296 -15
- package/plugins/index.mjs +2615 -1503
- package/react/index.d.ts +1 -1
- 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 +22 -13
- package/shader-lib/index.mjs +408 -171
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +7 -7
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +296 -15
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +22 -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 +299 -198
- 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 +3 -3
- package/work-downloader/index.mjs +13 -11
- package/docs/interfaces/five.ModelLike.html +0 -3
- package/docs/types/five.Tile3dOptions.html +0 -1
package/react/index.d.ts
CHANGED
|
@@ -825,6 +825,6 @@ works: Works,
|
|
|
825
825
|
loadWork: (work: Work | Work[], state?: "inherit" | "initial" | Partial<Omit<State, "offset">>, options?: number | FiveLoadOptions, userAction?: boolean) => Promise<void>
|
|
826
826
|
];
|
|
827
827
|
|
|
828
|
-
export declare function withFive<F extends FiveInjectionFeature[]>(features: F): <P extends PropTypeOfFiveFeatures<F>, C extends React_2.ComponentClass<P>>(Component: C & React_2.ComponentClass<P>) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<Omit<P, "$five">> & React_2.RefAttributes<Omit<InstanceType<C>, "
|
|
828
|
+
export declare function withFive<F extends FiveInjectionFeature[]>(features: F): <P extends PropTypeOfFiveFeatures<F>, C extends React_2.ComponentClass<P>>(Component: C & React_2.ComponentClass<P>) => React_2.ForwardRefExoticComponent<React_2.PropsWithoutRef<Omit<P, "$five">> & React_2.RefAttributes<Omit<InstanceType<C>, "render" | "context" | "state" | "setState" | "componentDidMount" | "shouldComponentUpdate" | "componentWillUnmount" | "componentDidCatch" | "getSnapshotBeforeUpdate" | "componentDidUpdate" | "componentWillMount" | "UNSAFE_componentWillMount" | "componentWillReceiveProps" | "UNSAFE_componentWillReceiveProps" | "componentWillUpdate" | "UNSAFE_componentWillUpdate" | "forceUpdate" | "props" | "refs">>>;
|
|
829
829
|
|
|
830
830
|
export { }
|
package/react/index.js
CHANGED
package/react/index.mjs
CHANGED
package/shader-lib/index.d.ts
CHANGED
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { CustomShader } from '@realsee/five';
|
|
2
2
|
import * as THREE_2 from 'three';
|
|
3
3
|
|
|
4
|
+
export declare interface AlignmentResult {
|
|
5
|
+
/** 变换矩阵,使得法线与Y轴重合,底面与XZ平面重合 */
|
|
6
|
+
transformMatrix: THREE_2.Matrix4;
|
|
7
|
+
/** 变换后的二维坐标数组 [x, z] */
|
|
8
|
+
points2D: number[][];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 计算将共面点集对齐到XZ平面的变换矩阵,并返回变换后的二维坐标
|
|
13
|
+
* @returns 包含变换矩阵和二维坐标的结果对象
|
|
14
|
+
*/
|
|
15
|
+
export declare function computeAlignmentMatrix(points: THREE_2.Vector3[]): AlignmentResult;
|
|
16
|
+
|
|
4
17
|
export declare class EvenessPlaneShader extends CustomShader {
|
|
5
18
|
/** 平整度的参数*/
|
|
6
19
|
evennessPlane: {
|
|
@@ -21,14 +34,24 @@ export declare interface PolygonClipper {
|
|
|
21
34
|
polygonTransform: THREE_2.Matrix4;
|
|
22
35
|
polygonHeight: number;
|
|
23
36
|
cutOutSide: boolean;
|
|
37
|
+
floorIndex?: number;
|
|
24
38
|
}
|
|
25
39
|
|
|
26
40
|
export declare class PolygonCuterShader extends CustomShader {
|
|
27
41
|
private _polygonClippers;
|
|
42
|
+
private polygonGenerater;
|
|
28
43
|
private _radio;
|
|
29
|
-
|
|
44
|
+
private workerPool;
|
|
45
|
+
constructor(radio?: 256 | 512 | 1024 | 2048);
|
|
46
|
+
/**
|
|
47
|
+
* 异步设置 polygonClippers,使用 web worker 处理纹理生成
|
|
48
|
+
*/
|
|
49
|
+
setPolygonClippersAsync(value: PolygonClipper[]): Promise<void>;
|
|
30
50
|
get polygonClippers(): PolygonClipper[];
|
|
31
51
|
set polygonClippers(value: PolygonClipper[]);
|
|
52
|
+
get radio(): 256 | 512 | 1024 | 2048;
|
|
53
|
+
set radio(value: 256 | 512 | 1024 | 2048);
|
|
54
|
+
dispose(): void;
|
|
32
55
|
onBeforeCompile(shader: THREE_2.Shader, renderer: THREE_2.WebGLRenderer): void;
|
|
33
56
|
}
|
|
34
57
|
|
package/shader-lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated:
|
|
5
|
-
* Version: 6.7.0
|
|
4
|
+
* Generated: 12/29/2025
|
|
5
|
+
* Version: 6.7.0
|
|
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
|
-
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
255
|
+
*/"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("@realsee/five"),k=require("three");function R(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=R(k);var M=function(a,n){return M=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])},M(a,n)};function b(a,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");M(a,n);function e(){this.constructor=a}a.prototype=n===null?Object.create(n):(e.prototype=n.prototype,new e)}function V(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 T(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))}var L=`
|
|
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
|
+
`,J="",H={type:["pointcloud"],fragment:{mainBefore:L,mainStart:J,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}},q=(function(a){b(n,a);function n(){var e=a.call(this,H)||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(),y=-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)),P=c.clone().add(m.clone().multiplyScalar(p)),w=i.clone().add(m.clone().negate().multiplyScalar(p)),C=i.clone().add(m.clone().multiplyScalar(p)),B=u.clone().add(m.clone().negate().multiplyScalar(p)),E=u.clone().add(m.clone().multiplyScalar(p)),S=new l.Plane().setFromCoplanarPoints(v,P,C),_=new l.Plane().setFromCoplanarPoints(w,x,g),z=new l.Plane().setFromCoplanarPoints(P,v,g),O=new l.Plane().setFromCoplanarPoints(B,E,C),N=new l.Plane().setFromCoplanarPoints(C,P,x),D=new l.Plane().setFromCoplanarPoints(g,v,E);this.uniforms.evennessPlanes.value=[{normal:S.normal,constant:S.constant},{normal:_.normal,constant:_.constant},{normal:z.normal,constant:z.constant},{normal:O.normal,constant:O.constant},{normal:N.normal,constant:N.constant},{normal:D.normal,constant:D.constant}],this.uniforms.evennessPlaneDepth.value=r,this.uniforms.evennessPlaneNormal.value=m,this.uniforms.evennessPlaneConstant.value=y}this.defines.USE_PLANE_DISTANCE=s,this.needsUpdate=!0}}}),e.evennessPlane={depth:0,points:[]},e}return n})(F.CustomShader),G=`
|
|
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
|
+
`,$=`
|
|
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){b(n,a);function n(){var e=a.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:G,mainStart:Y,mainEnd:$},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})(F.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
|
+
`,Z=`
|
|
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
|
+
`,X=(function(a){b(n,a);function n(){return a.call(this,{type:["pointcloud"],vertex:{mainBefore:K,mainEnd:Z},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})(F.CustomShader);const U=`(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
|
+
`,I=typeof self!="undefined"&&self.Blob&&new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);",U],{type:"text/javascript;charset=utf-8"});function ee(a){let n;try{if(n=I&&(self.URL||self.webkitURL).createObjectURL(I),!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(U),{name:a==null?void 0:a.name})}}var ne=(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 oe(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(w){return c.add(w)}),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 y=new l.Matrix4().makeTranslation(-c.x,-c.y,-c.z),p=new l.Matrix4().makeRotationFromQuaternion(u),g=new l.Matrix4;g.multiplyMatrices(p,y);var v=a.map(function(w){var C=w.clone().applyMatrix4(g);return[C.x,C.z]});if(v.length>0){var x=v[0],P=v[v.length-1];(x[0]!==P[0]||x[1]!==P[1])&&v.push([x[0],x[1]])}return{transformMatrix:g,points2D:v}}var te=`
|
|
420
421
|
uniform sampler2D polygonTexture;
|
|
421
422
|
|
|
422
423
|
struct PolygonClipper {
|
|
@@ -425,12 +426,13 @@ vPointSize = gl_PointSize;
|
|
|
425
426
|
vec2 minPos;
|
|
426
427
|
float polygonScale;
|
|
427
428
|
bool cutOutSide;
|
|
429
|
+
float floorIndex;
|
|
428
430
|
};
|
|
429
431
|
|
|
430
432
|
#if NUM_POLYGON_CLIPPER > 0
|
|
431
433
|
uniform PolygonClipper polygonClippers[NUM_POLYGON_CLIPPER];
|
|
432
434
|
#endif
|
|
433
|
-
`,
|
|
435
|
+
`,re=`
|
|
434
436
|
|
|
435
437
|
for(int i = 0; i < NUM_POLYGON_CLIPPER; i++){
|
|
436
438
|
PolygonClipper polygonClipper = polygonClippers[i];
|
|
@@ -439,6 +441,13 @@ vPointSize = gl_PointSize;
|
|
|
439
441
|
vec2 minPos = polygonClipper.minPos;
|
|
440
442
|
float polygonScale = polygonClipper.polygonScale;
|
|
441
443
|
bool cutOutSide = polygonClipper.cutOutSide;
|
|
444
|
+
float clipperFloorIndex = polygonClipper.floorIndex;
|
|
445
|
+
|
|
446
|
+
// 楼层判断:如果 floorIndex < 0,对所有楼层生效;否则只对特定楼层生效
|
|
447
|
+
bool isFloorMatch = clipperFloorIndex < 0.0 || abs(floorIndex - clipperFloorIndex) < 1.0;
|
|
448
|
+
if (!isFloorMatch) {
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
442
451
|
|
|
443
452
|
vec4 worldPosition = vFinalPosition;
|
|
444
453
|
vec4 positionInPolygonSpace = polygonTransformInverse * worldPosition;
|
|
@@ -500,7 +509,7 @@ vPointSize = gl_PointSize;
|
|
|
500
509
|
}
|
|
501
510
|
}
|
|
502
511
|
|
|
503
|
-
`,
|
|
512
|
+
`,A=(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]}),y=m.map(function(p){return[p[0]*h,p[1]*h]});return y.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=T(T([],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 y=(t+r*this.canvas.width)*4;o.data[y]=s,o.data[y+1]=f,o.data[y+2]=c,o.data[y+3]=255}return e.putImageData(o,0,0),new l.CanvasTexture(this.canvas)},a})(),ae=(function(a){b(n,a);function n(e){e===void 0&&(e=512);var o=a.call(this,{type:["basic","phong","pointcloud"],fragment:{mainBefore:te,mainEnd:re},uniforms:{polygonClippers:new l.Uniform([]),polygonTexture:new l.Uniform(null)}})||this;return o._polygonClippers=[],o.polygonGenerater=new A,o._radio=512,o.radio=e,o.workerPool=new ne(function(){return new ee},1),o}return n.prototype.setPolygonClippersAsync=function(e){return V(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,y=d.cutOutSide,p=d.polygon,g=d.floorIndex!==void 0?d.floorIndex:-1,v=p[0][0],x=p[0][0],P=p[0][1],w=p[0][1];p.forEach(function(E){var S=E[0],_=E[1];v=Math.min(v,S),x=Math.max(x,S),P=Math.min(P,_),w=Math.max(w,_)});var C=new l.Vector2(v,P),B=x-v>=w-P?x-v:w-P;return{polygonTransformInverse:h,polygonHeight:m,minPos:C,polygonScale:B,cutOutSide:y,floorIndex:g}}),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),c.minFilter=l.NearestFilter,c.magFilter=l.NearestFilter,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})(F.CustomShader),ie=`
|
|
504
513
|
#if NUM_SHINE_OBJECTS > 0
|
|
505
514
|
uniform float shineProgress;
|
|
506
515
|
struct SHINE_OBJECT {
|
|
@@ -509,7 +518,7 @@ vPointSize = gl_PointSize;
|
|
|
509
518
|
};
|
|
510
519
|
uniform SHINE_OBJECT shineBoxes[NUM_SHINE_OBJECTS];
|
|
511
520
|
#endif
|
|
512
|
-
`,
|
|
521
|
+
`,se=`
|
|
513
522
|
#if NUM_SHINE_OBJECTS > 0
|
|
514
523
|
#pragma unroll_loop_start
|
|
515
524
|
for ( int i = 0; i < NUM_SHINE_OBJECTS; i ++ ) {
|
|
@@ -525,4 +534,4 @@ vPointSize = gl_PointSize;
|
|
|
525
534
|
}
|
|
526
535
|
#pragma unroll_loop_end
|
|
527
536
|
#endif
|
|
528
|
-
`,
|
|
537
|
+
`,le="",ue=(function(a){b(n,a);function n(){var e=a.call(this,{type:["basic","phong","none"],fragment:{mainBefore:ie,mainStart:le,mainEnd:se},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})(F.CustomShader);exports.EvenessPlaneShader=q;exports.PointCloudExpandShader=X;exports.PolygonCuterShader=ae;exports.PolygonGenerater=A;exports.ShineModelShader=ue;exports.SweepModelShader=Q;exports.computeAlignmentMatrix=oe;
|