react-native-cesium 1.0.6 → 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.
Files changed (59) hide show
  1. package/README.md +64 -11
  2. package/ReactNativeCesium.podspec +1 -1
  3. package/android/CMakeLists.txt +5 -3
  4. package/android/src/main/cpp/CesiumBridgeAndroid.cpp +197 -227
  5. package/android/src/main/cpp/CesiumBridgeAndroid.h +48 -49
  6. package/android/src/main/cpp/cpp-adapter.cpp +2 -2
  7. package/android/src/main/cpp/vulkan/VulkanBackend.cpp +1010 -569
  8. package/android/src/main/cpp/vulkan/VulkanBackend.h +121 -12
  9. package/android/src/main/cpp/vulkan/shaders/sky.frag +20 -10
  10. package/android/src/main/java/com/margelo/nitro/reactnativecesium/CesiumBridgeJNI.kt +28 -0
  11. package/android/src/main/java/com/margelo/nitro/reactnativecesium/HybridCesiumView.kt +295 -58
  12. package/cpp/engine/CameraSmoother.cpp +99 -0
  13. package/cpp/engine/CameraSmoother.hpp +29 -0
  14. package/cpp/engine/CameraTargetState.cpp +49 -0
  15. package/cpp/engine/CameraTargetState.hpp +121 -0
  16. package/cpp/engine/CesiumEngine.cpp +206 -60
  17. package/cpp/engine/CesiumEngine.hpp +77 -10
  18. package/cpp/engine/EngineTunables.hpp +79 -0
  19. package/cpp/engine/GeoidConverter.cpp +36 -0
  20. package/cpp/engine/GeoidConverter.hpp +10 -0
  21. package/cpp/engine/GlobeCamera.cpp +7 -2
  22. package/cpp/engine/MetricsAggregator.cpp +71 -0
  23. package/cpp/engine/MetricsAggregator.hpp +54 -0
  24. package/cpp/engine/TileLifecycleManager.cpp +0 -12
  25. package/cpp/engine/TileLifecycleManager.hpp +0 -3
  26. package/cpp/third_party/egm96/EGM96.c +289 -0
  27. package/cpp/third_party/egm96/EGM96.h +45 -0
  28. package/cpp/third_party/egm96/EGM96_data.h +65372 -0
  29. package/ios/CesiumBridge.h +24 -5
  30. package/ios/CesiumBridge.mm +149 -271
  31. package/ios/HybridCesiumView.swift +197 -40
  32. package/ios/metal/MetalBackend.mm +72 -23
  33. package/lib/typescript/src/specs/cesium-view.nitro.d.ts +26 -0
  34. package/lib/typescript/src/specs/cesium-view.nitro.d.ts.map +1 -1
  35. package/nitrogen/generated/android/c++/JCesiumMetrics.hpp +5 -1
  36. package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.cpp +109 -1
  37. package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.hpp +24 -0
  38. package/nitrogen/generated/android/c++/views/JHybridCesiumViewStateUpdater.cpp +48 -0
  39. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CameraState.kt +25 -0
  40. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/CesiumMetrics.kt +32 -2
  41. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/HybridCesiumViewSpec.kt +72 -0
  42. package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/Quaternion.kt +19 -0
  43. package/nitrogen/generated/ios/ReactNativeCesium-Swift-Cxx-Bridge.hpp +30 -0
  44. package/nitrogen/generated/ios/c++/HybridCesiumViewSpecSwift.hpp +85 -1
  45. package/nitrogen/generated/ios/c++/views/HybridCesiumViewComponent.mm +60 -0
  46. package/nitrogen/generated/ios/swift/CesiumMetrics.swift +7 -2
  47. package/nitrogen/generated/ios/swift/HybridCesiumViewSpec.swift +12 -0
  48. package/nitrogen/generated/ios/swift/HybridCesiumViewSpec_cxx.swift +288 -0
  49. package/nitrogen/generated/shared/c++/CesiumMetrics.hpp +5 -1
  50. package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.cpp +24 -0
  51. package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.hpp +25 -1
  52. package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.cpp +132 -0
  53. package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.hpp +13 -1
  54. package/nitrogen/generated/shared/json/CesiumViewConfig.json +12 -0
  55. package/package.json +4 -4
  56. package/scripts/cesium/clone.mjs +1 -1
  57. package/src/specs/cesium-view.nitro.ts +29 -0
  58. package/cpp/engine/DeletionQueue.cpp +0 -28
  59. package/cpp/engine/DeletionQueue.hpp +0 -28
