@yangyongtao/gaea 1.0.3 → 1.1.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/README.md +158 -67
- package/package.json +28 -7
- package/public/Gaea.apple-touch-icon.png +0 -0
- package/public/Gaea.apple-touch-icon.png.import +35 -0
- package/public/Gaea.audio.worklet.js +211 -0
- package/public/Gaea.html +245 -0
- package/public/Gaea.icon.png +0 -0
- package/public/Gaea.icon.png.import +35 -0
- package/public/Gaea.js +782 -0
- package/public/Gaea.png +0 -0
- package/public/Gaea.png.import +35 -0
- package/public/Gaea.worker.js +1 -0
- package/public/GaeaApp.html +275 -0
- package/public/GaeaMethods.js +4342 -0
- package/public/GaeaModule.html +276 -0
- package/public/config.js +76 -0
- package/public/constants.js +185 -0
- package/public/favicon.ico +0 -0
- package/public/image/1.png +0 -0
- package/public/image/12-min-min.gif +0 -0
- package/public/image/3.png +0 -0
- package/public/image/labelImg//345/217/263/350/276/271.png +0 -0
- package/public/image/labelImg//345/267/246/350/276/271.png +0 -0
- package/public/image/labelImg//346/260/264/344/275/215.png +0 -0
- package/public/image/screenIcon//345/205/266/344/273/226.png +0 -0
- package/public/image/screenIcon//345/256/211/345/205/250/347/233/221/346/265/213/350/201/232/345/220/210-/347/272/242.png +0 -0
- package/public/image/screenIcon//345/256/211/345/205/250/347/233/221/346/265/213/350/201/232/345/220/210-/347/273/277.png +0 -0
- package/public/image/screenIcon//346/212/242/351/231/251/345/215/225/344/275/215.png +0 -0
- package/public/image/screenIcon//346/226/255/351/235/242.png +0 -0
- package/public/image/screenIcon//346/227/240/344/272/272/346/234/272.png +0 -0
- package/public/image/screenIcon//346/227/240/344/272/272/346/234/272/345/237/272/345/234/260.png +0 -0
- package/public/image/screenIcon//346/260/264/345/272/223/347/253/231.png +0 -0
- package/public/image/screenIcon//346/260/264/346/226/207/346/265/213/347/253/231.png +0 -0
- package/public/image/screenIcon//346/260/264/351/227/270.png +0 -0
- package/public/image/screenIcon//346/262/263/351/201/223/347/253/231-/346/227/240/346/225/260/346/215/256.png +0 -0
- package/public/image/screenIcon//346/262/263/351/201/223/347/253/231-/346/255/243/345/270/270.png +0 -0
- package/public/image/screenIcon//346/262/263/351/201/223/347/253/231-/350/266/205/344/277/235.png +0 -0
- package/public/image/screenIcon//346/262/263/351/201/223/347/253/231-/350/266/205/350/255/246.png +0 -0
- package/public/image/screenIcon//346/263/265/347/253/231-/347/201/260.png +0 -0
- package/public/image/screenIcon//346/263/265/347/253/231-/347/273/277.png +0 -0
- package/public/image/screenIcon//346/265/201/351/207/217/346/265/213/347/253/231.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-1/347/272/247.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-2/347/272/247.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-3/347/272/247.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-4/347/272/247.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-5/347/272/247.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-/346/251/231.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-/347/272/242.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-/347/273/277.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-/350/247/204/346/250/241/344/273/245/344/270/213.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230-/351/273/204.png +0 -0
- package/public/image/screenIcon//346/265/267/345/241/230.png +0 -0
- package/public/image/screenIcon//346/275/256/344/275/215.png +0 -0
- package/public/image/screenIcon//346/275/256/344/275/215/347/253/231-/346/227/240/346/225/260/346/215/256.png +0 -0
- package/public/image/screenIcon//346/275/256/344/275/215/347/253/231-/346/255/243/345/270/270.png +0 -0
- package/public/image/screenIcon//346/275/256/344/275/215/347/253/231-/350/266/205/344/277/235.png +0 -0
- package/public/image/screenIcon//346/275/256/344/275/215/347/253/231-/350/266/205/350/255/246.png +0 -0
- package/public/image/screenIcon//347/211/251/350/265/204/344/273/223/345/272/223.png +0 -0
- package/public/image/screenIcon//347/220/203/346/234/272-/345/205/263.png +0 -0
- package/public/image/screenIcon//347/220/203/346/234/272-/345/274/200.png +0 -0
- package/public/image/screenIcon//347/220/203/346/234/272-/347/272/242.png +0 -0
- package/public/image/screenIcon//350/247/206/351/242/221/347/233/221/346/216/247.png +0 -0
- package/public/image/screenIcon//351/227/270/351/227/250-/347/201/260.png +0 -0
- package/public/image/screenIcon//351/227/270/351/227/250-/347/273/277.png +0 -0
- package/public/image/screenIcon//351/230/262/346/264/252/344/273/223/345/272/223.png +0 -0
- package/public/image/screenIcon//351/232/220/346/202/243.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/346/265/205/350/223/235.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/347/201/260.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/347/262/211.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/347/272/242.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/347/273/277.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/350/223/235.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/351/273/204.png +0 -0
- package/public/image/screenIcon//351/233/250/351/207/217/347/253/231-/351/273/221.png +0 -0
- package/public/image/screenIcon//351/243/216/351/200/237.png +0 -0
- package/public/image/screenIcon//351/243/216/351/200/237/346/265/213/347/253/231.png +0 -0
- package/public/image//346/260/264/346/226/207.gif +0 -0
- package/public/image//350/211/262/345/270/246.png +0 -0
- package/public/index.html +22 -0
- package/public/index.js +185662 -0
- package/public/jsWebControl-1.0.0.min.js +31 -0
- package/public/jsencrypt.min.js +1 -0
- package/public/math/Box2.js +203 -0
- package/public/math/Box3.js +532 -0
- package/public/math/Color.js +605 -0
- package/public/math/ColorManagement.js +74 -0
- package/public/math/Cylindrical.js +61 -0
- package/public/math/EngineUtils.js +81 -0
- package/public/math/Euler.js +315 -0
- package/public/math/Frustum.js +162 -0
- package/public/math/Interpolant.js +241 -0
- package/public/math/Line3.js +115 -0
- package/public/math/MathUtils.js +345 -0
- package/public/math/Matrix3.js +365 -0
- package/public/math/Matrix4.js +858 -0
- package/public/math/Plane.js +205 -0
- package/public/math/Quaternion.js +724 -0
- package/public/math/Ray.js +493 -0
- package/public/math/Sphere.js +243 -0
- package/public/math/Spherical.js +86 -0
- package/public/math/SphericalHarmonics3.js +243 -0
- package/public/math/Triangle.js +299 -0
- package/public/math/Vector2.js +464 -0
- package/public/math/Vector3.js +715 -0
- package/public/math/Vector4.js +644 -0
- package/public/math/interpolants/CubicInterpolant.js +151 -0
- package/public/math/interpolants/DiscreteInterpolant.js +26 -0
- package/public/math/interpolants/LinearInterpolant.js +38 -0
- package/public/math/interpolants/QuaternionLinearInterpolant.js +39 -0
- package/public/static/Cloud.png +0 -0
- package/public/static/Global2.jpg +0 -0
- package/public/static/css/main.css +170 -0
- package/public/static/geojson//346/265/267/345/241/230.geojson +99 -0
- package/public/static/img/loading.gif +0 -0
- package/public/static/js/app.js +359 -0
- package/public/static/js/appcontroller.js +207 -0
- package/public/static/js/dist/game.dev.js +137 -0
- package/public/static/js/env.js +74 -0
- package/public/static/js/event/event.js +107 -0
- package/public/static/js/init.js +8 -0
- package/public/static/js/initcloudmorph.js +1 -0
- package/public/static/js/log.js +35 -0
- package/public/static/js/network/ajax.js +29 -0
- package/public/static/js/network/rtcp.js +172 -0
- package/public/static/js/network/socket.js +106 -0
- package/public/web-control.min.js +2 -0
- package/scripts/postinstall.mjs +127 -0
- package/src/GaeaMethods.js +68 -405
- package/src/components/FlyAlongRoute.vue +1 -0
- package/src/components/WeatherControl.vue +2 -0
- package/src/directives/vDrag.js +70 -0
- package/src/index.js +1 -8
- package/src/plugin.js +16 -0
- package/src/utils.js +10 -21
- package/src/vite-plugin.js +117 -0
- package/public/static/1111.res +0 -0
- package/src/config.js +0 -40
package/README.md
CHANGED
|
@@ -1,114 +1,205 @@
|
|
|
1
|
-
# gaea
|
|
1
|
+
# @yangyongtao/gaea
|
|
2
2
|
|
|
3
|
-
Gaea 3D
|
|
4
|
-
|
|
5
|
-
## 前置条件
|
|
6
|
-
|
|
7
|
-
使用前需在 HTML 中加载 Gaea 运行库:
|
|
8
|
-
|
|
9
|
-
```html
|
|
10
|
-
<script src="path/to/Gaea.js"></script>
|
|
11
|
-
```
|
|
3
|
+
Gaea 3D 可视化组件库 — 基于 Godot WASM 引擎的 Vue 3 组件包。
|
|
12
4
|
|
|
13
5
|
## 安装
|
|
14
6
|
|
|
15
7
|
```bash
|
|
16
|
-
npm install @
|
|
8
|
+
npm install @yangyongtao/gaea
|
|
17
9
|
```
|
|
18
10
|
|
|
19
|
-
##
|
|
11
|
+
## 项目配置
|
|
20
12
|
|
|
21
|
-
|
|
22
|
-
import { GaeaApp, setConfig } from '@your-scope/gaea-3dview';
|
|
13
|
+
### 1. `vite.config.js`
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
```js
|
|
16
|
+
import { defineConfig } from 'vite';
|
|
17
|
+
import vue from '@vitejs/plugin-vue';
|
|
18
|
+
import { gaeaVitePlugin } from '@yangyongtao/gaea/plugin';
|
|
19
|
+
|
|
20
|
+
export default defineConfig({
|
|
21
|
+
plugins: [vue(), gaeaVitePlugin()],
|
|
22
|
+
resolve: {
|
|
23
|
+
preserveSymlinks: true,
|
|
24
|
+
},
|
|
25
|
+
optimizeDeps: {
|
|
26
|
+
exclude: ['@yangyongtao/gaea'],
|
|
27
|
+
},
|
|
28
28
|
});
|
|
29
|
+
```
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
| 配置 | 说明 |
|
|
32
|
+
|------|------|
|
|
33
|
+
| `gaeaVitePlugin()` | 自动注入 `<script src="/Gaea.js">`、提供 public/ 静态文件、设置 COEP/COOP 头 |
|
|
34
|
+
| `preserveSymlinks: true` | npm link 本地调试时必需 |
|
|
35
|
+
| `exclude` | 跳过 Vite 预构建,避免 `import('../public/index.js')` 在 Node 端解析失败 |
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
app.initDefaultEnvironment();
|
|
37
|
+
### 2. `index.html`
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
await app.drawPointIcon({ lat: 27.3809, lng: 120.4499 });
|
|
39
|
+
无需手动添加任何 script — 插件会自动注入:
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
```html
|
|
42
|
+
<!DOCTYPE html>
|
|
43
|
+
<html><head><meta charset="UTF-8" /></head>
|
|
44
|
+
<body>
|
|
45
|
+
<div id="app"></div>
|
|
46
|
+
<script type="module" src="/src/main.js"></script>
|
|
47
|
+
</body></html>
|
|
44
48
|
```
|
|
45
49
|
|
|
46
|
-
|
|
50
|
+
### 3. `src/main.js`(Vue 入口)
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
```js
|
|
53
|
+
import { createApp } from 'vue';
|
|
54
|
+
import App from './App.vue';
|
|
55
|
+
createApp(App).mount('#app');
|
|
56
|
+
```
|
|
49
57
|
|
|
50
|
-
|
|
51
|
-
初始化前设置全局配置,必传 `serveLocal`。
|
|
58
|
+
### 4. `src/App.vue`(完整初始化示例)
|
|
52
59
|
|
|
53
|
-
|
|
54
|
-
|
|
60
|
+
```vue
|
|
61
|
+
<template>
|
|
62
|
+
<canvas id="canvas" style="width:100vw;height:100vh"></canvas>
|
|
63
|
+
</template>
|
|
55
64
|
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
<script setup>
|
|
66
|
+
import { onMounted } from 'vue';
|
|
67
|
+
import { GaeaApp, setConfig } from '@yangyongtao/gaea';
|
|
68
|
+
|
|
69
|
+
const app = new GaeaApp();
|
|
70
|
+
window.APP = app; // 控制台调试
|
|
71
|
+
|
|
72
|
+
onMounted(async () => {
|
|
73
|
+
// ① 配置
|
|
74
|
+
setConfig({
|
|
75
|
+
serveLocal: `${window.location.origin}/static/`,
|
|
76
|
+
serveUrl: 'http://192.168.3.151:8088/gaeaExplorerServer/',
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// ② 启动 Godot WASM 引擎
|
|
80
|
+
new window.Engine({
|
|
81
|
+
args: [],
|
|
82
|
+
canvasResizePolicy: 2,
|
|
83
|
+
executable: '/Gaea',
|
|
84
|
+
experimentalVK: false,
|
|
85
|
+
fileSizes: {
|
|
86
|
+
'Gaea.pck': 450751936,
|
|
87
|
+
'Gaea.wasm': 16580215,
|
|
88
|
+
},
|
|
89
|
+
focusCanvas: true,
|
|
90
|
+
gdnativeLibs: [],
|
|
91
|
+
}).startGame({
|
|
92
|
+
onProgress: (current, total) => console.log(`加载: ${current}/${total}`),
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
// ③ 初始化环境(雾、光照、AssetHost 等)
|
|
96
|
+
await app.initDefaultEnvironment();
|
|
97
|
+
|
|
98
|
+
// ④ 加载 WMTS 影像图层
|
|
99
|
+
app.getAllServe().then(() => {
|
|
100
|
+
app.addLayer({ layerName: 'earthland', forMat: 'image/png', min: 0, max: 18, transparency: 0.3 });
|
|
101
|
+
app.addLayer({ layerName: '苍南L19', forMat: 'image/png', min: 5, max: 17 });
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
</script>
|
|
58
105
|
```
|
|
59
106
|
|
|
60
|
-
|
|
61
|
-
|
|
107
|
+
> **注意**:`fileSizes` 中的数值需与实际 `public/Gaea.pck` 和 `public/Gaea.wasm` 文件大小一致。
|
|
108
|
+
|
|
109
|
+
## API
|
|
110
|
+
|
|
111
|
+
### 配置
|
|
112
|
+
|
|
113
|
+
| 方法 | 说明 |
|
|
114
|
+
|------|------|
|
|
115
|
+
| `setConfig({ serveUrl, serveLocal })` | 全局配置,必须在 `new GaeaApp()` 前调用 |
|
|
116
|
+
| `getConfig()` | 读取当前配置 |
|
|
62
117
|
|
|
63
|
-
|
|
64
|
-
|
|
118
|
+
### 环境初始化
|
|
119
|
+
|
|
120
|
+
| 方法 | 说明 |
|
|
121
|
+
|------|------|
|
|
122
|
+
| `await app.initDefaultEnvironment()` | 关闭雾、设置 AssetHost、环境光、日照 |
|
|
123
|
+
|
|
124
|
+
### 影像图层
|
|
125
|
+
|
|
126
|
+
| 方法 | 说明 |
|
|
127
|
+
|------|------|
|
|
128
|
+
| `await app.getAllServe()` | 获取 WMTS 服务图层列表,存到 `app.layers` |
|
|
129
|
+
| `app.addLayer({ layerName, max, min, transparency, forMat, inserIndex })` | 添加单张影像图层到 3D 地球 |
|
|
65
130
|
|
|
66
131
|
```js
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
132
|
+
app.addLayer({
|
|
133
|
+
layerName: 'earthland', // 图层名称(与 WMTS Capabilities 中的 Title 一致)
|
|
134
|
+
forMat: 'image/png', // 图像格式
|
|
135
|
+
min: 0, max: 18, // 显示层级范围
|
|
136
|
+
transparency: 0.3, // 透明度 0~1
|
|
137
|
+
});
|
|
71
138
|
```
|
|
72
139
|
|
|
73
|
-
|
|
74
|
-
停止飞行。
|
|
140
|
+
### 相机控制
|
|
75
141
|
|
|
76
|
-
|
|
77
|
-
|
|
142
|
+
| 方法 | 说明 |
|
|
143
|
+
|------|------|
|
|
144
|
+
| `app.SetPosition("lat,lng,alt,dist,pitch,heading")` | 定位到指定视角 |
|
|
145
|
+
| `app.favorite()` | 记录当前视角,返回 URI 字符串 |
|
|
146
|
+
| `app.favoritePosition(uri)` | 定位到已保存的视角 URI |
|
|
78
147
|
|
|
79
148
|
```js
|
|
80
|
-
|
|
81
|
-
app.
|
|
82
|
-
```
|
|
149
|
+
// 定位到 27.38°N, 120.45°E, 高度 0, 距离 3000, 俯仰 0, 朝向 0
|
|
150
|
+
app.SetPosition('27.3809, 120.4499, 0, 3000, 0, 0');
|
|
83
151
|
|
|
84
|
-
|
|
85
|
-
|
|
152
|
+
// 保存视角
|
|
153
|
+
const uri = app.favorite();
|
|
86
154
|
|
|
87
|
-
|
|
88
|
-
|
|
155
|
+
// 恢复视角
|
|
156
|
+
app.favoritePosition(uri);
|
|
157
|
+
```
|
|
89
158
|
|
|
90
|
-
|
|
159
|
+
### Vue 组件
|
|
91
160
|
|
|
92
161
|
```vue
|
|
93
162
|
<script setup>
|
|
94
|
-
import {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
const app = new GaeaApp();
|
|
163
|
+
import { WeatherControl, FlyAlongRoute } from '@yangyongtao/gaea/components';
|
|
164
|
+
const app = window.APP;
|
|
98
165
|
</script>
|
|
99
166
|
|
|
100
167
|
<template>
|
|
101
|
-
<WeatherControl :appInstance="app" @close="
|
|
102
|
-
<FlyAlongRoute :appInstance="app" @close="
|
|
168
|
+
<WeatherControl :appInstance="app" @close="show = false" />
|
|
169
|
+
<FlyAlongRoute :appInstance="app" @close="show = false" />
|
|
103
170
|
</template>
|
|
104
171
|
```
|
|
105
172
|
|
|
173
|
+
### 其他导出
|
|
174
|
+
|
|
175
|
+
| 导出 | 路径 |
|
|
176
|
+
|------|------|
|
|
177
|
+
| `GaeaPlugin` (v-drag 指令) | `@yangyongtao/gaea/plugin` |
|
|
178
|
+
| `gaeaVitePlugin` | `@yangyongtao/gaea/plugin` |
|
|
179
|
+
| `loadResource`, `screenToLatLng` | `@yangyongtao/gaea` |
|
|
180
|
+
|
|
106
181
|
## 静态资源
|
|
107
182
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
183
|
+
npm 包 `public/` 目录包含以下文件,由 `gaeaVitePlugin` 自动提供:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
public/
|
|
187
|
+
├── Gaea.js # Godot HTML5 引擎
|
|
188
|
+
├── Gaea.wasm # WebAssembly 模块
|
|
189
|
+
├── Gaea.pck # 引擎资源包
|
|
190
|
+
├── Gaea.worker.js # Worker 线程
|
|
191
|
+
├── Gaea.audio.worklet.js
|
|
192
|
+
├── index.js # Godot 类绑定(≈185K 行)
|
|
193
|
+
├── config.js / constants.js
|
|
194
|
+
├── math/ # 数学工具
|
|
195
|
+
├── static/
|
|
196
|
+
│ ├── 1111.res # 点标注资源
|
|
197
|
+
│ ├── Global2.jpg # 全球底图
|
|
198
|
+
│ ├── Cloud.png / SkyDay.png
|
|
199
|
+
│ ├── gltf/ # 3D 模型
|
|
200
|
+
│ └── js/ # 业务脚本
|
|
201
|
+
└── image/ # 图标资源
|
|
202
|
+
```
|
|
112
203
|
|
|
113
204
|
## License
|
|
114
205
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yangyongtao/gaea",
|
|
3
|
-
"version": "1.0
|
|
4
|
-
"description": "Gaea 3D
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Gaea 3D visualization component library - Vue 3 components based on Godot WASM engine. Includes WMTS layer loading, camera view control, Vite plugin auto-injection, etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -17,23 +17,44 @@
|
|
|
17
17
|
"./methods": {
|
|
18
18
|
"import": "./src/GaeaMethods.js",
|
|
19
19
|
"default": "./src/GaeaMethods.js"
|
|
20
|
+
},
|
|
21
|
+
"./plugin": {
|
|
22
|
+
"import": "./src/plugin.js",
|
|
23
|
+
"default": "./src/plugin.js"
|
|
20
24
|
}
|
|
21
25
|
},
|
|
22
26
|
"files": [
|
|
23
27
|
"src/",
|
|
24
|
-
"
|
|
25
|
-
"README.md"
|
|
28
|
+
"scripts/",
|
|
29
|
+
"README.md",
|
|
30
|
+
"public/*.js",
|
|
31
|
+
"public/*.html",
|
|
32
|
+
"public/*.png",
|
|
33
|
+
"public/*.ico",
|
|
34
|
+
"public/*.import",
|
|
35
|
+
"public/config.js",
|
|
36
|
+
"public/constants.js",
|
|
37
|
+
"public/math/",
|
|
38
|
+
"public/image/",
|
|
39
|
+
"public/static/css/",
|
|
40
|
+
"public/static/geojson/",
|
|
41
|
+
"public/static/img/",
|
|
42
|
+
"public/static/js/",
|
|
43
|
+
"public/static/*.png",
|
|
44
|
+
"public/static/*.jpg"
|
|
26
45
|
],
|
|
27
46
|
"scripts": {
|
|
47
|
+
"postinstall": "node scripts/postinstall.mjs",
|
|
28
48
|
"test": "echo \"No tests yet\""
|
|
29
49
|
},
|
|
30
50
|
"keywords": [
|
|
31
51
|
"gaea",
|
|
32
52
|
"3d",
|
|
33
53
|
"viewer",
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
54
|
+
"godot",
|
|
55
|
+
"wasm",
|
|
56
|
+
"gis",
|
|
57
|
+
"wmts",
|
|
37
58
|
"vue",
|
|
38
59
|
"component"
|
|
39
60
|
],
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[remap]
|
|
2
|
+
|
|
3
|
+
importer="texture"
|
|
4
|
+
type="StreamTexture"
|
|
5
|
+
path="res://.import/Gaea.apple-touch-icon.png-3d2e13d9913bdd8e3563afb6c9370785.stex"
|
|
6
|
+
metadata={
|
|
7
|
+
"vram_texture": false
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
[deps]
|
|
11
|
+
|
|
12
|
+
source_file="res://exports/html5/release/Gaea.apple-touch-icon.png"
|
|
13
|
+
dest_files=[ "res://.import/Gaea.apple-touch-icon.png-3d2e13d9913bdd8e3563afb6c9370785.stex" ]
|
|
14
|
+
|
|
15
|
+
[params]
|
|
16
|
+
|
|
17
|
+
compress/mode=0
|
|
18
|
+
compress/lossy_quality=0.7
|
|
19
|
+
compress/hdr_mode=0
|
|
20
|
+
compress/bptc_ldr=0
|
|
21
|
+
compress/normal_map=0
|
|
22
|
+
flags/repeat=0
|
|
23
|
+
flags/filter=true
|
|
24
|
+
flags/mipmaps=false
|
|
25
|
+
flags/anisotropic=false
|
|
26
|
+
flags/srgb=2
|
|
27
|
+
process/fix_alpha_border=true
|
|
28
|
+
process/premult_alpha=false
|
|
29
|
+
process/HDR_as_SRGB=false
|
|
30
|
+
process/invert_color=false
|
|
31
|
+
process/normal_map_invert_y=false
|
|
32
|
+
stream=false
|
|
33
|
+
size_limit=0
|
|
34
|
+
detect_3d=true
|
|
35
|
+
svg/scale=1.0
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/*************************************************************************/
|
|
2
|
+
/* audio.worklet.js */
|
|
3
|
+
/*************************************************************************/
|
|
4
|
+
/* This file is part of: */
|
|
5
|
+
/* GODOT ENGINE */
|
|
6
|
+
/* https://godotengine.org */
|
|
7
|
+
/*************************************************************************/
|
|
8
|
+
/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */
|
|
9
|
+
/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */
|
|
10
|
+
/* */
|
|
11
|
+
/* Permission is hereby granted, free of charge, to any person obtaining */
|
|
12
|
+
/* a copy of this software and associated documentation files (the */
|
|
13
|
+
/* "Software"), to deal in the Software without restriction, including */
|
|
14
|
+
/* without limitation the rights to use, copy, modify, merge, publish, */
|
|
15
|
+
/* distribute, sublicense, and/or sell copies of the Software, and to */
|
|
16
|
+
/* permit persons to whom the Software is furnished to do so, subject to */
|
|
17
|
+
/* the following conditions: */
|
|
18
|
+
/* */
|
|
19
|
+
/* The above copyright notice and this permission notice shall be */
|
|
20
|
+
/* included in all copies or substantial portions of the Software. */
|
|
21
|
+
/* */
|
|
22
|
+
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
|
|
23
|
+
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
|
|
24
|
+
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
|
|
25
|
+
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
|
|
26
|
+
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
|
|
27
|
+
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
|
|
28
|
+
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
|
29
|
+
/*************************************************************************/
|
|
30
|
+
|
|
31
|
+
class RingBuffer {
|
|
32
|
+
constructor(p_buffer, p_state, p_threads) {
|
|
33
|
+
this.buffer = p_buffer;
|
|
34
|
+
this.avail = p_state;
|
|
35
|
+
this.threads = p_threads;
|
|
36
|
+
this.rpos = 0;
|
|
37
|
+
this.wpos = 0;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
data_left() {
|
|
41
|
+
return this.threads ? Atomics.load(this.avail, 0) : this.avail;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
space_left() {
|
|
45
|
+
return this.buffer.length - this.data_left();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
read(output) {
|
|
49
|
+
const size = this.buffer.length;
|
|
50
|
+
let from = 0;
|
|
51
|
+
let to_write = output.length;
|
|
52
|
+
if (this.rpos + to_write > size) {
|
|
53
|
+
const high = size - this.rpos;
|
|
54
|
+
output.set(this.buffer.subarray(this.rpos, size));
|
|
55
|
+
from = high;
|
|
56
|
+
to_write -= high;
|
|
57
|
+
this.rpos = 0;
|
|
58
|
+
}
|
|
59
|
+
if (to_write) {
|
|
60
|
+
output.set(this.buffer.subarray(this.rpos, this.rpos + to_write), from);
|
|
61
|
+
}
|
|
62
|
+
this.rpos += to_write;
|
|
63
|
+
if (this.threads) {
|
|
64
|
+
Atomics.add(this.avail, 0, -output.length);
|
|
65
|
+
Atomics.notify(this.avail, 0);
|
|
66
|
+
} else {
|
|
67
|
+
this.avail -= output.length;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
write(p_buffer) {
|
|
72
|
+
const to_write = p_buffer.length;
|
|
73
|
+
const mw = this.buffer.length - this.wpos;
|
|
74
|
+
if (mw >= to_write) {
|
|
75
|
+
this.buffer.set(p_buffer, this.wpos);
|
|
76
|
+
this.wpos += to_write;
|
|
77
|
+
if (mw === to_write) {
|
|
78
|
+
this.wpos = 0;
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
const high = p_buffer.subarray(0, mw);
|
|
82
|
+
const low = p_buffer.subarray(mw);
|
|
83
|
+
this.buffer.set(high, this.wpos);
|
|
84
|
+
this.buffer.set(low);
|
|
85
|
+
this.wpos = low.length;
|
|
86
|
+
}
|
|
87
|
+
if (this.threads) {
|
|
88
|
+
Atomics.add(this.avail, 0, to_write);
|
|
89
|
+
Atomics.notify(this.avail, 0);
|
|
90
|
+
} else {
|
|
91
|
+
this.avail += to_write;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
class GodotProcessor extends AudioWorkletProcessor {
|
|
97
|
+
constructor() {
|
|
98
|
+
super();
|
|
99
|
+
this.threads = false;
|
|
100
|
+
this.running = true;
|
|
101
|
+
this.lock = null;
|
|
102
|
+
this.notifier = null;
|
|
103
|
+
this.output = null;
|
|
104
|
+
this.output_buffer = new Float32Array();
|
|
105
|
+
this.input = null;
|
|
106
|
+
this.input_buffer = new Float32Array();
|
|
107
|
+
this.port.onmessage = (event) => {
|
|
108
|
+
const cmd = event.data['cmd'];
|
|
109
|
+
const data = event.data['data'];
|
|
110
|
+
this.parse_message(cmd, data);
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
process_notify() {
|
|
115
|
+
if (this.notifier) {
|
|
116
|
+
Atomics.add(this.notifier, 0, 1);
|
|
117
|
+
Atomics.notify(this.notifier, 0);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
parse_message(p_cmd, p_data) {
|
|
122
|
+
if (p_cmd === 'start' && p_data) {
|
|
123
|
+
const state = p_data[0];
|
|
124
|
+
let idx = 0;
|
|
125
|
+
this.threads = true;
|
|
126
|
+
this.lock = state.subarray(idx, ++idx);
|
|
127
|
+
this.notifier = state.subarray(idx, ++idx);
|
|
128
|
+
const avail_in = state.subarray(idx, ++idx);
|
|
129
|
+
const avail_out = state.subarray(idx, ++idx);
|
|
130
|
+
this.input = new RingBuffer(p_data[1], avail_in, true);
|
|
131
|
+
this.output = new RingBuffer(p_data[2], avail_out, true);
|
|
132
|
+
} else if (p_cmd === 'stop') {
|
|
133
|
+
this.running = false;
|
|
134
|
+
this.output = null;
|
|
135
|
+
this.input = null;
|
|
136
|
+
} else if (p_cmd === 'start_nothreads') {
|
|
137
|
+
this.output = new RingBuffer(p_data[0], p_data[0].length, false);
|
|
138
|
+
} else if (p_cmd === 'chunk') {
|
|
139
|
+
this.output.write(p_data);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
static array_has_data(arr) {
|
|
144
|
+
return arr.length && arr[0].length && arr[0][0].length;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
process(inputs, outputs, parameters) {
|
|
148
|
+
if (!this.running) {
|
|
149
|
+
return false; // Stop processing.
|
|
150
|
+
}
|
|
151
|
+
if (this.output === null) {
|
|
152
|
+
return true; // Not ready yet, keep processing.
|
|
153
|
+
}
|
|
154
|
+
const process_input = GodotProcessor.array_has_data(inputs);
|
|
155
|
+
if (process_input) {
|
|
156
|
+
const input = inputs[0];
|
|
157
|
+
const chunk = input[0].length * input.length;
|
|
158
|
+
if (this.input_buffer.length !== chunk) {
|
|
159
|
+
this.input_buffer = new Float32Array(chunk);
|
|
160
|
+
}
|
|
161
|
+
if (!this.threads) {
|
|
162
|
+
GodotProcessor.write_input(this.input_buffer, input);
|
|
163
|
+
this.port.postMessage({ 'cmd': 'input', 'data': this.input_buffer });
|
|
164
|
+
} else if (this.input.space_left() >= chunk) {
|
|
165
|
+
GodotProcessor.write_input(this.input_buffer, input);
|
|
166
|
+
this.input.write(this.input_buffer);
|
|
167
|
+
} else {
|
|
168
|
+
this.port.postMessage('Input buffer is full! Skipping input frame.');
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
const process_output = GodotProcessor.array_has_data(outputs);
|
|
172
|
+
if (process_output) {
|
|
173
|
+
const output = outputs[0];
|
|
174
|
+
const chunk = output[0].length * output.length;
|
|
175
|
+
if (this.output_buffer.length !== chunk) {
|
|
176
|
+
this.output_buffer = new Float32Array(chunk);
|
|
177
|
+
}
|
|
178
|
+
if (this.output.data_left() >= chunk) {
|
|
179
|
+
this.output.read(this.output_buffer);
|
|
180
|
+
GodotProcessor.write_output(output, this.output_buffer);
|
|
181
|
+
if (!this.threads) {
|
|
182
|
+
this.port.postMessage({ 'cmd': 'read', 'data': chunk });
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
this.port.postMessage('Output buffer has not enough frames! Skipping output frame.');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
this.process_notify();
|
|
189
|
+
return true;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
static write_output(dest, source) {
|
|
193
|
+
const channels = dest.length;
|
|
194
|
+
for (let ch = 0; ch < channels; ch++) {
|
|
195
|
+
for (let sample = 0; sample < dest[ch].length; sample++) {
|
|
196
|
+
dest[ch][sample] = source[sample * channels + ch];
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
static write_input(dest, source) {
|
|
202
|
+
const channels = source.length;
|
|
203
|
+
for (let ch = 0; ch < channels; ch++) {
|
|
204
|
+
for (let sample = 0; sample < source[ch].length; sample++) {
|
|
205
|
+
dest[sample * channels + ch] = source[ch][sample];
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
registerProcessor('godot-processor', GodotProcessor);
|