react-native-cesium 1.2.18 → 1.2.20
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 +11 -8
- package/android/CMakeLists.txt +1 -0
- package/android/build.gradle +1 -1
- package/android/gradle.properties +4 -4
- package/android/src/main/cpp/CesiumBridgeAndroid.cpp +44 -18
- package/android/src/main/cpp/CesiumBridgeAndroid.h +9 -0
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/CesiumBridgeJNI.kt +3 -0
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/HybridCesiumView.kt +9 -0
- package/cpp/engine/CameraIntegrator.cpp +82 -47
- package/cpp/engine/CameraIntegrator.hpp +27 -8
- package/cpp/engine/CesiumEngine.cpp +183 -312
- package/cpp/engine/CesiumEngine.hpp +41 -28
- package/cpp/engine/EngineTunables.hpp +6 -5
- package/cpp/engine/GeoidConverter.cpp +32 -11
- package/cpp/engine/GeoidConverter.hpp +41 -0
- package/cpp/engine/GltfToMesh.cpp +14 -5
- package/cpp/engine/ResourcePreparer.cpp +3 -3
- package/cpp/engine/ResourcePreparer.hpp +1 -1
- package/cpp/engine/TerrainFloor.hpp +70 -0
- package/cpp/engine/TerrainHeight.hpp +113 -0
- package/cpp/engine/test/CameraIntegratorTest.cpp +264 -0
- package/cpp/engine/test/GeoidConverterTest.cpp +77 -0
- package/cpp/engine/test/build_and_run.sh +20 -6
- package/ios/CesiumBridge.h +5 -0
- package/ios/CesiumBridge.mm +61 -32
- package/ios/HybridCesiumView.swift +11 -0
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts +34 -9
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JCameraState.hpp +1 -1
- package/nitrogen/generated/android/c++/JCesiumMetrics.hpp +1 -1
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.cpp +9 -0
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.hpp +2 -0
- package/nitrogen/generated/android/c++/JQuaternion.hpp +1 -1
- package/nitrogen/generated/android/c++/views/JHybridCesiumViewStateUpdater.cpp +182 -131
- package/nitrogen/generated/android/c++/views/JHybridCesiumViewStateUpdater.hpp +6 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CameraState.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CesiumMetrics.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Func_void_CameraState.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Func_void_CesiumMetrics.kt +0 -2
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/HybridCesiumViewSpec.kt +8 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Quaternion.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/views/HybridCesiumViewManager.kt +26 -10
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/views/HybridCesiumViewStateUpdater.kt +2 -2
- package/nitrogen/generated/ios/ReactNativeCesium-Swift-Cxx-Bridge.hpp +15 -0
- package/nitrogen/generated/ios/c++/HybridCesiumViewSpecSwift.hpp +7 -0
- package/nitrogen/generated/ios/c++/views/HybridCesiumViewComponent.mm +217 -161
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec.swift +1 -0
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec_cxx.swift +24 -0
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.cpp +2 -0
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.hpp +2 -0
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.cpp +36 -335
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.hpp +110 -77
- package/nitrogen/generated/shared/json/CesiumViewConfig.json +1 -0
- package/package.json +12 -12
- package/scripts/cesium/config.mjs +1 -1
- package/scripts/cesium/vcpkg-triplets/arm64-ios-simulator.cmake +3 -0
- package/scripts/cesium/vcpkg-triplets/arm64-ios.cmake +4 -0
- package/src/specs/cesium-view.nitro.ts +34 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-cesium",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.20",
|
|
4
4
|
"description": "Experimental Cesium rendering for React Native via Nitro",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"node": ">=18"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"react-native-nitro-modules": "^0.
|
|
68
|
+
"react-native-nitro-modules": "^0.37.1"
|
|
69
69
|
},
|
|
70
70
|
"publishConfig": {
|
|
71
71
|
"access": "public",
|
|
@@ -73,17 +73,17 @@
|
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
75
|
"@jamesacarr/eslint-formatter-github-actions": "^0.2.0",
|
|
76
|
-
"@semantic-release/changelog": "^
|
|
77
|
-
"@semantic-release/git": "^
|
|
76
|
+
"@semantic-release/changelog": "^7.0.0",
|
|
77
|
+
"@semantic-release/git": "^11.0.1",
|
|
78
78
|
"@types/jest": "^29.5.14",
|
|
79
|
-
"@types/react": "19.
|
|
80
|
-
"conventional-changelog-conventionalcommits": "^
|
|
81
|
-
"nitrogen": "0.
|
|
82
|
-
"react": "19.
|
|
83
|
-
"react-native": "0.
|
|
84
|
-
"react-native-builder-bob": "^0.43.
|
|
85
|
-
"semantic-release": "^25.0.
|
|
86
|
-
"typescript": "^
|
|
79
|
+
"@types/react": "^19.3.0",
|
|
80
|
+
"conventional-changelog-conventionalcommits": "^10.4.1",
|
|
81
|
+
"nitrogen": "^0.37.1",
|
|
82
|
+
"react": "^19.3.0",
|
|
83
|
+
"react-native": "^0.87.1",
|
|
84
|
+
"react-native-builder-bob": "^0.43.2",
|
|
85
|
+
"semantic-release": "^25.0.9",
|
|
86
|
+
"typescript": "^6.0.3"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"react": ">=18.0.0",
|
|
@@ -7,4 +7,7 @@ set(VCPKG_CRT_LINKAGE dynamic)
|
|
|
7
7
|
set(VCPKG_LIBRARY_LINKAGE static)
|
|
8
8
|
set(VCPKG_CMAKE_SYSTEM_NAME iOS)
|
|
9
9
|
set(VCPKG_OSX_SYSROOT iphonesimulator)
|
|
10
|
+
# Same iOS 15.1 floor as arm64-ios: Xcode 27 libc++ rejects older deployment
|
|
11
|
+
# targets under -Werror (ktx/astc-encoder).
|
|
12
|
+
set(VCPKG_OSX_DEPLOYMENT_TARGET 15.1)
|
|
10
13
|
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DHAVE_PIPE2=OFF;-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY")
|
|
@@ -11,4 +11,8 @@ set(VCPKG_CMAKE_SYSTEM_NAME iOS)
|
|
|
11
11
|
# CMake defaults CMAKE_OSX_SYSROOT to the host MacOSX SDK and Clang builds with an invalid
|
|
12
12
|
# --target=…-macabi mix (breaks ktx/astc-encoder on newer Xcode).
|
|
13
13
|
set(VCPKG_OSX_SYSROOT iphoneos)
|
|
14
|
+
# Xcode 27 libc++ warns (and ktx/astc-encoder builds with -Werror) when the
|
|
15
|
+
# deployment target is below iOS 15. CMake's iOS default is 12.0. Match the
|
|
16
|
+
# Cesium Native iOS build (CMAKE_OSX_DEPLOYMENT_TARGET=15.1).
|
|
17
|
+
set(VCPKG_OSX_DEPLOYMENT_TARGET 15.1)
|
|
14
18
|
set(VCPKG_CMAKE_CONFIGURE_OPTIONS "-DHAVE_PIPE2=OFF;-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY")
|
|
@@ -11,6 +11,11 @@ import type {
|
|
|
11
11
|
export interface CameraState {
|
|
12
12
|
latitude: number
|
|
13
13
|
longitude: number
|
|
14
|
+
/**
|
|
15
|
+
* Metres. Mean sea level unless `altitudeDatum` is `"ellipsoid"`, in which
|
|
16
|
+
* case this is WGS84 ellipsoidal height. `getActualCamera`,
|
|
17
|
+
* `getDemandCamera`, and `onActualCamera` report altitude in that same unit.
|
|
18
|
+
*/
|
|
14
19
|
altitude: number
|
|
15
20
|
heading: number
|
|
16
21
|
pitch: number
|
|
@@ -59,6 +64,16 @@ export interface CesiumViewProps extends HybridViewProps {
|
|
|
59
64
|
/** 1 = off; 2 or 4 = MSAA when supported. */
|
|
60
65
|
msaaSampleCount: number
|
|
61
66
|
ionImageryAssetId: number
|
|
67
|
+
/**
|
|
68
|
+
* Vertical datum of public altitude numbers, in both directions.
|
|
69
|
+
* `"msl"` (default) is metres above mean sea level.
|
|
70
|
+
* `"ellipsoid"` is WGS84 ellipsoidal height (Android `Location.getAltitude`).
|
|
71
|
+
* Ellipsoidal heights are converted to mean sea level with EGM96 before the
|
|
72
|
+
* camera integrator, and converted back on read. Switching this prop does
|
|
73
|
+
* not move the camera: later reads use the new unit, and the next
|
|
74
|
+
* `setAltitude`, `setPosition`, or `teleport` is interpreted in that unit.
|
|
75
|
+
*/
|
|
76
|
+
altitudeDatum?: string
|
|
62
77
|
|
|
63
78
|
// ── Optional perf / quality knobs ────────────────────────────────────────
|
|
64
79
|
// Note: all optional props below use "set once" semantics. Once a value has
|
|
@@ -98,12 +113,13 @@ export interface CesiumViewProps extends HybridViewProps {
|
|
|
98
113
|
*/
|
|
99
114
|
taskProcessorThreads?: number
|
|
100
115
|
/**
|
|
101
|
-
*
|
|
102
|
-
* terrain
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* (actual) camera
|
|
116
|
+
* Clearance above the rendered terrain surface, in metres, added on top of the
|
|
117
|
+
* terrain height at the camera position. The floor is always on. 0 means the
|
|
118
|
+
* camera may sit on the surface and may not go below it.
|
|
119
|
+
* Until a terrain tile has been sampled, the camera is held at or above the
|
|
120
|
+
* WGS84 ellipsoid. The demand altitude is not modified — only the rendered
|
|
121
|
+
* (actual) camera is held to this minimum, and it follows the surface down
|
|
122
|
+
* when the demand is at or below the floor.
|
|
107
123
|
*/
|
|
108
124
|
minAltitudeAboveTerrain?: number
|
|
109
125
|
|
|
@@ -156,10 +172,18 @@ export interface CesiumViewMethods extends HybridViewMethods {
|
|
|
156
172
|
* for GPS or scripted position updates. Latitude is clamped to ±90 by the
|
|
157
173
|
* integrator; longitude is continuous (no wrap normalisation) so the
|
|
158
174
|
* shortest-arc residual maths stays correct across the antimeridian.
|
|
175
|
+
* When `altitudeDatum` is `"ellipsoid"`, a horizontal move keeps the
|
|
176
|
+
* demanded ellipsoidal height and recomputes mean sea level at the new
|
|
177
|
+
* point. Mean-sea-level mode leaves altitude unchanged.
|
|
159
178
|
*/
|
|
160
179
|
setPosition(latitude: number, longitude: number): void
|
|
161
180
|
|
|
162
|
-
/**
|
|
181
|
+
/**
|
|
182
|
+
* New altitude demand, in metres. Interpreted as mean sea level unless
|
|
183
|
+
* `altitudeDatum` is `"ellipsoid"`, in which case it is WGS84 height and
|
|
184
|
+
* converted to MSL before the integrator. A later read reports the same
|
|
185
|
+
* sample back in this unit.
|
|
186
|
+
*/
|
|
163
187
|
setAltitude(altitudeMeters: number): void
|
|
164
188
|
|
|
165
189
|
/** New heading demand (degrees, 0 = north, increasing clockwise). */
|
|
@@ -194,14 +218,15 @@ export interface CesiumViewMethods extends HybridViewMethods {
|
|
|
194
218
|
* Most recent camera that was rendered (post-integration). This is what
|
|
195
219
|
* the user is currently looking at and is what a HUD overlay should
|
|
196
220
|
* mirror. Differs from `getDemandCamera()` while a glide is in progress
|
|
197
|
-
* or when the terrain-floor clamp has raised the altitude.
|
|
221
|
+
* or when the terrain-floor clamp has raised the altitude. Altitude is in
|
|
222
|
+
* the unit selected by `altitudeDatum`.
|
|
198
223
|
*/
|
|
199
224
|
getActualCamera(): Promise<CameraState>
|
|
200
225
|
|
|
201
226
|
/**
|
|
202
227
|
* What the consumer last asked for (per-DoF demand). Useful for
|
|
203
228
|
* diagnostics or for showing the requested camera alongside the rendered
|
|
204
|
-
* one.
|
|
229
|
+
* one. Altitude is in the unit selected by `altitudeDatum`.
|
|
205
230
|
*/
|
|
206
231
|
getDemandCamera(): Promise<CameraState>
|
|
207
232
|
|