react-native-cesium 1.2.9 → 1.2.11

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.
@@ -312,17 +312,15 @@ void CesiumBridgeAndroid::renderFrame(double nowSeconds) {
312
312
 
313
313
  // ── Terrain floor clamp ───────────────────────────────────────────────
314
314
  const float minAbove = engine_->getConfig().minAltitudeAboveTerrain;
315
- if (minAbove > 0.0f) {
316
- const double geoidOffset =
315
+ if (minAbove > 0.0f && engine_->terrainFloorKnown()) {
316
+ const double geoidN =
317
317
  reactnativecesium::mslToEllipsoidMeters(actual.latitude, actual.longitude, 0.0);
318
- const double camEllipsoid =
319
- reactnativecesium::mslToEllipsoidMeters(actual.latitude, actual.longitude, actual.altitude);
320
- const double minEllipsoid =
321
- static_cast<double>(engine_->terrainFloorEllipsoidMeters()) + minAbove;
322
- if (camEllipsoid < minEllipsoid) {
323
- const double clampedMsl = minEllipsoid - geoidOffset;
324
- integrator_->clampActualAltitude(clampedMsl);
325
- actual.altitude = clampedMsl;
318
+ const double floorMsl =
319
+ static_cast<double>(engine_->terrainFloorEllipsoidMeters()) - geoidN;
320
+ const double minMsl = floorMsl + static_cast<double>(minAbove);
321
+ if (actual.altitude < minMsl) {
322
+ integrator_->clampActualAltitude(minMsl);
323
+ actual.altitude = minMsl;
326
324
  }
327
325
  }
328
326
 
@@ -13,7 +13,9 @@
13
13
  #include <Cesium3DTilesSelection/TilesetExternals.h>
14
14
  #include <Cesium3DTilesSelection/TilesetOptions.h>
15
15
  #include <CesiumGeospatial/BoundingRegion.h>
16
+ #include <CesiumGeospatial/Ellipsoid.h>
16
17
  #include <CesiumGeospatial/GlobeRectangle.h>
18
+ #include <CesiumGeospatial/GlobeTransforms.h>
17
19
  #include <CesiumAsync/CachingAssetAccessor.h>
18
20
  #include <CesiumAsync/SqliteCache.h>
19
21
  #include <CesiumCurl/CurlAssetAccessor.h>
@@ -607,7 +609,16 @@ void CesiumEngine::updateFrame(double w, double h, FrameResult& result) {
607
609
  const double camLatRad = glm::radians(camParams.latitude);
608
610
  const double camLonRad = glm::radians(camParams.longitude);
609
611
  float bestTerrainFloor = terrainFloorEllipsoidM_; // carry previous value if no tile matches
610
- double bestTerrainDist = std::numeric_limits<double>::max();
612
+ double bestHorizDistSq = std::numeric_limits<double>::max();
613
+ bool floorScanFound = false;
614
+
615
+ // Horizontal search radius for floor sampling (50m = reasonable for urban terrain).
616
+ // Vertices within this radius are candidates; we pick the lowest (ground level).
617
+ constexpr double kFloorSearchRadiusM = 50.0;
618
+ constexpr double kFloorSearchRadiusSq = kFloorSearchRadiusM * kFloorSearchRadiusM;
619
+ // 3D fallback: if no vertices within horizontal radius, use closest 3D vertex.
620
+ double bestDist3D = std::numeric_limits<double>::max();
621
+ float bestDist3DFloor = 0.0f;
611
622
 
612
623
  // ── floor-scan cache lookup ─────────────────────────────────────────
613
624
  // Skip the per-vertex scan when the camera has moved less than ~10 cm in
@@ -630,6 +641,18 @@ void CesiumEngine::updateFrame(double w, double h, FrameResult& result) {
630
641
  // semantics aligned).
631
642
  const bool runFloorScan = trackTerrainFloor && !floorScanFromCache;
632
643
 
644
+ // ENU basis at the camera — horizontal distance to each terrain vertex.
645
+ glm::dvec3 floorEast(1.0, 0.0, 0.0);
646
+ glm::dvec3 floorNorth(0.0, 1.0, 0.0);
647
+ if (runFloorScan) {
648
+ const auto& ellipsoid = CesiumGeospatial::Ellipsoid::WGS84;
649
+ const glm::dmat4 enuToEcef =
650
+ CesiumGeospatial::GlobeTransforms::eastNorthUpToFixedFrame(
651
+ cameraPos, ellipsoid);
652
+ floorEast = glm::normalize(glm::dvec3(enuToEcef[0]));
653
+ floorNorth = glm::normalize(glm::dvec3(enuToEcef[1]));
654
+ }
655
+
633
656
  // ── fast path ────────────────────────────────────────────────────────
634
657
  // The visible primitive list has been identical for kMaxFramesInFlight
635
658
  // frames in a row, so every backend slot is guaranteed to hold a copy of
@@ -660,14 +683,35 @@ void CesiumEngine::updateFrame(double w, double h, FrameResult& result) {
660
683
  for (size_t vi = 0; vi < vc; ++vi) {
661
684
  const glm::dvec3 vECEF =
662
685
  glm::dvec3(prim.localPositions[vi]) + prim.rtcCenter;
663
- const double dist = glm::length(vECEF - cameraPos);
664
- if (dist < bestTerrainDist) {
665
- bestTerrainDist = dist;
666
- bestTerrainFloor = prim.altitudes[vi];
686
+ const glm::dvec3 delta = vECEF - cameraPos;
687
+ const double de = glm::dot(delta, floorEast);
688
+ const double dn = glm::dot(delta, floorNorth);
689
+ const double horizSq = de * de + dn * dn;
690
+ const float vAlt = prim.altitudes[vi];
691
+
692
+ // Primary: horizontal search within radius, pick minimum altitude.
693
+ if (horizSq <= kFloorSearchRadiusSq) {
694
+ if (!floorScanFound || vAlt < bestTerrainFloor) {
695
+ bestTerrainFloor = vAlt;
696
+ bestHorizDistSq = horizSq;
697
+ floorScanFound = true;
698
+ }
699
+ }
700
+
701
+ // Fallback: track closest 3D vertex for sparse/ocean scenarios.
702
+ const double dist3D = glm::length(delta);
703
+ if (dist3D < bestDist3D) {
704
+ bestDist3D = dist3D;
705
+ bestDist3DFloor = vAlt;
667
706
  }
668
707
  }
669
708
  }
670
709
  }
710
+ // If no vertices within horizontal radius, use 3D fallback.
711
+ if (!floorScanFound && bestDist3D < std::numeric_limits<double>::max()) {
712
+ bestTerrainFloor = bestDist3DFloor;
713
+ floorScanFound = true;
714
+ }
671
715
  }
672
716
 
673
717
  const glm::dvec3 rtcCamRel = c.rtcCenter - glm::dvec3(cameraPos);
@@ -703,8 +747,9 @@ void CesiumEngine::updateFrame(double w, double h, FrameResult& result) {
703
747
  result.cameraLon = paramsFP.longitude;
704
748
  result.cameraAlt = paramsFP.altitude;
705
749
 
706
- if (trackTerrainFloor) {
750
+ if (trackTerrainFloor && (floorScanFound || floorScanFromCache)) {
707
751
  terrainFloorEllipsoidM_ = bestTerrainFloor;
752
+ terrainFloorValid_ = true;
708
753
  // P5: refresh the floor cache on a fresh scan; skip when we hit the
709
754
  // cache (the stored value already reflects this signature).
710
755
  if (runFloorScan && signature != 0ULL) {
@@ -763,13 +808,34 @@ void CesiumEngine::updateFrame(double w, double h, FrameResult& result) {
763
808
  for (size_t vi = 0; vi < vertexCount; ++vi) {
764
809
  const glm::dvec3 vECEF =
765
810
  glm::dvec3(prim.localPositions[vi]) + prim.rtcCenter;
766
- const double dist = glm::length(vECEF - cameraPos);
767
- if (dist < bestTerrainDist) {
768
- bestTerrainDist = dist;
769
- bestTerrainFloor = prim.altitudes[vi];
811
+ const glm::dvec3 delta = vECEF - cameraPos;
812
+ const double de = glm::dot(delta, floorEast);
813
+ const double dn = glm::dot(delta, floorNorth);
814
+ const double horizSq = de * de + dn * dn;
815
+ const float vAlt = prim.altitudes[vi];
816
+
817
+ // Primary: horizontal search within radius, pick minimum altitude.
818
+ if (horizSq <= kFloorSearchRadiusSq) {
819
+ if (!floorScanFound || vAlt < bestTerrainFloor) {
820
+ bestTerrainFloor = vAlt;
821
+ bestHorizDistSq = horizSq;
822
+ floorScanFound = true;
823
+ }
824
+ }
825
+
826
+ // Fallback: track closest 3D vertex for sparse/ocean scenarios.
827
+ const double dist3D = glm::length(delta);
828
+ if (dist3D < bestDist3D) {
829
+ bestDist3D = dist3D;
830
+ bestDist3DFloor = vAlt;
770
831
  }
771
832
  }
772
833
  }
834
+ // If no vertices within horizontal radius, use 3D fallback.
835
+ if (!floorScanFound && bestDist3D < std::numeric_limits<double>::max()) {
836
+ bestTerrainFloor = bestDist3DFloor;
837
+ floorScanFound = true;
838
+ }
773
839
  }
774
840
  }
775
841
 
@@ -1018,8 +1084,9 @@ void CesiumEngine::updateFrame(double w, double h, FrameResult& result) {
1018
1084
  result.cameraLon = params.longitude;
1019
1085
  result.cameraAlt = params.altitude;
1020
1086
 
1021
- if (trackTerrainFloor) {
1087
+ if (trackTerrainFloor && (floorScanFound || floorScanFromCache)) {
1022
1088
  terrainFloorEllipsoidM_ = bestTerrainFloor;
1089
+ terrainFloorValid_ = true;
1023
1090
  // refresh the floor cache on a fresh scan (slow path always runs a
1024
1091
  // scan unless the cache short-circuit fired above). Only memoise when
1025
1092
  // the geometry signature is stable enough to key on.
@@ -142,10 +142,11 @@ public:
142
142
 
143
143
  const EngineConfig& getConfig() const { return config_; }
144
144
 
145
- // Ellipsoid height (metres) of the terrain vertex nearest to the camera nadir,
146
- // updated each frame from the loaded tile mesh. 0.0 until the first terrain
147
- // tile covering the camera position has been rendered.
145
+ // Ellipsoid height (metres) of the terrain surface under the camera nadir,
146
+ // sampled from loaded tile meshes. Meaningless until terrainFloorKnown().
148
147
  float terrainFloorEllipsoidMeters() const { return terrainFloorEllipsoidM_; }
148
+ // True after at least one frame has sampled the floor from real terrain tiles.
149
+ bool terrainFloorKnown() const { return terrainFloorValid_; }
149
150
 
150
151
  private:
151
152
  void createTileset();
@@ -184,9 +185,10 @@ private:
184
185
  GlobeCamera camera_;
185
186
  TileLifecycleManager lifecycle_;
186
187
 
187
- // Ellipsoid height of the terrain surface at the camera nadir, updated each
188
- // frame. Initialised to 0 (sea level) until a terrain tile is first loaded.
188
+ // Ellipsoid height of the terrain surface at the camera nadir (horizontal
189
+ // nearest-neighbour sample). Only written after a successful tile scan.
189
190
  float terrainFloorEllipsoidM_ = 0.0f;
191
+ bool terrainFloorValid_ = false;
190
192
 
191
193
  // Wall-clock timestamp of the previous updateFrame call. Used to compute
192
194
  // deltaTime for Tileset::updateViewGroup, which drives LOD transition fading.
@@ -225,7 +227,8 @@ private:
225
227
  // ── terrain-floor scan cache ──────────────────────────────────────
226
228
  // The minAltitudeAboveTerrain clamp scans every vertex of every tile whose
227
229
  // bounding region contains the camera lon/lat and picks the altitude of
228
- // the vertex with the smallest 3D distance to the camera. That's an O(NV)
230
+ // the vertex with the smallest horizontal (ENU) distance to the camera
231
+ // nadir (tie-break: lower ellipsoid height). That's an O(NV)
229
232
  // scan over the visible primitives — dominant CPU cost when the camera
230
233
  // sits over a dense LOD chain. Result depends only on the camera lon/lat
231
234
  // and the set of visible primitives, so we cache it keyed on
@@ -387,17 +387,15 @@
387
387
  // Uses terrain floor from the previous frame (one-frame lag is
388
388
  // imperceptible at 60 fps). Skipped when minAltitudeAboveTerrain == 0.
389
389
  const float minAbove = _engine->getConfig().minAltitudeAboveTerrain;
390
- if (minAbove > 0.0f) {
391
- const double geoidOffset =
390
+ if (minAbove > 0.0f && _engine->terrainFloorKnown()) {
391
+ const double geoidN =
392
392
  reactnativecesium::mslToEllipsoidMeters(actual.latitude, actual.longitude, 0.0);
393
- const double camEllipsoid =
394
- reactnativecesium::mslToEllipsoidMeters(actual.latitude, actual.longitude, actual.altitude);
395
- const double minEllipsoid =
396
- static_cast<double>(_engine->terrainFloorEllipsoidMeters()) + minAbove;
397
- if (camEllipsoid < minEllipsoid) {
398
- const double clampedMsl = minEllipsoid - geoidOffset;
399
- _integrator->clampActualAltitude(clampedMsl);
400
- actual.altitude = clampedMsl;
393
+ const double floorMsl =
394
+ static_cast<double>(_engine->terrainFloorEllipsoidMeters()) - geoidN;
395
+ const double minMsl = floorMsl + static_cast<double>(minAbove);
396
+ if (actual.altitude < minMsl) {
397
+ _integrator->clampActualAltitude(minMsl);
398
+ actual.altitude = minMsl;
401
399
  }
402
400
  }
403
401
 
@@ -84,10 +84,12 @@ export interface CesiumViewProps extends HybridViewProps {
84
84
  */
85
85
  taskProcessorThreads?: number;
86
86
  /**
87
- * Minimum altitude above the loaded terrain surface, in metres MSL.
88
- * Default 0 (no constraint). Set to e.g. 2 to prevent the camera from going underground.
89
- * The clamp is applied every frame in native, based on the altitude of the nearest
90
- * terrain mesh vertex to the camera nadir.
87
+ * Minimum clearance above the loaded terrain surface, in metres (added on top of the
88
+ * terrain MSL height at the camera position). Default 0 (no constraint).
89
+ * Set to e.g. 2 to prevent the camera from going underground.
90
+ * The clamp runs only after terrain tiles have been sampled; until then the demand
91
+ * altitude is used as-is. The demand altitude is not modified — only the rendered
92
+ * (actual) camera may be raised to meet this minimum.
91
93
  */
92
94
  minAltitudeAboveTerrain?: number;
93
95
  /** Maximum yaw rate (degrees per second). 0 = uncapped. */
@@ -1 +1 @@
1
- {"version":3,"file":"cesium-view.nitro.d.ts","sourceRoot":"","sources":["../../../../src/specs/cesium-view.nitro.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,iBAAiB,EAClB,MAAM,4BAA4B,CAAA;AAEnC;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;CACvB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACV;AAED,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAA;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,+DAA+D;IAC/D,aAAa,EAAE,OAAO,CAAA;IACtB,YAAY,EAAE,OAAO,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,cAAc,EAAE,MAAM,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;IAClB;;;;OAIG;IACH,aAAa,EAAE,WAAW,CAAA;IAC1B,cAAc,EAAE,OAAO,CAAA;IACvB,uBAAuB,EAAE,MAAM,CAAA;IAC/B,4BAA4B,EAAE,MAAM,CAAA;IACpC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,6CAA6C;IAC7C,eAA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Ac,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAEjC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAA;IAEnC;;;;;OAKG;IACH,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;IAEvC;;;;OAIG;IACH,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC,CAAA;IAEvC,8EAA8E;IAC9E,iBAAiB,IAAI,OAAO,CAAC,UAAU,CAAC,CAAA;CACzC;AAED,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "react-native-cesium",
3
- "version": "1.2.9",
4
- "description": "Experimental Cesium rendering for React Native via Nitro (iOS/Metal today; Android planned)",
3
+ "version": "1.2.11",
4
+ "description": "Experimental Cesium rendering for React Native via Nitro",
5
5
  "main": "./lib/commonjs/index.js",
6
6
  "module": "./lib/module/index.js",
7
7
  "types": "./lib/typescript/src/index.d.ts",
@@ -64,7 +64,7 @@
64
64
  "node": ">=18"
65
65
  },
66
66
  "dependencies": {
67
- "react-native-nitro-modules": "^0.35.6"
67
+ "react-native-nitro-modules": "^0.35.7"
68
68
  },
69
69
  "publishConfig": {
70
70
  "access": "public",
@@ -77,7 +77,7 @@
77
77
  "@types/jest": "^29.5.14",
78
78
  "@types/react": "19.2.14",
79
79
  "conventional-changelog-conventionalcommits": "^9.3.1",
80
- "nitrogen": "0.35.6",
80
+ "nitrogen": "0.35.7",
81
81
  "react": "19.2.3",
82
82
  "react-native": "0.85.3",
83
83
  "react-native-builder-bob": "^0.41.0",
@@ -98,10 +98,12 @@ export interface CesiumViewProps extends HybridViewProps {
98
98
  */
99
99
  taskProcessorThreads?: number
100
100
  /**
101
- * Minimum altitude above the loaded terrain surface, in metres MSL.
102
- * Default 0 (no constraint). Set to e.g. 2 to prevent the camera from going underground.
103
- * The clamp is applied every frame in native, based on the altitude of the nearest
104
- * terrain mesh vertex to the camera nadir.
101
+ * Minimum clearance above the loaded terrain surface, in metres (added on top of the
102
+ * terrain MSL height at the camera position). Default 0 (no constraint).
103
+ * Set to e.g. 2 to prevent the camera from going underground.
104
+ * The clamp runs only after terrain tiles have been sampled; until then the demand
105
+ * altitude is used as-is. The demand altitude is not modified — only the rendered
106
+ * (actual) camera may be raised to meet this minimum.
105
107
  */
106
108
  minAltitudeAboveTerrain?: number
107
109