@@ -33,6 +33,8 @@ export interface CesiumMetrics {
33
33
  tilesLoading: number
34
34
  tilesVisited: number
35
35
  ionTokenConfigured: boolean
36
+ /** True when a CA bundle has been resolved for libcurl TLS. */
37
+ tlsConfigured: boolean
36
38
  tilesetReady: boolean
37
39
  creditsPlainText: string
38
40
  }
@@ -49,6 +51,33 @@ export interface CesiumViewProps extends HybridViewProps {
49
51
  /** 1 = off; 2 or 4 = MSAA when supported. */
50
52
  msaaSampleCount: number
51
53
  ionImageryAssetId: number
54
+
55
+ // ── Optional perf / quality knobs (added in 1.1) ─────────────────────
56
+ /** RAM budget for live tileset, in mebibytes. Default 256. */
57
+ maximumCachedMiB?: number
58
+ /** Pre-load ancestor tiles around the visible set (smoother panning, more loads). Default true. */
59
+ preloadAncestors?: boolean
60
+ /** Pre-load sibling tiles around the visible set. Default true. */
61
+ preloadSiblings?: boolean
62
+ /** Refuse to render holes in the terrain. Default true. Relax for fast pans. */
63
+ forbidHoles?: boolean
64
+ /** Decode water-mask textures (coastline shading). Default true. */
65
+ enableWaterMask?: boolean
66
+ /** Cull tiles fully inside the fog volume. Default false. */
67
+ enableFogCulling?: boolean
68
+ /** When fog culling is on, override SSE for fogged tiles. Default true. */
69
+ enforceCulledScreenSpaceError?: boolean
70
+ /** SSE applied to fogged tiles when `enforceCulledScreenSpaceError` is true. Default 64. */
71
+ culledScreenSpaceError?: number
72
+ /** Cross-fade between LODs when refining (smoother pop-in). Default false. */
73
+ enableLodTransitionPeriod?: boolean
74
+ /** Length (s) of the LOD cross-fade. Default 1. */
75
+ lodTransitionLength?: number
76
+ /** Sqlite asset cache row budget. Default 4096. */
77
+ sqliteCacheMaxRows?: number
78
+ /** Worker thread count. 0 = auto (hardware_concurrency-1, clamped 2..8). */
79
+ taskProcessorThreads?: number
80
+
52
81
  onMetrics?: (metrics: CesiumMetrics) => void
53
82
  }
54
83
 
@@ -1,28 +0,0 @@
1
- #include "DeletionQueue.hpp"
2
-
3
- namespace reactnativecesium {
4
-
5
- void DeletionQueue::enqueue(TileGPUResources* resources, uint64_t currentFrame) {
6
- if (!resources) return;
7
- queue_.push_back({resources, currentFrame});
8
- }
9
-
10
- void DeletionQueue::processFrame(uint64_t currentFrame) {
11
- int disposed = 0;
12
- while (!queue_.empty() && disposed < MAX_DISPOSALS_PER_FRAME) {
13
- auto& front = queue_.front();
14
- if (currentFrame - front.enqueueFrame < MIN_FRAME_DELAY) break;
15
- delete front.resources;
16
- queue_.pop_front();
17
- ++disposed;
18
- }
19
- }
20
-
21
- void DeletionQueue::flush() {
22
- while (!queue_.empty()) {
23
- delete queue_.front().resources;
24
- queue_.pop_front();
25
- }
26
- }
27
-
28
- } // namespace reactnativecesium
@@ -1,28 +0,0 @@
1
- #pragma once
2
-
3
- #include "../renderer/RenderTypes.hpp"
4
-
5
- #include <cstdint>
6
- #include <deque>
7
-
8
- namespace reactnativecesium {
9
-
10
- // CPU-only resource deletion with a frame delay (avoids deleting in-flight data).
11
- class DeletionQueue {
12
- public:
13
- static constexpr uint64_t MIN_FRAME_DELAY = 3;
14
- static constexpr int MAX_DISPOSALS_PER_FRAME = 8;
15
-
16
- void enqueue(TileGPUResources* resources, uint64_t currentFrame);
17
- void processFrame(uint64_t currentFrame);
18
- void flush();
19
-
20
- private:
21
- struct Entry {
22
- TileGPUResources* resources;
23
- uint64_t enqueueFrame;
24
- };
25
- std::deque<Entry> queue_;
26
- };
27
-
28
- } // namespace reactnativecesium