u-space 0.0.5 → 0.0.9
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/dist/index.cjs +16 -1
- package/dist/index.js +1657 -412
- package/dist/plugins/u-manager/flows/ComponentFlowParser.d.ts +8 -0
- package/dist/plugins/u-manager/flows/FlowParser.d.ts +48 -0
- package/dist/plugins/u-manager/flows/edges/index.d.ts +9 -0
- package/dist/plugins/u-manager/flows/index.d.ts +4 -0
- package/dist/plugins/u-manager/flows/nodes/ColorNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/ConditionNode.d.ts +9 -0
- package/dist/plugins/u-manager/flows/nodes/DataExtractionNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/DataFilterNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/DelayNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/EmissiveNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/FlyToNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/HideNode.d.ts +10 -0
- package/dist/plugins/u-manager/flows/nodes/HighlightNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/MeshNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/MeshesNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/ModelNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/ModelsNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/Node.d.ts +52 -0
- package/dist/plugins/u-manager/flows/nodes/NumberNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/OpacityNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/POINode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/POISNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/PathNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/PathsNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/RotateNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/ScaleNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/ShowNode.d.ts +10 -0
- package/dist/plugins/u-manager/flows/nodes/SpaceNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/SpacesNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/StartNode.d.ts +7 -0
- package/dist/plugins/u-manager/flows/nodes/TranslateNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/UnEmissiveNode.d.ts +10 -0
- package/dist/plugins/u-manager/flows/nodes/UnHighlightNode.d.ts +10 -0
- package/dist/plugins/u-manager/flows/nodes/UnOpacityNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/UserDataNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/clip-animation/ClipAnimationNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/clip-animation/UnClipAnimationNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/clip-animation/index.d.ts +2 -0
- package/dist/plugins/u-manager/flows/nodes/component-tween-animation/ComponentTweenAnimationNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/component-tween-animation/UnComponentTweenAnimationNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/component-tween-animation/index.d.ts +2 -0
- package/dist/plugins/u-manager/flows/nodes/component-tween-animation/utils.d.ts +5 -0
- package/dist/plugins/u-manager/flows/nodes/index.d.ts +34 -0
- package/dist/plugins/u-manager/flows/nodes/tween-animation/TweenAnimationNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/tween-animation/UnTweenAnimationNode.d.ts +8 -0
- package/dist/plugins/u-manager/flows/nodes/tween-animation/index.d.ts +2 -0
- package/dist/plugins/u-manager/flows/nodes/tween-animation/utils.d.ts +5 -0
- package/dist/plugins/u-manager/flows/types.d.ts +81 -0
- package/dist/plugins/u-manager/flows/utils.d.ts +14 -0
- package/dist/plugins/u-manager/index.cjs +59 -59
- package/dist/plugins/u-manager/index.d.ts +1 -0
- package/dist/plugins/u-manager/index.js +9692 -8601
- package/dist/src/effects/MaterialEffects.d.ts +33 -3
- package/dist/src/index.d.ts +9 -0
- package/dist/src/interactions/InteractionManager.d.ts +31 -0
- package/dist/src/interactions/Selection.d.ts +77 -0
- package/dist/src/interactions/index.d.ts +1 -0
- package/dist/src/managers/LightManager.d.ts +101 -0
- package/dist/src/managers/ObjectManager.d.ts +33 -1
- package/dist/src/managers/SceneManager.d.ts +57 -0
- package/dist/src/managers/index.d.ts +2 -0
- package/dist/src/objects/Model.d.ts +13 -1
- package/dist/src/tools/AnnotationManager.d.ts +104 -0
- package/dist/src/tools/ClippingTool.d.ts +96 -0
- package/dist/src/tools/MeasureTool.d.ts +80 -0
- package/dist/src/tools/index.d.ts +3 -0
- package/dist/src/viewers/CSSRenderer.d.ts +19 -0
- package/dist/src/viewers/CameraControls.d.ts +30 -0
- package/dist/src/viewers/RenderPipeline.d.ts +30 -2
- package/dist/src/viewers/Viewer.d.ts +54 -1
- package/dist/src/viewers/index.d.ts +2 -0
- package/docs/api-camera-controls.md +146 -0
- package/docs/api-css-renderer.md +43 -0
- package/docs/api-effects.md +95 -15
- package/docs/api-interactions.md +107 -7
- package/docs/api-managers.md +181 -0
- package/docs/api-objects.md +46 -13
- package/docs/api-plugin-atmosphere.md +10 -0
- package/docs/api-plugin-curve-movement.md +38 -0
- package/docs/api-plugin-keyboard-controls.md +40 -0
- package/docs/api-plugin-minimap.md +36 -0
- package/docs/api-plugin-object-controls.md +67 -0
- package/docs/api-plugin-tiles.md +26 -0
- package/docs/api-plugin-topology-drawer.md +74 -0
- package/docs/api-plugin-tracking-controls.md +23 -0
- package/docs/api-plugin-u-manager.md +123 -0
- package/docs/api-render-pipeline.md +114 -0
- package/docs/api-tools.md +254 -0
- package/docs/api-viewer.md +97 -0
- package/docs/changelog.md +105 -0
- package/docs/examples-guide.md +130 -0
- package/docs/getting-started.md +13 -1
- package/docs/index.md +20 -12
- package/package.json +1 -1
- package/docs/api-plugins.md +0 -449
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# 更新日志
|
|
2
|
+
|
|
3
|
+
## 0.0.8 (开发中)
|
|
4
|
+
|
|
5
|
+
### 新增
|
|
6
|
+
|
|
7
|
+
- **Viewer** — `resize()`、`screenshot()`、`setBackground()`、`setEnvironment()`、`enableShadow()`/`disableShadow()`、`enableFog()`/`enableFogExp2()`/`disableFog()`
|
|
8
|
+
- **CameraControls** — `flyTo()`、`getCameraViewpoint()`、`lock()`/`unlock()`、`setViewMode('2d' | '3d')`
|
|
9
|
+
- **ObjectManager** — `show()`/`hide()`、`isolate()`、`showAll()`、`setOpacity()`、`getBoundingBox()`、`forEach()`、`filter()`
|
|
10
|
+
- **InteractionManager** — `enable()`/`disable()`、`setInteractable()`、`addIgnore()`/`removeIgnore()`
|
|
11
|
+
- **Selection** — 新增框选(rubber-band)和单选/多选/切换模块,支持 `select`/`deselect`/`change` 事件
|
|
12
|
+
- **MaterialEffects** — `wireframe()`/`removeWireframe()`、`transparent()`/`removeTransparent()`、`xray()`/`removeXray()`、`fadeIn()`/`fadeOut()`
|
|
13
|
+
- **Model** — `getBoundingBox()`、`getCenter()`、`setMaterial()`
|
|
14
|
+
- **SceneManager** — 新模块,多场景创建、注册、切换与序列化
|
|
15
|
+
- **LightManager** — 新模块,灯光便捷创建、4 种预设(indoor/outdoor/studio/warehouse)、Helper 可视化
|
|
16
|
+
- **MeasureTool** — 新工具,距离/面积/角度测量,结果可视化渲染到场景
|
|
17
|
+
- **ClippingTool** — 新工具,基于 WebGPU `ClippingGroup` 的剖切面与剖切盒
|
|
18
|
+
- **AnnotationManager** — 新工具,3D 引线标注 + HTML 浮动标签
|
|
19
|
+
- **示例** — 新增 8 个交互式示例页面
|
|
20
|
+
|
|
21
|
+
### 修复
|
|
22
|
+
|
|
23
|
+
- **Selection** — 框选覆盖层改为挂载到容器元素(而非 canvas),修复框选矩形不可见的问题
|
|
24
|
+
- **ClippingTool** — 从 `renderer.clippingPlanes`(WebGL API)重写为 `ClippingGroup`(WebGPU API),修复剖切无效的问题
|
|
25
|
+
- **MaterialEffects** — fade 动画在对象移除场景后自动停止,避免内存泄漏
|
|
26
|
+
- **InteractionManager** — `dispose()` 中清除 `clickTimer`,避免定时器泄漏
|
|
27
|
+
- **LightManager** — 修复 `removeAll()`/`hideAllHelpers()` 中遍历 Map 同时删除的问题
|
|
28
|
+
- **ObjectManager** — `setOpacity()` 先检查 `isMesh` 再类型转换
|
|
29
|
+
- **ClippingTool** — `PlaneHelper` 颜色使用 `new Color(color).getHex()` 替代直接 `as number`
|
|
30
|
+
- **MeasureTool** — 移除 WebGPU 不支持的 `linewidth` 属性
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 0.0.7
|
|
35
|
+
|
|
36
|
+
### 变更
|
|
37
|
+
|
|
38
|
+
- 文档拆分:将插件文档拆分为独立文件
|
|
39
|
+
- 新增 CameraControls 独立文档页
|
|
40
|
+
- 修复 getting-started 中的死链
|
|
41
|
+
- 修复 sbmx loader 示例使用新的 MaterialEffects API
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 0.0.6
|
|
46
|
+
|
|
47
|
+
### 新增
|
|
48
|
+
|
|
49
|
+
- **MaterialEffects** — 可组合的材质特效系统,支持安全共享材质和 remove API
|
|
50
|
+
- **RenderPipeline** — 内置 Bloom、SSGI、TRAA 后处理及 OutputComposer API
|
|
51
|
+
- **CSSRenderer** — CSS2D / CSS2.5D / CSS3D 叠加渲染 HTML 元素
|
|
52
|
+
- 从 `package.json` 导出 `version`,统一示例 importmap
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 0.0.5
|
|
57
|
+
|
|
58
|
+
### 变更
|
|
59
|
+
|
|
60
|
+
- 版本发布(无重大功能变更)
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 0.0.4
|
|
65
|
+
|
|
66
|
+
### 新增
|
|
67
|
+
|
|
68
|
+
- **Model** — 动画播放支持(`playAnimation`、`stopAnimation`、`updateAnimation`)
|
|
69
|
+
- **ViewerEventMap** — 事件回调新增 `delta` 时间参数
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 0.0.3
|
|
74
|
+
|
|
75
|
+
### 新增
|
|
76
|
+
|
|
77
|
+
- **ObjectControls** 插件 — 交互式移动、旋转、缩放 3D 对象
|
|
78
|
+
- **TopologyDrawer** 插件 — 在场景任意表面交互式绘制拓扑路径图
|
|
79
|
+
- **Topology** — `exportData()` / `importData()` 数据序列化
|
|
80
|
+
|
|
81
|
+
### 变更
|
|
82
|
+
|
|
83
|
+
- **Interactions** — `contextmenu` 事件替换为 `rightclick`
|
|
84
|
+
- **Poi** — 优化渲染性能,新增 `scaleFactor` 参数
|
|
85
|
+
- 文档全面完善:本地搜索、侧边栏优化、各插件文档页
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## 0.0.0
|
|
90
|
+
|
|
91
|
+
### 新增
|
|
92
|
+
|
|
93
|
+
- 项目初始化:Viewer 核心、WebGPU 渲染器、场景/相机/控制器
|
|
94
|
+
- 模型加载系统:双层缓存(内存 + 持久化)、Draco/KTX2/Meshopt 支持
|
|
95
|
+
- 交互系统:射线检测、事件冒泡、自定义 3D 对象事件
|
|
96
|
+
- 对象系统:Model、Poi、Topology、基础网格(Sphere/Plane/Circle/Tube/Extrude/Shape)
|
|
97
|
+
- ObjectManager 集中式对象注册
|
|
98
|
+
- 补间动画系统
|
|
99
|
+
- u-manager 插件:场景加载、动画、属性、视点管理
|
|
100
|
+
- tiles 插件:ArcGIS 3D 瓦片 / GIS 地球渲染
|
|
101
|
+
- minimap 插件:2D 小地图
|
|
102
|
+
- keyboard-controls 插件:WASD 键盘控制
|
|
103
|
+
- tracking-controls 插件:相机跟随
|
|
104
|
+
- atmosphere 插件:天空/大气渲染
|
|
105
|
+
- curve-movement 插件:曲线路径动画
|
package/docs/examples-guide.md
CHANGED
|
@@ -60,3 +60,133 @@
|
|
|
60
60
|
- 监听 `beforeRender` 事件,通过 `model.updateAnimation(e.delta)` 推进动画时间。
|
|
61
61
|
- 使用 `model.playAnimation(name)` 按名称播放单个动画,`model.playAllAnimations()` 播放全部。
|
|
62
62
|
- 使用 `model.stopAnimation()` 停止动画播放。
|
|
63
|
+
|
|
64
|
+
## 6. `test_css_renderer.html`:CSS2D / CSS2.5D / CSS3D 渲染器
|
|
65
|
+
|
|
66
|
+
该示例演示了如何在 3D 场景中叠加渲染 HTML 元素,展示三种 CSS 渲染模式的效果差异。
|
|
67
|
+
|
|
68
|
+
### 核心要点:
|
|
69
|
+
|
|
70
|
+
- 使用 `viewer.cssRenderer.createCSS2DObject()` 创建始终面向相机、固定屏幕尺寸的 2D 标签。
|
|
71
|
+
- 使用 `viewer.cssRenderer.createCSS25DObject()` 创建面向相机但随距离缩放的 2.5D 精灵。
|
|
72
|
+
- 使用 `viewer.cssRenderer.createCSS3DObject()` 创建具有完整 3D 变换的面板。
|
|
73
|
+
- CSS2.5D 和 CSS3D 对象需要设置 `scale`(通常 `0.01`),因为 HTML 元素的像素尺寸远大于 3D 世界单位。
|
|
74
|
+
- 渲染器采用懒加载,仅在首次创建对应类型对象时初始化。
|
|
75
|
+
|
|
76
|
+
## 7. `test_postprocessing.html`:后处理效果
|
|
77
|
+
|
|
78
|
+
该示例演示了 `RenderPipeline` 的内置后处理功能,包括 Bloom、SSGI、TRAA 以及自定义后处理组合器。
|
|
79
|
+
|
|
80
|
+
### 核心要点:
|
|
81
|
+
|
|
82
|
+
- 使用 `viewer.renderPipeline.enableBloom()` / `disableBloom()` 运行时切换 Bloom 效果。
|
|
83
|
+
- 使用 `viewer.renderPipeline.updateBloom()` 实时调整 strength、radius、threshold 参数。
|
|
84
|
+
- 使用 `viewer.renderPipeline.enableSSGI()` / `disableSSGI()` 切换屏幕空间全局光照。
|
|
85
|
+
- 使用 `viewer.renderPipeline.updateSSGI()` 实时调整 SSGI 参数(直接修改 uniform,无需重建节点图)。
|
|
86
|
+
- 使用 `viewer.renderPipeline.enableTRAA()` / `disableTRAA()` 切换时间抗锯齿。
|
|
87
|
+
- 使用 `viewer.renderPipeline.setOutputComposer()` 自定义后处理链(示例中实现了灰度滤镜)。
|
|
88
|
+
- 使用 `setOutputComposer(null)` 恢复默认渲染管线。
|
|
89
|
+
|
|
90
|
+
## 8. `test_viewer_utils.html`:Viewer 工具方法
|
|
91
|
+
|
|
92
|
+
该示例演示了 `Viewer` 新增的便捷方法:截图导出、背景切换、雾效控制和阴影开关。
|
|
93
|
+
|
|
94
|
+
### 核心要点:
|
|
95
|
+
|
|
96
|
+
- 使用 `viewer.screenshot()` 导出当前渲染画面为 PNG 文件。
|
|
97
|
+
- 使用 `viewer.setBackground(color)` 快速切换场景背景颜色。
|
|
98
|
+
- 使用 `viewer.enableFog()` / `viewer.disableFog()` 控制雾效。
|
|
99
|
+
- 使用 `viewer.enableShadow()` / `viewer.disableShadow()` 控制阴影渲染。
|
|
100
|
+
- 使用 `viewer.resize(width, height)` 手动触发尺寸更新。
|
|
101
|
+
|
|
102
|
+
## 9. `test_camera_controls.html`:CameraControls 增强方法
|
|
103
|
+
|
|
104
|
+
该示例演示了 `CameraControls` 的飞行定位、视角存取、锁定和二三维切换功能。
|
|
105
|
+
|
|
106
|
+
### 核心要点:
|
|
107
|
+
|
|
108
|
+
- 使用 `viewer.controls.flyTo(position, target)` 将相机飞行到指定坐标。
|
|
109
|
+
- 使用 `viewer.controls.getCameraViewpoint()` 获取当前视角数据。
|
|
110
|
+
- 使用 `viewer.controls.setCameraViewpoint(data)` 恢复保存的视角。
|
|
111
|
+
- 使用 `viewer.controls.lock()` / `unlock()` 锁定或解锁相机控制。
|
|
112
|
+
- 使用 `viewer.controls.setViewMode('2d')` / `setViewMode('3d')` 在二三维视图间切换。
|
|
113
|
+
|
|
114
|
+
## 10. `test_object_manager.html`:ObjectManager 增强方法
|
|
115
|
+
|
|
116
|
+
该示例演示了 `ObjectManager` 的显隐控制、孤立显示、透明度设置、包围盒查询和过滤功能。
|
|
117
|
+
|
|
118
|
+
### 核心要点:
|
|
119
|
+
|
|
120
|
+
- 使用 `viewer.objectManager.show(id)` / `hide(id)` 控制对象可见性。
|
|
121
|
+
- 使用 `viewer.objectManager.isolate(ids)` 孤立显示指定对象。
|
|
122
|
+
- 使用 `viewer.objectManager.setOpacity(id, value)` 设置材质透明度。
|
|
123
|
+
- 使用 `viewer.objectManager.getBoundingBox()` 查询所有对象的包围盒。
|
|
124
|
+
- 使用 `viewer.objectManager.filter(predicate)` 按条件过滤对象。
|
|
125
|
+
|
|
126
|
+
## 11. `test_material_effects.html`:MaterialEffects 增强效果
|
|
127
|
+
|
|
128
|
+
该示例演示了材质效果系统的线框、半透明、X 光和淡入淡出功能。
|
|
129
|
+
|
|
130
|
+
### 核心要点:
|
|
131
|
+
|
|
132
|
+
- 使用 `MaterialEffects.wireframe(object)` 开启线框渲染模式。
|
|
133
|
+
- 使用 `MaterialEffects.highlightColor(object, { opacity })` 设置半透明效果。
|
|
134
|
+
- 使用 `MaterialEffects.highlightColor(object, { color, opacity, overwrite: true, depthWrite: false })` 实现 X 光透视效果。
|
|
135
|
+
- 使用 `MaterialEffects.fadeOut(object)` / `fadeIn(object)` 执行淡入淡出动画。
|
|
136
|
+
- 使用 `MaterialEffects.removeHighlightColor(object)` 恢复原始材质状态。
|
|
137
|
+
|
|
138
|
+
## 12. `test_selection.html`:Selection 选择系统
|
|
139
|
+
|
|
140
|
+
该示例演示了对象选择系统的单选和框选功能。
|
|
141
|
+
|
|
142
|
+
### 核心要点:
|
|
143
|
+
|
|
144
|
+
- 创建 `Selection` 实例并监听 `select`、`deselect`、`change` 事件。
|
|
145
|
+
- 使用 `selection.select()` / `deselect()` / `toggle()` / `clear()` 进行程序化选择操作。
|
|
146
|
+
- 使用 `selection.enableBoxSelection()` 开启鼠标框选模式。
|
|
147
|
+
- 框选模式下可配合 `viewer.controls.lock()` 避免框选与相机旋转冲突。
|
|
148
|
+
|
|
149
|
+
## 13. `test_measure.html`:MeasureTool 测量工具
|
|
150
|
+
|
|
151
|
+
该示例演示了 3D 场景中的距离、面积和角度测量。
|
|
152
|
+
|
|
153
|
+
### 核心要点:
|
|
154
|
+
|
|
155
|
+
- 使用 `measureTool.measureDistance(pointA, pointB)` 测量两点距离。
|
|
156
|
+
- 使用 `measureTool.measureArea(points)` 测量多边形面积。
|
|
157
|
+
- 使用 `measureTool.measureAngle(pointA, vertex, pointC)` 测量夹角。
|
|
158
|
+
- 测量结果以可视化线条渲染到场景中,返回的 `MeasureResult` 包含数值和单位。
|
|
159
|
+
|
|
160
|
+
## 14. `test_annotation.html`:AnnotationManager 标注管理
|
|
161
|
+
|
|
162
|
+
该示例演示了 3D 标注的创建、更新和管理,配合 `CSSRenderer` 实现 HTML 浮动标签。
|
|
163
|
+
|
|
164
|
+
### 核心要点:
|
|
165
|
+
|
|
166
|
+
- 创建 `AnnotationManager` 实例并通过 `setCSSObjectFactory()` 绑定 `CSSRenderer`。
|
|
167
|
+
- 使用 `annotationManager.add(id, options)` 添加带引线和自定义样式的标注。
|
|
168
|
+
- 使用 `annotationManager.addText(text, position)` 快捷添加纯文本标注。
|
|
169
|
+
- 使用 `updateContent()` 动态更新标注内容,`updatePosition()` 移动标注位置。
|
|
170
|
+
- 使用 `hideAll()` / `showAll()` 批量控制标注显隐。
|
|
171
|
+
|
|
172
|
+
## 15. `test_clipping.html`:ClippingTool 剖切工具
|
|
173
|
+
|
|
174
|
+
该示例演示了剖切面的创建和实时调整。
|
|
175
|
+
|
|
176
|
+
### 核心要点:
|
|
177
|
+
|
|
178
|
+
- 创建 `ClippingTool` 实例并调用 `attach()` 将场景物体移入 ClippingGroup。
|
|
179
|
+
- 使用 `clippingTool.addPlane(id, options)` 添加剖切面。
|
|
180
|
+
- 使用滑块通过 `clippingTool.setPlaneConstant()` 实时调整剖切位置。
|
|
181
|
+
- 使用 `showHelper()` / `hideHelper()` 切换剖切面可视化辅助。
|
|
182
|
+
|
|
183
|
+
## 16. `test_lights.html`:LightManager 灯光管理
|
|
184
|
+
|
|
185
|
+
该示例演示了灯光管理器的灯光预设和 Helper 可视化功能。
|
|
186
|
+
|
|
187
|
+
### 核心要点:
|
|
188
|
+
|
|
189
|
+
- 创建 `LightManager` 实例并使用 `applyPreset()` 一键应用灯光预设。
|
|
190
|
+
- 支持 4 种预设:`indoor`(室内)、`outdoor`(室外)、`studio`(摄影棚)、`warehouse`(仓库)。
|
|
191
|
+
- 使用 `showAllHelpers()` / `hideAllHelpers()` 显示或隐藏灯光辅助可视化。
|
|
192
|
+
- 每种预设会自动清除旧灯光并创建新的灯光组合。
|
package/docs/getting-started.md
CHANGED
|
@@ -119,13 +119,25 @@ box.addEventListener('pointerleave', (e) => {
|
|
|
119
119
|
|
|
120
120
|
这样就完成了!你现在拥有一个基础的 `u-space` 应用。
|
|
121
121
|
|
|
122
|
+
## 版本信息
|
|
123
|
+
|
|
124
|
+
`u-space` 导出了 `version` 常量,同时在 `window.__USPACE__` 上挂载了版本信息,方便调试和版本检查。
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { version } from 'u-space';
|
|
128
|
+
console.log(version); // e.g. '0.0.5'
|
|
129
|
+
|
|
130
|
+
// 也可以通过全局变量访问
|
|
131
|
+
console.log(window.__USPACE__.version);
|
|
132
|
+
```
|
|
133
|
+
|
|
122
134
|
## 下一步
|
|
123
135
|
|
|
124
136
|
- 深入了解 [Viewer API](./api-viewer.md)
|
|
125
137
|
- 探索如何 [加载模型与使用对象](./api-objects.md)
|
|
126
138
|
- 理解 [交互系统](./api-interactions.md)
|
|
127
139
|
- 使用 [Managers API](./api-managers.md) 注册和检索对象
|
|
128
|
-
-
|
|
140
|
+
- 通过插件添加 [瓦片地图](./api-plugin-tiles.md)、[小地图](./api-plugin-minimap.md)、[键盘控制](./api-plugin-keyboard-controls.md) 等功能
|
|
129
141
|
- 使用 [Animations API](./api-animations.md) 为属性添加动画
|
|
130
142
|
- 使用 [Effects API](./api-effects.md) 应用视觉特效
|
|
131
143
|
- 浏览 [示例指南](./examples-guide.md)
|
package/docs/index.md
CHANGED
|
@@ -12,6 +12,10 @@ hero:
|
|
|
12
12
|
- theme: alt
|
|
13
13
|
text: API 文档
|
|
14
14
|
link: /api-viewer
|
|
15
|
+
- theme: alt
|
|
16
|
+
text: 在线示例
|
|
17
|
+
link: /examples/
|
|
18
|
+
target: _self
|
|
15
19
|
|
|
16
20
|
features:
|
|
17
21
|
- title: WebGPU 优先
|
|
@@ -29,11 +33,15 @@ features:
|
|
|
29
33
|
| 文档 | 说明 |
|
|
30
34
|
| :--- | :--- |
|
|
31
35
|
| [Viewer](./api-viewer) | 核心类:渲染器、场景、相机、控制器、事件 |
|
|
36
|
+
| [CameraControls](./api-camera-controls) | 相机控制:飞行、视角切换、视点过渡 |
|
|
37
|
+
| [CSSRenderer](./api-css-renderer) | CSS 渲染器:CSS2D / CSS2.5D / CSS3D 叠加 HTML 元素 |
|
|
38
|
+
| [RenderPipeline](./api-render-pipeline) | 后处理管线:Bloom、SSGI、TRAA、自定义后处理 |
|
|
32
39
|
| [Objects](./api-objects) | 3D 对象:模型加载、基础网格、Poi、Topology |
|
|
33
|
-
| [Interactions](./api-interactions) |
|
|
34
|
-
| [Managers](./api-managers) |
|
|
40
|
+
| [Interactions](./api-interactions) | 交互管理:射线检测、鼠标/触摸事件、框选 |
|
|
41
|
+
| [Managers](./api-managers) | 对象管理、场景管理、灯光管理 |
|
|
35
42
|
| [Animations](./api-animations) | 补间动画:`tweenAnimation`、`Tween`、缓动模式 |
|
|
36
|
-
| [Effects](./api-effects) |
|
|
43
|
+
| [Effects](./api-effects) | 视觉特效:高亮、呼吸、线框、淡入淡出、流动、流体(TSL) |
|
|
44
|
+
| [Tools](./api-tools) | 工具:测量(距离/面积/角度)、剖切(面/盒)、标注管理 |
|
|
37
45
|
|
|
38
46
|
### 插件
|
|
39
47
|
|
|
@@ -41,12 +49,12 @@ features:
|
|
|
41
49
|
|
|
42
50
|
| 插件 | 说明 |
|
|
43
51
|
| :--- | :--- |
|
|
44
|
-
| [keyboard-controls](./api-
|
|
45
|
-
| [minimap](./api-
|
|
46
|
-
| [tiles](./api-
|
|
47
|
-
| [u-manager](./api-
|
|
48
|
-
| [curve-movement](./api-
|
|
49
|
-
| [tracking-controls](./api-
|
|
50
|
-
| [atmosphere](./api-
|
|
51
|
-
| [object-controls](./api-
|
|
52
|
-
| [topology-drawer](./api-
|
|
52
|
+
| [keyboard-controls](./api-plugin-keyboard-controls) | WASD / 方向键控制相机移动与旋转 |
|
|
53
|
+
| [minimap](./api-plugin-minimap) | 2D 小地图叠加层 |
|
|
54
|
+
| [tiles](./api-plugin-tiles) | ArcGIS 3D 瓦片 / GIS 地球渲染 |
|
|
55
|
+
| [u-manager](./api-plugin-u-manager) | 场景加载、拓扑、动画、属性、视点管理 |
|
|
56
|
+
| [curve-movement](./api-plugin-curve-movement) | 沿样条曲线移动相机或对象 |
|
|
57
|
+
| [tracking-controls](./api-plugin-tracking-controls) | 相机跟随移动目标 |
|
|
58
|
+
| [atmosphere](./api-plugin-atmosphere) | 天空/大气渲染(开发中) |
|
|
59
|
+
| [object-controls](./api-plugin-object-controls) | 交互式移动、旋转、缩放 3D 对象 |
|
|
60
|
+
| [topology-drawer](./api-plugin-topology-drawer) | 在场景任意表面交互式绘制拓扑路径图 |
|