react-native-cesium 1.2.2 → 1.2.4
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 +100 -26
- package/android/CMakeLists.txt +1 -2
- package/android/src/main/cpp/CesiumBridgeAndroid.cpp +264 -130
- package/android/src/main/cpp/CesiumBridgeAndroid.h +70 -27
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/CesiumBridgeJNI.kt +68 -44
- package/android/src/main/java/com/margelo/nitro/reactnativecesium/HybridCesiumView.kt +160 -187
- package/cpp/engine/CameraIntegrator.cpp +374 -0
- package/cpp/engine/CameraIntegrator.hpp +146 -0
- package/cpp/engine/CesiumEngine.cpp +3 -1
- package/cpp/engine/EngineTunables.hpp +80 -21
- package/cpp/engine/GlobeCamera.cpp +17 -6
- package/cpp/engine/GlobeCamera.hpp +11 -8
- package/cpp/engine/test/CameraIntegratorTest.cpp +205 -0
- package/cpp/engine/test/build_and_run.sh +27 -0
- package/example/README.md +1 -1
- package/ios/CesiumBridge.h +53 -28
- package/ios/CesiumBridge.mm +172 -86
- package/ios/HybridCesiumView.swift +213 -145
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts +77 -13
- package/lib/typescript/src/specs/cesium-view.nitro.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.cpp +90 -9
- package/nitrogen/generated/android/c++/JHybridCesiumViewSpec.hpp +19 -3
- package/nitrogen/generated/android/c++/views/JHybridCesiumViewStateUpdater.cpp +20 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/reactnativecesium/HybridCesiumViewSpec.kt +57 -3
- package/nitrogen/generated/ios/ReactNativeCesium-Swift-Cxx-Bridge.hpp +9 -9
- package/nitrogen/generated/ios/c++/HybridCesiumViewSpecSwift.hpp +82 -9
- package/nitrogen/generated/ios/c++/views/HybridCesiumViewComponent.mm +25 -0
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec.swift +14 -3
- package/nitrogen/generated/ios/swift/HybridCesiumViewSpec_cxx.swift +210 -16
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.cpp +19 -3
- package/nitrogen/generated/shared/c++/HybridCesiumViewSpec.hpp +20 -4
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.cpp +55 -0
- package/nitrogen/generated/shared/c++/views/HybridCesiumViewComponent.hpp +5 -0
- package/nitrogen/generated/shared/json/CesiumViewConfig.json +5 -0
- package/package.json +2 -2
- package/src/specs/cesium-view.nitro.ts +93 -14
- package/cpp/engine/CameraSmoother.cpp +0 -71
- package/cpp/engine/CameraSmoother.hpp +0 -25
- package/cpp/engine/CameraTargetState.cpp +0 -140
- package/cpp/engine/CameraTargetState.hpp +0 -103
|
@@ -256,6 +256,51 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
256
256
|
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* minAltitudeAboveTerrain */)>("setMinAltitudeAboveTerrain");
|
|
257
257
|
method(_javaPart, minAltitudeAboveTerrain.has_value() ? jni::JDouble::valueOf(minAltitudeAboveTerrain.value()) : nullptr);
|
|
258
258
|
}
|
|
259
|
+
std::optional<double> JHybridCesiumViewSpec::getMaxYawRateDegSec() {
|
|
260
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxYawRateDegSec");
|
|
261
|
+
auto __result = method(_javaPart);
|
|
262
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
263
|
+
}
|
|
264
|
+
void JHybridCesiumViewSpec::setMaxYawRateDegSec(std::optional<double> maxYawRateDegSec) {
|
|
265
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxYawRateDegSec */)>("setMaxYawRateDegSec");
|
|
266
|
+
method(_javaPart, maxYawRateDegSec.has_value() ? jni::JDouble::valueOf(maxYawRateDegSec.value()) : nullptr);
|
|
267
|
+
}
|
|
268
|
+
std::optional<double> JHybridCesiumViewSpec::getMaxPitchRateDegSec() {
|
|
269
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxPitchRateDegSec");
|
|
270
|
+
auto __result = method(_javaPart);
|
|
271
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
272
|
+
}
|
|
273
|
+
void JHybridCesiumViewSpec::setMaxPitchRateDegSec(std::optional<double> maxPitchRateDegSec) {
|
|
274
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxPitchRateDegSec */)>("setMaxPitchRateDegSec");
|
|
275
|
+
method(_javaPart, maxPitchRateDegSec.has_value() ? jni::JDouble::valueOf(maxPitchRateDegSec.value()) : nullptr);
|
|
276
|
+
}
|
|
277
|
+
std::optional<double> JHybridCesiumViewSpec::getMaxRollRateDegSec() {
|
|
278
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxRollRateDegSec");
|
|
279
|
+
auto __result = method(_javaPart);
|
|
280
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
281
|
+
}
|
|
282
|
+
void JHybridCesiumViewSpec::setMaxRollRateDegSec(std::optional<double> maxRollRateDegSec) {
|
|
283
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxRollRateDegSec */)>("setMaxRollRateDegSec");
|
|
284
|
+
method(_javaPart, maxRollRateDegSec.has_value() ? jni::JDouble::valueOf(maxRollRateDegSec.value()) : nullptr);
|
|
285
|
+
}
|
|
286
|
+
std::optional<double> JHybridCesiumViewSpec::getMaxClimbRateMps() {
|
|
287
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxClimbRateMps");
|
|
288
|
+
auto __result = method(_javaPart);
|
|
289
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
290
|
+
}
|
|
291
|
+
void JHybridCesiumViewSpec::setMaxClimbRateMps(std::optional<double> maxClimbRateMps) {
|
|
292
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxClimbRateMps */)>("setMaxClimbRateMps");
|
|
293
|
+
method(_javaPart, maxClimbRateMps.has_value() ? jni::JDouble::valueOf(maxClimbRateMps.value()) : nullptr);
|
|
294
|
+
}
|
|
295
|
+
std::optional<double> JHybridCesiumViewSpec::getMaxGroundSpeedMps() {
|
|
296
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<jni::JDouble>()>("getMaxGroundSpeedMps");
|
|
297
|
+
auto __result = method(_javaPart);
|
|
298
|
+
return __result != nullptr ? std::make_optional(__result->value()) : std::nullopt;
|
|
299
|
+
}
|
|
300
|
+
void JHybridCesiumViewSpec::setMaxGroundSpeedMps(std::optional<double> maxGroundSpeedMps) {
|
|
301
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<jni::JDouble> /* maxGroundSpeedMps */)>("setMaxGroundSpeedMps");
|
|
302
|
+
method(_javaPart, maxGroundSpeedMps.has_value() ? jni::JDouble::valueOf(maxGroundSpeedMps.value()) : nullptr);
|
|
303
|
+
}
|
|
259
304
|
std::optional<std::function<void(const CesiumMetrics& /* metrics */)>> JHybridCesiumViewSpec::getOnMetrics() {
|
|
260
305
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JFunc_void_CesiumMetrics::javaobject>()>("getOnMetrics_cxx");
|
|
261
306
|
auto __result = method(_javaPart);
|
|
@@ -275,8 +320,36 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
275
320
|
}
|
|
276
321
|
|
|
277
322
|
// Methods
|
|
278
|
-
|
|
279
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<
|
|
323
|
+
void JHybridCesiumViewSpec::setPosition(double latitude, double longitude) {
|
|
324
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* latitude */, double /* longitude */)>("setPosition");
|
|
325
|
+
method(_javaPart, latitude, longitude);
|
|
326
|
+
}
|
|
327
|
+
void JHybridCesiumViewSpec::setAltitude(double altitudeMeters) {
|
|
328
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* altitudeMeters */)>("setAltitude");
|
|
329
|
+
method(_javaPart, altitudeMeters);
|
|
330
|
+
}
|
|
331
|
+
void JHybridCesiumViewSpec::setHeading(double headingDeg) {
|
|
332
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* headingDeg */)>("setHeading");
|
|
333
|
+
method(_javaPart, headingDeg);
|
|
334
|
+
}
|
|
335
|
+
void JHybridCesiumViewSpec::setAttitude(double pitchDeg, double rollDeg) {
|
|
336
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* pitchDeg */, double /* rollDeg */)>("setAttitude");
|
|
337
|
+
method(_javaPart, pitchDeg, rollDeg);
|
|
338
|
+
}
|
|
339
|
+
void JHybridCesiumViewSpec::setViewCorrection(const Quaternion& q) {
|
|
340
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JQuaternion> /* q */)>("setViewCorrection");
|
|
341
|
+
method(_javaPart, JQuaternion::fromCpp(q));
|
|
342
|
+
}
|
|
343
|
+
void JHybridCesiumViewSpec::setVerticalFov(double deg) {
|
|
344
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(double /* deg */)>("setVerticalFov");
|
|
345
|
+
method(_javaPart, deg);
|
|
346
|
+
}
|
|
347
|
+
void JHybridCesiumViewSpec::teleport(const CameraState& camera) {
|
|
348
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<void(jni::alias_ref<JCameraState> /* camera */)>("teleport");
|
|
349
|
+
method(_javaPart, JCameraState::fromCpp(camera));
|
|
350
|
+
}
|
|
351
|
+
std::shared_ptr<Promise<CameraState>> JHybridCesiumViewSpec::getActualCamera() {
|
|
352
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getActualCamera");
|
|
280
353
|
auto __result = method(_javaPart);
|
|
281
354
|
return [&]() {
|
|
282
355
|
auto __promise = Promise<CameraState>::create();
|
|
@@ -291,13 +364,21 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
291
364
|
return __promise;
|
|
292
365
|
}();
|
|
293
366
|
}
|
|
294
|
-
|
|
295
|
-
static const auto method = _javaPart->javaClassStatic()->getMethod<
|
|
296
|
-
method(_javaPart
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
367
|
+
std::shared_ptr<Promise<CameraState>> JHybridCesiumViewSpec::getDemandCamera() {
|
|
368
|
+
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getDemandCamera");
|
|
369
|
+
auto __result = method(_javaPart);
|
|
370
|
+
return [&]() {
|
|
371
|
+
auto __promise = Promise<CameraState>::create();
|
|
372
|
+
__result->cthis()->addOnResolvedListener([=](const jni::alias_ref<jni::JObject>& __boxedResult) {
|
|
373
|
+
auto __result = jni::static_ref_cast<JCameraState>(__boxedResult);
|
|
374
|
+
__promise->resolve(__result->toCpp());
|
|
375
|
+
});
|
|
376
|
+
__result->cthis()->addOnRejectedListener([=](const jni::alias_ref<jni::JThrowable>& __throwable) {
|
|
377
|
+
jni::JniException __jniError(__throwable);
|
|
378
|
+
__promise->reject(std::make_exception_ptr(__jniError));
|
|
379
|
+
});
|
|
380
|
+
return __promise;
|
|
381
|
+
}();
|
|
301
382
|
}
|
|
302
383
|
std::shared_ptr<Promise<Quaternion>> JHybridCesiumViewSpec::getViewCorrection() {
|
|
303
384
|
static const auto method = _javaPart->javaClassStatic()->getMethod<jni::local_ref<JPromise::javaobject>()>("getViewCorrection");
|
|
@@ -94,14 +94,30 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
94
94
|
void setTaskProcessorThreads(std::optional<double> taskProcessorThreads) override;
|
|
95
95
|
std::optional<double> getMinAltitudeAboveTerrain() override;
|
|
96
96
|
void setMinAltitudeAboveTerrain(std::optional<double> minAltitudeAboveTerrain) override;
|
|
97
|
+
std::optional<double> getMaxYawRateDegSec() override;
|
|
98
|
+
void setMaxYawRateDegSec(std::optional<double> maxYawRateDegSec) override;
|
|
99
|
+
std::optional<double> getMaxPitchRateDegSec() override;
|
|
100
|
+
void setMaxPitchRateDegSec(std::optional<double> maxPitchRateDegSec) override;
|
|
101
|
+
std::optional<double> getMaxRollRateDegSec() override;
|
|
102
|
+
void setMaxRollRateDegSec(std::optional<double> maxRollRateDegSec) override;
|
|
103
|
+
std::optional<double> getMaxClimbRateMps() override;
|
|
104
|
+
void setMaxClimbRateMps(std::optional<double> maxClimbRateMps) override;
|
|
105
|
+
std::optional<double> getMaxGroundSpeedMps() override;
|
|
106
|
+
void setMaxGroundSpeedMps(std::optional<double> maxGroundSpeedMps) override;
|
|
97
107
|
std::optional<std::function<void(const CesiumMetrics& /* metrics */)>> getOnMetrics() override;
|
|
98
108
|
void setOnMetrics(const std::optional<std::function<void(const CesiumMetrics& /* metrics */)>>& onMetrics) override;
|
|
99
109
|
|
|
100
110
|
public:
|
|
101
111
|
// Methods
|
|
102
|
-
|
|
103
|
-
void
|
|
104
|
-
void
|
|
112
|
+
void setPosition(double latitude, double longitude) override;
|
|
113
|
+
void setAltitude(double altitudeMeters) override;
|
|
114
|
+
void setHeading(double headingDeg) override;
|
|
115
|
+
void setAttitude(double pitchDeg, double rollDeg) override;
|
|
116
|
+
void setViewCorrection(const Quaternion& q) override;
|
|
117
|
+
void setVerticalFov(double deg) override;
|
|
118
|
+
void teleport(const CameraState& camera) override;
|
|
119
|
+
std::shared_ptr<Promise<CameraState>> getActualCamera() override;
|
|
120
|
+
std::shared_ptr<Promise<CameraState>> getDemandCamera() override;
|
|
105
121
|
std::shared_ptr<Promise<Quaternion>> getViewCorrection() override;
|
|
106
122
|
|
|
107
123
|
private:
|
|
@@ -125,6 +125,26 @@ void JHybridCesiumViewStateUpdater::updateViewProps(jni::alias_ref<jni::JClass>
|
|
|
125
125
|
hybridView->setMinAltitudeAboveTerrain(props->minAltitudeAboveTerrain.value);
|
|
126
126
|
props->minAltitudeAboveTerrain.isDirty = false;
|
|
127
127
|
}
|
|
128
|
+
if (props->maxYawRateDegSec.isDirty) {
|
|
129
|
+
hybridView->setMaxYawRateDegSec(props->maxYawRateDegSec.value);
|
|
130
|
+
props->maxYawRateDegSec.isDirty = false;
|
|
131
|
+
}
|
|
132
|
+
if (props->maxPitchRateDegSec.isDirty) {
|
|
133
|
+
hybridView->setMaxPitchRateDegSec(props->maxPitchRateDegSec.value);
|
|
134
|
+
props->maxPitchRateDegSec.isDirty = false;
|
|
135
|
+
}
|
|
136
|
+
if (props->maxRollRateDegSec.isDirty) {
|
|
137
|
+
hybridView->setMaxRollRateDegSec(props->maxRollRateDegSec.value);
|
|
138
|
+
props->maxRollRateDegSec.isDirty = false;
|
|
139
|
+
}
|
|
140
|
+
if (props->maxClimbRateMps.isDirty) {
|
|
141
|
+
hybridView->setMaxClimbRateMps(props->maxClimbRateMps.value);
|
|
142
|
+
props->maxClimbRateMps.isDirty = false;
|
|
143
|
+
}
|
|
144
|
+
if (props->maxGroundSpeedMps.isDirty) {
|
|
145
|
+
hybridView->setMaxGroundSpeedMps(props->maxGroundSpeedMps.value);
|
|
146
|
+
props->maxGroundSpeedMps.isDirty = false;
|
|
147
|
+
}
|
|
128
148
|
if (props->onMetrics.isDirty) {
|
|
129
149
|
hybridView->setOnMetrics(props->onMetrics.value);
|
|
130
150
|
props->onMetrics.isDirty = false;
|
|
@@ -159,6 +159,36 @@ abstract class HybridCesiumViewSpec: HybridView() {
|
|
|
159
159
|
@set:Keep
|
|
160
160
|
abstract var minAltitudeAboveTerrain: Double?
|
|
161
161
|
|
|
162
|
+
@get:DoNotStrip
|
|
163
|
+
@get:Keep
|
|
164
|
+
@set:DoNotStrip
|
|
165
|
+
@set:Keep
|
|
166
|
+
abstract var maxYawRateDegSec: Double?
|
|
167
|
+
|
|
168
|
+
@get:DoNotStrip
|
|
169
|
+
@get:Keep
|
|
170
|
+
@set:DoNotStrip
|
|
171
|
+
@set:Keep
|
|
172
|
+
abstract var maxPitchRateDegSec: Double?
|
|
173
|
+
|
|
174
|
+
@get:DoNotStrip
|
|
175
|
+
@get:Keep
|
|
176
|
+
@set:DoNotStrip
|
|
177
|
+
@set:Keep
|
|
178
|
+
abstract var maxRollRateDegSec: Double?
|
|
179
|
+
|
|
180
|
+
@get:DoNotStrip
|
|
181
|
+
@get:Keep
|
|
182
|
+
@set:DoNotStrip
|
|
183
|
+
@set:Keep
|
|
184
|
+
abstract var maxClimbRateMps: Double?
|
|
185
|
+
|
|
186
|
+
@get:DoNotStrip
|
|
187
|
+
@get:Keep
|
|
188
|
+
@set:DoNotStrip
|
|
189
|
+
@set:Keep
|
|
190
|
+
abstract var maxGroundSpeedMps: Double?
|
|
191
|
+
|
|
162
192
|
abstract var onMetrics: ((metrics: CesiumMetrics) -> Unit)?
|
|
163
193
|
|
|
164
194
|
private var onMetrics_cxx: Func_void_CesiumMetrics?
|
|
@@ -176,15 +206,39 @@ abstract class HybridCesiumViewSpec: HybridView() {
|
|
|
176
206
|
// Methods
|
|
177
207
|
@DoNotStrip
|
|
178
208
|
@Keep
|
|
179
|
-
abstract fun
|
|
209
|
+
abstract fun setPosition(latitude: Double, longitude: Double): Unit
|
|
210
|
+
|
|
211
|
+
@DoNotStrip
|
|
212
|
+
@Keep
|
|
213
|
+
abstract fun setAltitude(altitudeMeters: Double): Unit
|
|
214
|
+
|
|
215
|
+
@DoNotStrip
|
|
216
|
+
@Keep
|
|
217
|
+
abstract fun setHeading(headingDeg: Double): Unit
|
|
218
|
+
|
|
219
|
+
@DoNotStrip
|
|
220
|
+
@Keep
|
|
221
|
+
abstract fun setAttitude(pitchDeg: Double, rollDeg: Double): Unit
|
|
222
|
+
|
|
223
|
+
@DoNotStrip
|
|
224
|
+
@Keep
|
|
225
|
+
abstract fun setViewCorrection(q: Quaternion): Unit
|
|
226
|
+
|
|
227
|
+
@DoNotStrip
|
|
228
|
+
@Keep
|
|
229
|
+
abstract fun setVerticalFov(deg: Double): Unit
|
|
230
|
+
|
|
231
|
+
@DoNotStrip
|
|
232
|
+
@Keep
|
|
233
|
+
abstract fun teleport(camera: CameraState): Unit
|
|
180
234
|
|
|
181
235
|
@DoNotStrip
|
|
182
236
|
@Keep
|
|
183
|
-
abstract fun
|
|
237
|
+
abstract fun getActualCamera(): Promise<CameraState>
|
|
184
238
|
|
|
185
239
|
@DoNotStrip
|
|
186
240
|
@Keep
|
|
187
|
-
abstract fun
|
|
241
|
+
abstract fun getDemandCamera(): Promise<CameraState>
|
|
188
242
|
|
|
189
243
|
@DoNotStrip
|
|
190
244
|
@Keep
|
|
@@ -210,15 +210,6 @@ namespace margelo::nitro::reactnativecesium::bridge::swift {
|
|
|
210
210
|
using std__weak_ptr_HybridCesiumViewSpec_ = std::weak_ptr<HybridCesiumViewSpec>;
|
|
211
211
|
inline std__weak_ptr_HybridCesiumViewSpec_ weakify_std__shared_ptr_HybridCesiumViewSpec_(const std::shared_ptr<HybridCesiumViewSpec>& strong) noexcept { return strong; }
|
|
212
212
|
|
|
213
|
-
// pragma MARK: Result<std::shared_ptr<Promise<CameraState>>>
|
|
214
|
-
using Result_std__shared_ptr_Promise_CameraState___ = Result<std::shared_ptr<Promise<CameraState>>>;
|
|
215
|
-
inline Result_std__shared_ptr_Promise_CameraState___ create_Result_std__shared_ptr_Promise_CameraState___(const std::shared_ptr<Promise<CameraState>>& value) noexcept {
|
|
216
|
-
return Result<std::shared_ptr<Promise<CameraState>>>::withValue(value);
|
|
217
|
-
}
|
|
218
|
-
inline Result_std__shared_ptr_Promise_CameraState___ create_Result_std__shared_ptr_Promise_CameraState___(const std::exception_ptr& error) noexcept {
|
|
219
|
-
return Result<std::shared_ptr<Promise<CameraState>>>::withError(error);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
213
|
// pragma MARK: Result<void>
|
|
223
214
|
using Result_void_ = Result<void>;
|
|
224
215
|
inline Result_void_ create_Result_void_() noexcept {
|
|
@@ -228,6 +219,15 @@ namespace margelo::nitro::reactnativecesium::bridge::swift {
|
|
|
228
219
|
return Result<void>::withError(error);
|
|
229
220
|
}
|
|
230
221
|
|
|
222
|
+
// pragma MARK: Result<std::shared_ptr<Promise<CameraState>>>
|
|
223
|
+
using Result_std__shared_ptr_Promise_CameraState___ = Result<std::shared_ptr<Promise<CameraState>>>;
|
|
224
|
+
inline Result_std__shared_ptr_Promise_CameraState___ create_Result_std__shared_ptr_Promise_CameraState___(const std::shared_ptr<Promise<CameraState>>& value) noexcept {
|
|
225
|
+
return Result<std::shared_ptr<Promise<CameraState>>>::withValue(value);
|
|
226
|
+
}
|
|
227
|
+
inline Result_std__shared_ptr_Promise_CameraState___ create_Result_std__shared_ptr_Promise_CameraState___(const std::exception_ptr& error) noexcept {
|
|
228
|
+
return Result<std::shared_ptr<Promise<CameraState>>>::withError(error);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
231
|
// pragma MARK: Result<std::shared_ptr<Promise<Quaternion>>>
|
|
232
232
|
using Result_std__shared_ptr_Promise_Quaternion___ = Result<std::shared_ptr<Promise<Quaternion>>>;
|
|
233
233
|
inline Result_std__shared_ptr_Promise_Quaternion___ create_Result_std__shared_ptr_Promise_Quaternion___(const std::shared_ptr<Promise<Quaternion>>& value) noexcept {
|
|
@@ -24,8 +24,8 @@ namespace margelo::nitro::reactnativecesium { struct Quaternion; }
|
|
|
24
24
|
#include <optional>
|
|
25
25
|
#include "CesiumMetrics.hpp"
|
|
26
26
|
#include <functional>
|
|
27
|
-
#include <NitroModules/Promise.hpp>
|
|
28
27
|
#include "Quaternion.hpp"
|
|
28
|
+
#include <NitroModules/Promise.hpp>
|
|
29
29
|
|
|
30
30
|
#include "ReactNativeCesium-Swift-Cxx-Umbrella.hpp"
|
|
31
31
|
|
|
@@ -219,6 +219,41 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
219
219
|
inline void setMinAltitudeAboveTerrain(std::optional<double> minAltitudeAboveTerrain) noexcept override {
|
|
220
220
|
_swiftPart.setMinAltitudeAboveTerrain(minAltitudeAboveTerrain);
|
|
221
221
|
}
|
|
222
|
+
inline std::optional<double> getMaxYawRateDegSec() noexcept override {
|
|
223
|
+
auto __result = _swiftPart.getMaxYawRateDegSec();
|
|
224
|
+
return __result;
|
|
225
|
+
}
|
|
226
|
+
inline void setMaxYawRateDegSec(std::optional<double> maxYawRateDegSec) noexcept override {
|
|
227
|
+
_swiftPart.setMaxYawRateDegSec(maxYawRateDegSec);
|
|
228
|
+
}
|
|
229
|
+
inline std::optional<double> getMaxPitchRateDegSec() noexcept override {
|
|
230
|
+
auto __result = _swiftPart.getMaxPitchRateDegSec();
|
|
231
|
+
return __result;
|
|
232
|
+
}
|
|
233
|
+
inline void setMaxPitchRateDegSec(std::optional<double> maxPitchRateDegSec) noexcept override {
|
|
234
|
+
_swiftPart.setMaxPitchRateDegSec(maxPitchRateDegSec);
|
|
235
|
+
}
|
|
236
|
+
inline std::optional<double> getMaxRollRateDegSec() noexcept override {
|
|
237
|
+
auto __result = _swiftPart.getMaxRollRateDegSec();
|
|
238
|
+
return __result;
|
|
239
|
+
}
|
|
240
|
+
inline void setMaxRollRateDegSec(std::optional<double> maxRollRateDegSec) noexcept override {
|
|
241
|
+
_swiftPart.setMaxRollRateDegSec(maxRollRateDegSec);
|
|
242
|
+
}
|
|
243
|
+
inline std::optional<double> getMaxClimbRateMps() noexcept override {
|
|
244
|
+
auto __result = _swiftPart.getMaxClimbRateMps();
|
|
245
|
+
return __result;
|
|
246
|
+
}
|
|
247
|
+
inline void setMaxClimbRateMps(std::optional<double> maxClimbRateMps) noexcept override {
|
|
248
|
+
_swiftPart.setMaxClimbRateMps(maxClimbRateMps);
|
|
249
|
+
}
|
|
250
|
+
inline std::optional<double> getMaxGroundSpeedMps() noexcept override {
|
|
251
|
+
auto __result = _swiftPart.getMaxGroundSpeedMps();
|
|
252
|
+
return __result;
|
|
253
|
+
}
|
|
254
|
+
inline void setMaxGroundSpeedMps(std::optional<double> maxGroundSpeedMps) noexcept override {
|
|
255
|
+
_swiftPart.setMaxGroundSpeedMps(maxGroundSpeedMps);
|
|
256
|
+
}
|
|
222
257
|
inline std::optional<std::function<void(const CesiumMetrics& /* metrics */)>> getOnMetrics() noexcept override {
|
|
223
258
|
auto __result = _swiftPart.getOnMetrics();
|
|
224
259
|
return __result;
|
|
@@ -229,26 +264,64 @@ namespace margelo::nitro::reactnativecesium {
|
|
|
229
264
|
|
|
230
265
|
public:
|
|
231
266
|
// Methods
|
|
232
|
-
inline
|
|
233
|
-
auto __result = _swiftPart.
|
|
267
|
+
inline void setPosition(double latitude, double longitude) override {
|
|
268
|
+
auto __result = _swiftPart.setPosition(std::forward<decltype(latitude)>(latitude), std::forward<decltype(longitude)>(longitude));
|
|
269
|
+
if (__result.hasError()) [[unlikely]] {
|
|
270
|
+
std::rethrow_exception(__result.error());
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
inline void setAltitude(double altitudeMeters) override {
|
|
274
|
+
auto __result = _swiftPart.setAltitude(std::forward<decltype(altitudeMeters)>(altitudeMeters));
|
|
234
275
|
if (__result.hasError()) [[unlikely]] {
|
|
235
276
|
std::rethrow_exception(__result.error());
|
|
236
277
|
}
|
|
237
|
-
auto __value = std::move(__result.value());
|
|
238
|
-
return __value;
|
|
239
278
|
}
|
|
240
|
-
inline void
|
|
241
|
-
auto __result = _swiftPart.
|
|
279
|
+
inline void setHeading(double headingDeg) override {
|
|
280
|
+
auto __result = _swiftPart.setHeading(std::forward<decltype(headingDeg)>(headingDeg));
|
|
242
281
|
if (__result.hasError()) [[unlikely]] {
|
|
243
282
|
std::rethrow_exception(__result.error());
|
|
244
283
|
}
|
|
245
284
|
}
|
|
246
|
-
inline void
|
|
247
|
-
auto __result = _swiftPart.
|
|
285
|
+
inline void setAttitude(double pitchDeg, double rollDeg) override {
|
|
286
|
+
auto __result = _swiftPart.setAttitude(std::forward<decltype(pitchDeg)>(pitchDeg), std::forward<decltype(rollDeg)>(rollDeg));
|
|
248
287
|
if (__result.hasError()) [[unlikely]] {
|
|
249
288
|
std::rethrow_exception(__result.error());
|
|
250
289
|
}
|
|
251
290
|
}
|
|
291
|
+
inline void setViewCorrection(const Quaternion& q) override {
|
|
292
|
+
auto __result = _swiftPart.setViewCorrection(std::forward<decltype(q)>(q));
|
|
293
|
+
if (__result.hasError()) [[unlikely]] {
|
|
294
|
+
std::rethrow_exception(__result.error());
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
inline void setVerticalFov(double deg) override {
|
|
298
|
+
auto __result = _swiftPart.setVerticalFov(std::forward<decltype(deg)>(deg));
|
|
299
|
+
if (__result.hasError()) [[unlikely]] {
|
|
300
|
+
std::rethrow_exception(__result.error());
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
inline void teleport(const CameraState& camera) override {
|
|
304
|
+
auto __result = _swiftPart.teleport(std::forward<decltype(camera)>(camera));
|
|
305
|
+
if (__result.hasError()) [[unlikely]] {
|
|
306
|
+
std::rethrow_exception(__result.error());
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
inline std::shared_ptr<Promise<CameraState>> getActualCamera() override {
|
|
310
|
+
auto __result = _swiftPart.getActualCamera();
|
|
311
|
+
if (__result.hasError()) [[unlikely]] {
|
|
312
|
+
std::rethrow_exception(__result.error());
|
|
313
|
+
}
|
|
314
|
+
auto __value = std::move(__result.value());
|
|
315
|
+
return __value;
|
|
316
|
+
}
|
|
317
|
+
inline std::shared_ptr<Promise<CameraState>> getDemandCamera() override {
|
|
318
|
+
auto __result = _swiftPart.getDemandCamera();
|
|
319
|
+
if (__result.hasError()) [[unlikely]] {
|
|
320
|
+
std::rethrow_exception(__result.error());
|
|
321
|
+
}
|
|
322
|
+
auto __value = std::move(__result.value());
|
|
323
|
+
return __value;
|
|
324
|
+
}
|
|
252
325
|
inline std::shared_ptr<Promise<Quaternion>> getViewCorrection() override {
|
|
253
326
|
auto __result = _swiftPart.getViewCorrection();
|
|
254
327
|
if (__result.hasError()) [[unlikely]] {
|
|
@@ -189,6 +189,31 @@ using namespace margelo::nitro::reactnativecesium::views;
|
|
|
189
189
|
swiftPart.setMinAltitudeAboveTerrain(newViewProps.minAltitudeAboveTerrain.value);
|
|
190
190
|
newViewProps.minAltitudeAboveTerrain.isDirty = false;
|
|
191
191
|
}
|
|
192
|
+
// maxYawRateDegSec: optional
|
|
193
|
+
if (newViewProps.maxYawRateDegSec.isDirty) {
|
|
194
|
+
swiftPart.setMaxYawRateDegSec(newViewProps.maxYawRateDegSec.value);
|
|
195
|
+
newViewProps.maxYawRateDegSec.isDirty = false;
|
|
196
|
+
}
|
|
197
|
+
// maxPitchRateDegSec: optional
|
|
198
|
+
if (newViewProps.maxPitchRateDegSec.isDirty) {
|
|
199
|
+
swiftPart.setMaxPitchRateDegSec(newViewProps.maxPitchRateDegSec.value);
|
|
200
|
+
newViewProps.maxPitchRateDegSec.isDirty = false;
|
|
201
|
+
}
|
|
202
|
+
// maxRollRateDegSec: optional
|
|
203
|
+
if (newViewProps.maxRollRateDegSec.isDirty) {
|
|
204
|
+
swiftPart.setMaxRollRateDegSec(newViewProps.maxRollRateDegSec.value);
|
|
205
|
+
newViewProps.maxRollRateDegSec.isDirty = false;
|
|
206
|
+
}
|
|
207
|
+
// maxClimbRateMps: optional
|
|
208
|
+
if (newViewProps.maxClimbRateMps.isDirty) {
|
|
209
|
+
swiftPart.setMaxClimbRateMps(newViewProps.maxClimbRateMps.value);
|
|
210
|
+
newViewProps.maxClimbRateMps.isDirty = false;
|
|
211
|
+
}
|
|
212
|
+
// maxGroundSpeedMps: optional
|
|
213
|
+
if (newViewProps.maxGroundSpeedMps.isDirty) {
|
|
214
|
+
swiftPart.setMaxGroundSpeedMps(newViewProps.maxGroundSpeedMps.value);
|
|
215
|
+
newViewProps.maxGroundSpeedMps.isDirty = false;
|
|
216
|
+
}
|
|
192
217
|
// onMetrics: optional
|
|
193
218
|
if (newViewProps.onMetrics.isDirty) {
|
|
194
219
|
swiftPart.setOnMetrics(newViewProps.onMetrics.value);
|
|
@@ -32,12 +32,23 @@ public protocol HybridCesiumViewSpec_protocol: HybridObject, HybridView {
|
|
|
32
32
|
var sqliteCacheMaxRows: Double? { get set }
|
|
33
33
|
var taskProcessorThreads: Double? { get set }
|
|
34
34
|
var minAltitudeAboveTerrain: Double? { get set }
|
|
35
|
+
var maxYawRateDegSec: Double? { get set }
|
|
36
|
+
var maxPitchRateDegSec: Double? { get set }
|
|
37
|
+
var maxRollRateDegSec: Double? { get set }
|
|
38
|
+
var maxClimbRateMps: Double? { get set }
|
|
39
|
+
var maxGroundSpeedMps: Double? { get set }
|
|
35
40
|
var onMetrics: ((_ metrics: CesiumMetrics) -> Void)? { get set }
|
|
36
41
|
|
|
37
42
|
// Methods
|
|
38
|
-
func
|
|
39
|
-
func
|
|
40
|
-
func
|
|
43
|
+
func setPosition(latitude: Double, longitude: Double) throws -> Void
|
|
44
|
+
func setAltitude(altitudeMeters: Double) throws -> Void
|
|
45
|
+
func setHeading(headingDeg: Double) throws -> Void
|
|
46
|
+
func setAttitude(pitchDeg: Double, rollDeg: Double) throws -> Void
|
|
47
|
+
func setViewCorrection(q: Quaternion) throws -> Void
|
|
48
|
+
func setVerticalFov(deg: Double) throws -> Void
|
|
49
|
+
func teleport(camera: CameraState) throws -> Void
|
|
50
|
+
func getActualCamera() throws -> Promise<CameraState>
|
|
51
|
+
func getDemandCamera() throws -> Promise<CameraState>
|
|
41
52
|
func getViewCorrection() throws -> Promise<Quaternion>
|
|
42
53
|
}
|
|
43
54
|
|