easy-three-utils 0.0.352 → 0.0.353
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.
|
Binary file
|
package/cesium/index.ts
CHANGED
|
@@ -17,6 +17,7 @@ type TCesiumUtilsType = {
|
|
|
17
17
|
profileAnalysis: ReturnType<typeof hooks.useProfileAnalysis>;
|
|
18
18
|
viewshedAnalysis: ReturnType<typeof hooks.useViewshedAnalysis>;
|
|
19
19
|
cloud: ReturnType<typeof hooks.useCloud>;
|
|
20
|
+
seawater: ReturnType<typeof hooks.useSeawater>;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
let config;
|
|
@@ -108,6 +109,7 @@ const useCesium = () => {
|
|
|
108
109
|
collection: customCollection.addCollection(hooks.dict.ECollectionWhiteListNames.VIEWSHEDANALYSIS)
|
|
109
110
|
})
|
|
110
111
|
const cloud = hooks.useCloud(viewer)
|
|
112
|
+
const seawater = hooks.useSeawater(viewer)
|
|
111
113
|
|
|
112
114
|
if (config.controllerStyle === cesiumConfigDict.EControllerStyle.THREE) {
|
|
113
115
|
updateController(viewer)
|
|
@@ -123,7 +125,8 @@ const useCesium = () => {
|
|
|
123
125
|
slope,
|
|
124
126
|
profileAnalysis,
|
|
125
127
|
viewshedAnalysis,
|
|
126
|
-
cloud
|
|
128
|
+
cloud,
|
|
129
|
+
seawater
|
|
127
130
|
})
|
|
128
131
|
|
|
129
132
|
handler = new Cesium.ScreenSpaceEventHandler(viewer.scene.canvas)
|
package/cesium/utils/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { useSlope } from './useSlope'
|
|
|
7
7
|
import { useProfileAnalysis } from './useProfileAnalysis'
|
|
8
8
|
import { useViewshedAnalysis } from './useViewshedAnalysis'
|
|
9
9
|
import { useCloud } from './useCloud'
|
|
10
|
+
import { useSeawater } from './useSeawater'
|
|
10
11
|
|
|
11
12
|
const dict = {
|
|
12
13
|
ECollectionWhiteListNames,
|
|
@@ -23,6 +24,7 @@ export {
|
|
|
23
24
|
useProfileAnalysis,
|
|
24
25
|
useViewshedAnalysis,
|
|
25
26
|
useCloud,
|
|
27
|
+
useSeawater,
|
|
26
28
|
|
|
27
29
|
dict
|
|
28
30
|
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as Cesium from 'cesium'
|
|
2
|
+
|
|
3
|
+
const useSeawater = (viewer: Cesium.Viewer) => {
|
|
4
|
+
let water;
|
|
5
|
+
|
|
6
|
+
const enabled = () => {
|
|
7
|
+
if (water) return
|
|
8
|
+
water = viewer.scene.primitives.add(
|
|
9
|
+
new Cesium.Primitive({
|
|
10
|
+
geometryInstances: new Cesium.GeometryInstance({
|
|
11
|
+
geometry: new Cesium.RectangleGeometry({
|
|
12
|
+
rectangle: Cesium.Rectangle.fromDegrees(-180.0, -90.0, 180.0, 90.0),
|
|
13
|
+
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
14
|
+
height: 450
|
|
15
|
+
})
|
|
16
|
+
}),
|
|
17
|
+
appearance: new Cesium.EllipsoidSurfaceAppearance({
|
|
18
|
+
aboveGround: false,
|
|
19
|
+
material: new Cesium.Material({
|
|
20
|
+
fabric: {
|
|
21
|
+
type: 'Water',
|
|
22
|
+
uniforms: {
|
|
23
|
+
specularMap: __POLT__URL__ + '/assets/image/earthspec.jpg',
|
|
24
|
+
normalMap: Cesium.buildModuleUrl('Assets/Textures/waterNormals.jpg'),
|
|
25
|
+
frequency: 10000.0,
|
|
26
|
+
animationSpeed: 0.01,
|
|
27
|
+
amplitude: 1.0,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}),
|
|
31
|
+
}),
|
|
32
|
+
show: true
|
|
33
|
+
})
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const disabled = () => {
|
|
38
|
+
viewer.scene.primitives.remove(water)
|
|
39
|
+
water = null
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return {
|
|
43
|
+
enabled,
|
|
44
|
+
disabled
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
useSeawater
|
|
50
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-three-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.353",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -8,5 +8,5 @@
|
|
|
8
8
|
"author": "",
|
|
9
9
|
"license": "ISC",
|
|
10
10
|
"types": "./index.d.ts",
|
|
11
|
-
"description": "
|
|
11
|
+
"description": "新增海水"
|
|
12
12
|
}
|