@yangyongtao/gaea 1.1.35 → 1.2.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/package.json +1 -1
- package/src/GaeaMethods.js +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yangyongtao/gaea",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
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.cjs",
|
package/src/GaeaMethods.js
CHANGED
|
@@ -2450,12 +2450,14 @@ export class GaeaApp {
|
|
|
2450
2450
|
* @param {Object} opts.Position - { x: 纬度, y: 经度, z: 高程 }
|
|
2451
2451
|
* @param {Array<number>} opts.rotate - [tilt, heading, bank] 旋转角度
|
|
2452
2452
|
* @param {Array<number>} opts.scale - [sx, sy, sz] 缩放
|
|
2453
|
-
* @param {Array<number>} [opts.
|
|
2453
|
+
* @param {Array<number>} [opts.colorShallow=[146,132,98]] - 浅水区颜色 [r, g, b](0-255)
|
|
2454
|
+
* @param {Array<number>} [opts.colorDeep=[92,84,64]] - 深水区颜色 [r, g, b](0-255)
|
|
2454
2455
|
* @param {number} [opts.flowSpeed=0.1] - 流速
|
|
2455
2456
|
*/
|
|
2456
2457
|
addWaterHandle = async ({
|
|
2457
2458
|
gltfUrl, Position, rotate, scale,
|
|
2458
|
-
|
|
2459
|
+
colorShallow = [146, 132, 98],
|
|
2460
|
+
colorDeep = [92, 84, 64],
|
|
2459
2461
|
flowSpeed = 0.1
|
|
2460
2462
|
}) => {
|
|
2461
2463
|
const waterMtl = Gaea.GaeaResourceLoader.Instance.LoadLoaclResource('res://assets/material/river.tres')
|
|
@@ -2479,7 +2481,7 @@ export class GaeaApp {
|
|
|
2479
2481
|
|
|
2480
2482
|
Gaea.World.Instance.SetMtlVector3(material, 'uv_scale', new Gaea.Vector3(-7, -7, 1))
|
|
2481
2483
|
Gaea.World.Instance.SetMtlFloat(material, 'flow_speed', flowSpeed)
|
|
2482
|
-
Gaea.World.Instance.SetMtlColor(material, 'color_shallow', new Gaea.Color(0 / 255,
|
|
2484
|
+
Gaea.World.Instance.SetMtlColor(material, 'color_shallow', new Gaea.Color(colorShallow[0] / 255, colorShallow[1] / 255, colorShallow[2] / 255, 1))
|
|
2483
2485
|
Gaea.World.Instance.SetMtlColor(material, 'color_deep', new Gaea.Color(colorDeep[0] / 255, colorDeep[1] / 255, colorDeep[2] / 255, 1))
|
|
2484
2486
|
Gaea.World.Instance.SetMtlFloat(material, 'transparency_clarity', 0)
|
|
2485
2487
|
Gaea.World.Instance.SetMtlFloat(material, "transparency_refraction", 0); // 折射度
|