@nayan-ui/engine 1.0.0-beta.4 → 1.0.0-beta.6
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 +225 -116
- package/lib/module/assets/ProceduralCache.js +5 -0
- package/lib/module/assets/loft.js +15 -63
- package/lib/module/assets/procedural.js +500 -0
- package/lib/module/assets/shape.js +147 -245
- package/lib/module/assets/texture.js +65 -0
- package/lib/module/drawing/DrawingDocument.js +1 -1
- package/lib/module/index.js +4 -1
- package/lib/module/media/audio-worklet.js +27 -0
- package/lib/module/media/audio.js +20 -0
- package/lib/module/media/input.web.js +107 -0
- package/lib/module/media/microphone.js +89 -0
- package/lib/module/media/speech.js +80 -0
- package/lib/module/media/speechPlatform.js +12 -0
- package/lib/module/media/speechPlatform.web.js +16 -0
- package/lib/module/native/BrowserEngine.js +122 -0
- package/lib/module/native/NativeNayanEngine.web.js +2 -0
- package/lib/module/render/GameView.js +45 -13
- package/lib/module/render/quality.js +151 -17
- package/lib/module/world/World.js +63 -0
- package/lib/typescript/src/assets/ProceduralCache.d.ts +2 -0
- package/lib/typescript/src/assets/loft.d.ts +3 -1
- package/lib/typescript/src/assets/procedural.d.ts +394 -0
- package/lib/typescript/src/assets/shape.d.ts +13 -7
- package/lib/typescript/src/assets/texture.d.ts +63 -0
- package/lib/typescript/src/index.d.ts +8 -2
- package/lib/typescript/src/media/audio.d.ts +13 -0
- package/lib/typescript/src/media/input.web.d.ts +4 -0
- package/lib/typescript/src/media/microphone.d.ts +51 -0
- package/lib/typescript/src/media/speech.d.ts +38 -0
- package/lib/typescript/src/media/speechPlatform.d.ts +5 -0
- package/lib/typescript/src/media/speechPlatform.web.d.ts +5 -0
- package/lib/typescript/src/native/EngineBridge.d.ts +7 -1
- package/lib/typescript/src/native/spec/NativeNayanEngine.d.ts +72 -0
- package/lib/typescript/src/render/GameView.d.ts +30 -3
- package/lib/typescript/src/render/quality.d.ts +54 -2
- package/lib/typescript/src/types.d.ts +9 -2
- package/lib/typescript/src/world/World.d.ts +16 -0
- package/lib/typescript/src/world/types.d.ts +8 -0
- package/lib/web/audio-worklet.js +27 -0
- package/lib/web/engine_core_bg.wasm +0 -0
- package/lib/web/index.js +1181 -422
- package/lib/web/types/src/assets/ProceduralCache.d.ts +2 -0
- package/lib/web/types/src/assets/loft.d.ts +3 -1
- package/lib/web/types/src/assets/procedural.d.ts +393 -0
- package/lib/web/types/src/assets/shape.d.ts +13 -7
- package/lib/web/types/src/assets/texture.d.ts +63 -0
- package/lib/web/types/src/index.d.ts +8 -2
- package/lib/web/types/src/media/audio.d.ts +13 -0
- package/lib/web/types/src/media/input.d.ts +3 -0
- package/lib/web/types/src/media/microphone.d.ts +50 -0
- package/lib/web/types/src/media/speech.d.ts +37 -0
- package/lib/web/types/src/media/speechPlatform.d.ts +4 -0
- package/lib/web/types/src/native/EngineBridge.d.ts +7 -1
- package/lib/web/types/src/native/spec/NativeNayanEngine.d.ts +72 -0
- package/lib/web/types/src/render/GameView.d.ts +30 -3
- package/lib/web/types/src/render/quality.d.ts +54 -2
- package/lib/web/types/src/types.d.ts +9 -2
- package/lib/web/types/src/world/World.d.ts +16 -0
- package/lib/web/types/src/world/types.d.ts +8 -0
- package/native/android/src/main/AndroidManifest.xml +10 -0
- package/native/android/src/main/java/com/nayanui/engine/EngineMicrophone.java +60 -0
- package/native/android/src/main/java/com/nayanui/engine/EngineSpeech.java +28 -0
- package/native/android/src/main/java/com/nayanui/engine/EngineSurfaceView.java +1 -0
- package/native/android/src/main/java/com/nayanui/engine/NayanEnginePackage.java +2 -0
- package/native/core/build/EngineCore.xcframework/ios-arm64/libengine_core.a +0 -0
- package/native/core/build/EngineCore.xcframework/ios-arm64-simulator/libengine_core.a +0 -0
- package/native/core/build/android/arm64-v8a/libengine_core.a +0 -0
- package/native/core/build/android/armeabi-v7a/libengine_core.a +0 -0
- package/native/core/build/android/x86/libengine_core.a +0 -0
- package/native/core/build/android/x86_64/libengine_core.a +0 -0
- package/native/core/include/engine_core.h +63 -1
- package/native/cpp/NayanEngineModule.cpp +296 -0
- package/native/cpp/NayanEngineModule.h +40 -0
- package/native/cpp/generated/NayanEngineSpecJSI.h +397 -0
- package/package.json +1 -1
- package/src/native/spec/NativeNayanEngine.ts +77 -0
|
@@ -22,6 +22,7 @@ public:
|
|
|
22
22
|
|
|
23
23
|
protected:
|
|
24
24
|
NativeNayanEngineCxxSpec(std::shared_ptr<CallInvoker> jsInvoker) : TurboModule(std::string{NativeNayanEngineCxxSpec::kModuleName}, jsInvoker) {
|
|
25
|
+
methodMap_["speechRequest"] = MethodMetadata {.argCount = 1, .invoker = __speechRequest};
|
|
25
26
|
methodMap_["createWorld"] = MethodMetadata {.argCount = 1, .invoker = __createWorld};
|
|
26
27
|
methodMap_["destroyWorld"] = MethodMetadata {.argCount = 1, .invoker = __destroyWorld};
|
|
27
28
|
methodMap_["spawnDesc"] = MethodMetadata {.argCount = 2, .invoker = __spawnDesc};
|
|
@@ -74,6 +75,8 @@ protected:
|
|
|
74
75
|
methodMap_["modelVertices"] = MethodMetadata {.argCount = 1, .invoker = __modelVertices};
|
|
75
76
|
methodMap_["modelIndices"] = MethodMetadata {.argCount = 1, .invoker = __modelIndices};
|
|
76
77
|
methodMap_["modelSize"] = MethodMetadata {.argCount = 1, .invoker = __modelSize};
|
|
78
|
+
methodMap_["modelBake"] = MethodMetadata {.argCount = 2, .invoker = __modelBake};
|
|
79
|
+
methodMap_["bakeKept"] = MethodMetadata {.argCount = 1, .invoker = __bakeKept};
|
|
77
80
|
methodMap_["modelTexture"] = MethodMetadata {.argCount = 1, .invoker = __modelTexture};
|
|
78
81
|
methodMap_["meshAlias"] = MethodMetadata {.argCount = 1, .invoker = __meshAlias};
|
|
79
82
|
methodMap_["meshCreate"] = MethodMetadata {.argCount = 2, .invoker = __meshCreate};
|
|
@@ -104,6 +107,7 @@ protected:
|
|
|
104
107
|
methodMap_["startFrames"] = MethodMetadata {.argCount = 2, .invoker = __startFrames};
|
|
105
108
|
methodMap_["stopFrames"] = MethodMetadata {.argCount = 1, .invoker = __stopFrames};
|
|
106
109
|
methodMap_["renderOverlay"] = MethodMetadata {.argCount = 8, .invoker = __renderOverlay};
|
|
110
|
+
methodMap_["renderBackdrop"] = MethodMetadata {.argCount = 6, .invoker = __renderBackdrop};
|
|
107
111
|
methodMap_["renderError"] = MethodMetadata {.argCount = 0, .invoker = __renderError};
|
|
108
112
|
methodMap_["renderBackend"] = MethodMetadata {.argCount = 0, .invoker = __renderBackend};
|
|
109
113
|
methodMap_["drawingCreate"] = MethodMetadata {.argCount = 3, .invoker = __drawingCreate};
|
|
@@ -116,11 +120,54 @@ protected:
|
|
|
116
120
|
methodMap_["audioSetVolume"] = MethodMetadata {.argCount = 1, .invoker = __audioSetVolume};
|
|
117
121
|
methodMap_["audioSetMuted"] = MethodMetadata {.argCount = 1, .invoker = __audioSetMuted};
|
|
118
122
|
methodMap_["audioIsRunning"] = MethodMetadata {.argCount = 0, .invoker = __audioIsRunning};
|
|
123
|
+
methodMap_["audioRelease"] = MethodMetadata {.argCount = 1, .invoker = __audioRelease};
|
|
124
|
+
methodMap_["audioDuration"] = MethodMetadata {.argCount = 1, .invoker = __audioDuration};
|
|
125
|
+
methodMap_["audioLevels"] = MethodMetadata {.argCount = 2, .invoker = __audioLevels};
|
|
126
|
+
methodMap_["micPermission"] = MethodMetadata {.argCount = 0, .invoker = __micPermission};
|
|
127
|
+
methodMap_["micRequestPermission"] = MethodMetadata {.argCount = 0, .invoker = __micRequestPermission};
|
|
128
|
+
methodMap_["micStart"] = MethodMetadata {.argCount = 1, .invoker = __micStart};
|
|
129
|
+
methodMap_["micStop"] = MethodMetadata {.argCount = 0, .invoker = __micStop};
|
|
130
|
+
methodMap_["micState"] = MethodMetadata {.argCount = 0, .invoker = __micState};
|
|
131
|
+
methodMap_["micLevel"] = MethodMetadata {.argCount = 0, .invoker = __micLevel};
|
|
132
|
+
methodMap_["micHeld"] = MethodMetadata {.argCount = 0, .invoker = __micHeld};
|
|
133
|
+
methodMap_["micTake"] = MethodMetadata {.argCount = 2, .invoker = __micTake};
|
|
119
134
|
methodMap_["hapticsSupported"] = MethodMetadata {.argCount = 0, .invoker = __hapticsSupported};
|
|
120
135
|
methodMap_["hapticsPlay"] = MethodMetadata {.argCount = 2, .invoker = __hapticsPlay};
|
|
136
|
+
methodMap_["worldgenBuild"] = MethodMetadata {.argCount = 3, .invoker = __worldgenBuild};
|
|
137
|
+
methodMap_["worldgenBuildAsync"] = MethodMetadata {.argCount = 3, .invoker = __worldgenBuildAsync};
|
|
138
|
+
methodMap_["worldgenError"] = MethodMetadata {.argCount = 0, .invoker = __worldgenError};
|
|
139
|
+
methodMap_["worldgenKept"] = MethodMetadata {.argCount = 1, .invoker = __worldgenKept};
|
|
140
|
+
methodMap_["worldgenFree"] = MethodMetadata {.argCount = 1, .invoker = __worldgenFree};
|
|
141
|
+
methodMap_["worldgenInfo"] = MethodMetadata {.argCount = 1, .invoker = __worldgenInfo};
|
|
142
|
+
methodMap_["worldgenLayer"] = MethodMetadata {.argCount = 2, .invoker = __worldgenLayer};
|
|
143
|
+
methodMap_["worldgenReachable"] = MethodMetadata {.argCount = 1, .invoker = __worldgenReachable};
|
|
144
|
+
methodMap_["worldgenOverview"] = MethodMetadata {.argCount = 1, .invoker = __worldgenOverview};
|
|
145
|
+
methodMap_["worldgenPick"] = MethodMetadata {.argCount = 2, .invoker = __worldgenPick};
|
|
146
|
+
methodMap_["worldgenTerrain"] = MethodMetadata {.argCount = 2, .invoker = __worldgenTerrain};
|
|
147
|
+
methodMap_["worldgenMesh"] = MethodMetadata {.argCount = 1, .invoker = __worldgenMesh};
|
|
148
|
+
methodMap_["worldgenPaint"] = MethodMetadata {.argCount = 2, .invoker = __worldgenPaint};
|
|
149
|
+
methodMap_["worldgenGround"] = MethodMetadata {.argCount = 3, .invoker = __worldgenGround};
|
|
150
|
+
methodMap_["worldgenSurface"] = MethodMetadata {.argCount = 3, .invoker = __worldgenSurface};
|
|
151
|
+
methodMap_["worldgenPlatform"] = MethodMetadata {.argCount = 3, .invoker = __worldgenPlatform};
|
|
152
|
+
methodMap_["worldgenWalkable"] = MethodMetadata {.argCount = 4, .invoker = __worldgenWalkable};
|
|
153
|
+
methodMap_["worldgenClearance"] = MethodMetadata {.argCount = 4, .invoker = __worldgenClearance};
|
|
154
|
+
methodMap_["worldgenSolidClearance"] = MethodMetadata {.argCount = 6, .invoker = __worldgenSolidClearance};
|
|
155
|
+
methodMap_["worldgenFieldIndex"] = MethodMetadata {.argCount = 2, .invoker = __worldgenFieldIndex};
|
|
156
|
+
methodMap_["worldgenField"] = MethodMetadata {.argCount = 4, .invoker = __worldgenField};
|
|
157
|
+
methodMap_["worldgenTilt"] = MethodMetadata {.argCount = 4, .invoker = __worldgenTilt};
|
|
158
|
+
methodMap_["worldgenSight"] = MethodMetadata {.argCount = 8, .invoker = __worldgenSight};
|
|
159
|
+
methodMap_["worldgenMove"] = MethodMetadata {.argCount = 7, .invoker = __worldgenMove};
|
|
121
160
|
}
|
|
122
161
|
|
|
123
162
|
private:
|
|
163
|
+
static jsi::Value __speechRequest(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
164
|
+
static_assert(
|
|
165
|
+
bridging::getParameterCount(&T::speechRequest) == 2,
|
|
166
|
+
"Expected speechRequest(...) to have 2 parameters");
|
|
167
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::speechRequest, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
168
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
169
|
+
}
|
|
170
|
+
|
|
124
171
|
static jsi::Value __createWorld(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
125
172
|
static_assert(
|
|
126
173
|
bridging::getParameterCount(&T::createWorld) == 2,
|
|
@@ -617,6 +664,23 @@ private:
|
|
|
617
664
|
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());
|
|
618
665
|
}
|
|
619
666
|
|
|
667
|
+
static jsi::Value __modelBake(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
668
|
+
static_assert(
|
|
669
|
+
bridging::getParameterCount(&T::modelBake) == 3,
|
|
670
|
+
"Expected modelBake(...) to have 3 parameters");
|
|
671
|
+
return bridging::callFromJs<jsi::Array>(rt, &T::modelBake, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
672
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
673
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt));
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
static jsi::Value __bakeKept(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
677
|
+
static_assert(
|
|
678
|
+
bridging::getParameterCount(&T::bakeKept) == 2,
|
|
679
|
+
"Expected bakeKept(...) to have 2 parameters");
|
|
680
|
+
return bridging::callFromJs<bool>(rt, &T::bakeKept, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
681
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
682
|
+
}
|
|
683
|
+
|
|
620
684
|
static jsi::Value __modelTexture(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
621
685
|
static_assert(
|
|
622
686
|
bridging::getParameterCount(&T::modelTexture) == 2,
|
|
@@ -906,6 +970,19 @@ private:
|
|
|
906
970
|
count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber());return jsi::Value::undefined();
|
|
907
971
|
}
|
|
908
972
|
|
|
973
|
+
static jsi::Value __renderBackdrop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
974
|
+
static_assert(
|
|
975
|
+
bridging::getParameterCount(&T::renderBackdrop) == 7,
|
|
976
|
+
"Expected renderBackdrop(...) to have 7 parameters");
|
|
977
|
+
bridging::callFromJs<void>(rt, &T::renderBackdrop, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
978
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
979
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asObject(rt),
|
|
980
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asObject(rt),
|
|
981
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asObject(rt),
|
|
982
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asObject(rt),
|
|
983
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asNumber());return jsi::Value::undefined();
|
|
984
|
+
}
|
|
985
|
+
|
|
909
986
|
static jsi::Value __renderError(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
910
987
|
static_assert(
|
|
911
988
|
bridging::getParameterCount(&T::renderError) == 1,
|
|
@@ -1006,6 +1083,90 @@ private:
|
|
|
1006
1083
|
return bridging::callFromJs<bool>(rt, &T::audioIsRunning, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
1007
1084
|
}
|
|
1008
1085
|
|
|
1086
|
+
static jsi::Value __audioRelease(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1087
|
+
static_assert(
|
|
1088
|
+
bridging::getParameterCount(&T::audioRelease) == 2,
|
|
1089
|
+
"Expected audioRelease(...) to have 2 parameters");
|
|
1090
|
+
bridging::callFromJs<void>(rt, &T::audioRelease, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1091
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());return jsi::Value::undefined();
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
static jsi::Value __audioDuration(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1095
|
+
static_assert(
|
|
1096
|
+
bridging::getParameterCount(&T::audioDuration) == 2,
|
|
1097
|
+
"Expected audioDuration(...) to have 2 parameters");
|
|
1098
|
+
return bridging::callFromJs<double>(rt, &T::audioDuration, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1099
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
static jsi::Value __audioLevels(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1103
|
+
static_assert(
|
|
1104
|
+
bridging::getParameterCount(&T::audioLevels) == 3,
|
|
1105
|
+
"Expected audioLevels(...) to have 3 parameters");
|
|
1106
|
+
return bridging::callFromJs<jsi::Object>(rt, &T::audioLevels, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1107
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1108
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber());
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
static jsi::Value __micPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1112
|
+
static_assert(
|
|
1113
|
+
bridging::getParameterCount(&T::micPermission) == 1,
|
|
1114
|
+
"Expected micPermission(...) to have 1 parameters");
|
|
1115
|
+
return bridging::callFromJs<double>(rt, &T::micPermission, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
static jsi::Value __micRequestPermission(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1119
|
+
static_assert(
|
|
1120
|
+
bridging::getParameterCount(&T::micRequestPermission) == 1,
|
|
1121
|
+
"Expected micRequestPermission(...) to have 1 parameters");
|
|
1122
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::micRequestPermission, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
static jsi::Value __micStart(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1126
|
+
static_assert(
|
|
1127
|
+
bridging::getParameterCount(&T::micStart) == 2,
|
|
1128
|
+
"Expected micStart(...) to have 2 parameters");
|
|
1129
|
+
return bridging::callFromJs<bool>(rt, &T::micStart, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1130
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
static jsi::Value __micStop(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1134
|
+
static_assert(
|
|
1135
|
+
bridging::getParameterCount(&T::micStop) == 1,
|
|
1136
|
+
"Expected micStop(...) to have 1 parameters");
|
|
1137
|
+
bridging::callFromJs<void>(rt, &T::micStop, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));return jsi::Value::undefined();
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
static jsi::Value __micState(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1141
|
+
static_assert(
|
|
1142
|
+
bridging::getParameterCount(&T::micState) == 1,
|
|
1143
|
+
"Expected micState(...) to have 1 parameters");
|
|
1144
|
+
return bridging::callFromJs<double>(rt, &T::micState, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
1145
|
+
}
|
|
1146
|
+
|
|
1147
|
+
static jsi::Value __micLevel(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1148
|
+
static_assert(
|
|
1149
|
+
bridging::getParameterCount(&T::micLevel) == 1,
|
|
1150
|
+
"Expected micLevel(...) to have 1 parameters");
|
|
1151
|
+
return bridging::callFromJs<double>(rt, &T::micLevel, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1154
|
+
static jsi::Value __micHeld(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1155
|
+
static_assert(
|
|
1156
|
+
bridging::getParameterCount(&T::micHeld) == 1,
|
|
1157
|
+
"Expected micHeld(...) to have 1 parameters");
|
|
1158
|
+
return bridging::callFromJs<double>(rt, &T::micHeld, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
static jsi::Value __micTake(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1162
|
+
static_assert(
|
|
1163
|
+
bridging::getParameterCount(&T::micTake) == 3,
|
|
1164
|
+
"Expected micTake(...) to have 3 parameters");
|
|
1165
|
+
return bridging::callFromJs<double>(rt, &T::micTake, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1166
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1167
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber());
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1009
1170
|
static jsi::Value __hapticsSupported(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1010
1171
|
static_assert(
|
|
1011
1172
|
bridging::getParameterCount(&T::hapticsSupported) == 1,
|
|
@@ -1021,6 +1182,242 @@ private:
|
|
|
1021
1182
|
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt).asArray(rt),
|
|
1022
1183
|
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asBool());return jsi::Value::undefined();
|
|
1023
1184
|
}
|
|
1185
|
+
|
|
1186
|
+
static jsi::Value __worldgenBuild(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1187
|
+
static_assert(
|
|
1188
|
+
bridging::getParameterCount(&T::worldgenBuild) == 4,
|
|
1189
|
+
"Expected worldgenBuild(...) to have 4 parameters");
|
|
1190
|
+
return bridging::callFromJs<double>(rt, &T::worldgenBuild, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1191
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
1192
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
1193
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asBool());
|
|
1194
|
+
}
|
|
1195
|
+
|
|
1196
|
+
static jsi::Value __worldgenBuildAsync(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1197
|
+
static_assert(
|
|
1198
|
+
bridging::getParameterCount(&T::worldgenBuildAsync) == 4,
|
|
1199
|
+
"Expected worldgenBuildAsync(...) to have 4 parameters");
|
|
1200
|
+
return bridging::callFromJs<jsi::Value>(rt, &T::worldgenBuildAsync, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1201
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt),
|
|
1202
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt),
|
|
1203
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asBool());
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
static jsi::Value __worldgenError(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* /*args*/, size_t /*count*/) {
|
|
1207
|
+
static_assert(
|
|
1208
|
+
bridging::getParameterCount(&T::worldgenError) == 1,
|
|
1209
|
+
"Expected worldgenError(...) to have 1 parameters");
|
|
1210
|
+
return bridging::callFromJs<jsi::String>(rt, &T::worldgenError, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule));
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
static jsi::Value __worldgenKept(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1214
|
+
static_assert(
|
|
1215
|
+
bridging::getParameterCount(&T::worldgenKept) == 2,
|
|
1216
|
+
"Expected worldgenKept(...) to have 2 parameters");
|
|
1217
|
+
return bridging::callFromJs<bool>(rt, &T::worldgenKept, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1218
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
static jsi::Value __worldgenFree(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1222
|
+
static_assert(
|
|
1223
|
+
bridging::getParameterCount(&T::worldgenFree) == 2,
|
|
1224
|
+
"Expected worldgenFree(...) to have 2 parameters");
|
|
1225
|
+
bridging::callFromJs<void>(rt, &T::worldgenFree, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1226
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());return jsi::Value::undefined();
|
|
1227
|
+
}
|
|
1228
|
+
|
|
1229
|
+
static jsi::Value __worldgenInfo(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1230
|
+
static_assert(
|
|
1231
|
+
bridging::getParameterCount(&T::worldgenInfo) == 2,
|
|
1232
|
+
"Expected worldgenInfo(...) to have 2 parameters");
|
|
1233
|
+
return bridging::callFromJs<jsi::String>(rt, &T::worldgenInfo, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1234
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());
|
|
1235
|
+
}
|
|
1236
|
+
|
|
1237
|
+
static jsi::Value __worldgenLayer(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1238
|
+
static_assert(
|
|
1239
|
+
bridging::getParameterCount(&T::worldgenLayer) == 3,
|
|
1240
|
+
"Expected worldgenLayer(...) to have 3 parameters");
|
|
1241
|
+
return bridging::callFromJs<jsi::Object>(rt, &T::worldgenLayer, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1242
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1243
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt));
|
|
1244
|
+
}
|
|
1245
|
+
|
|
1246
|
+
static jsi::Value __worldgenReachable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1247
|
+
static_assert(
|
|
1248
|
+
bridging::getParameterCount(&T::worldgenReachable) == 2,
|
|
1249
|
+
"Expected worldgenReachable(...) to have 2 parameters");
|
|
1250
|
+
return bridging::callFromJs<jsi::Object>(rt, &T::worldgenReachable, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1251
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
static jsi::Value __worldgenOverview(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1255
|
+
static_assert(
|
|
1256
|
+
bridging::getParameterCount(&T::worldgenOverview) == 2,
|
|
1257
|
+
"Expected worldgenOverview(...) to have 2 parameters");
|
|
1258
|
+
return bridging::callFromJs<jsi::Object>(rt, &T::worldgenOverview, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1259
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber());
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
static jsi::Value __worldgenPick(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1263
|
+
static_assert(
|
|
1264
|
+
bridging::getParameterCount(&T::worldgenPick) == 3,
|
|
1265
|
+
"Expected worldgenPick(...) to have 3 parameters");
|
|
1266
|
+
return bridging::callFromJs<bool>(rt, &T::worldgenPick, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1267
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1268
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber());
|
|
1269
|
+
}
|
|
1270
|
+
|
|
1271
|
+
static jsi::Value __worldgenTerrain(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1272
|
+
static_assert(
|
|
1273
|
+
bridging::getParameterCount(&T::worldgenTerrain) == 3,
|
|
1274
|
+
"Expected worldgenTerrain(...) to have 3 parameters");
|
|
1275
|
+
return bridging::callFromJs<jsi::Object>(rt, &T::worldgenTerrain, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1276
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1277
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber());
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
static jsi::Value __worldgenMesh(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1281
|
+
static_assert(
|
|
1282
|
+
bridging::getParameterCount(&T::worldgenMesh) == 2,
|
|
1283
|
+
"Expected worldgenMesh(...) to have 2 parameters");
|
|
1284
|
+
return bridging::callFromJs<jsi::Object>(rt, &T::worldgenMesh, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1285
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asString(rt));
|
|
1286
|
+
}
|
|
1287
|
+
|
|
1288
|
+
static jsi::Value __worldgenPaint(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1289
|
+
static_assert(
|
|
1290
|
+
bridging::getParameterCount(&T::worldgenPaint) == 3,
|
|
1291
|
+
"Expected worldgenPaint(...) to have 3 parameters");
|
|
1292
|
+
return bridging::callFromJs<bool>(rt, &T::worldgenPaint, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1293
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asObject(rt),
|
|
1294
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt));
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
static jsi::Value __worldgenGround(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1298
|
+
static_assert(
|
|
1299
|
+
bridging::getParameterCount(&T::worldgenGround) == 4,
|
|
1300
|
+
"Expected worldgenGround(...) to have 4 parameters");
|
|
1301
|
+
return bridging::callFromJs<double>(rt, &T::worldgenGround, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1302
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1303
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1304
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber());
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
static jsi::Value __worldgenSurface(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1308
|
+
static_assert(
|
|
1309
|
+
bridging::getParameterCount(&T::worldgenSurface) == 4,
|
|
1310
|
+
"Expected worldgenSurface(...) to have 4 parameters");
|
|
1311
|
+
return bridging::callFromJs<double>(rt, &T::worldgenSurface, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1312
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1313
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1314
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber());
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
static jsi::Value __worldgenPlatform(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1318
|
+
static_assert(
|
|
1319
|
+
bridging::getParameterCount(&T::worldgenPlatform) == 4,
|
|
1320
|
+
"Expected worldgenPlatform(...) to have 4 parameters");
|
|
1321
|
+
return bridging::callFromJs<double>(rt, &T::worldgenPlatform, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1322
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1323
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1324
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber());
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
static jsi::Value __worldgenWalkable(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1328
|
+
static_assert(
|
|
1329
|
+
bridging::getParameterCount(&T::worldgenWalkable) == 5,
|
|
1330
|
+
"Expected worldgenWalkable(...) to have 5 parameters");
|
|
1331
|
+
return bridging::callFromJs<bool>(rt, &T::worldgenWalkable, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1332
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1333
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1334
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
1335
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber());
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
static jsi::Value __worldgenClearance(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1339
|
+
static_assert(
|
|
1340
|
+
bridging::getParameterCount(&T::worldgenClearance) == 5,
|
|
1341
|
+
"Expected worldgenClearance(...) to have 5 parameters");
|
|
1342
|
+
return bridging::callFromJs<double>(rt, &T::worldgenClearance, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1343
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1344
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1345
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
1346
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber());
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1349
|
+
static jsi::Value __worldgenSolidClearance(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1350
|
+
static_assert(
|
|
1351
|
+
bridging::getParameterCount(&T::worldgenSolidClearance) == 7,
|
|
1352
|
+
"Expected worldgenSolidClearance(...) to have 7 parameters");
|
|
1353
|
+
return bridging::callFromJs<double>(rt, &T::worldgenSolidClearance, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1354
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1355
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1356
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
1357
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
|
|
1358
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber(),
|
|
1359
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asNumber());
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1362
|
+
static jsi::Value __worldgenFieldIndex(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1363
|
+
static_assert(
|
|
1364
|
+
bridging::getParameterCount(&T::worldgenFieldIndex) == 3,
|
|
1365
|
+
"Expected worldgenFieldIndex(...) to have 3 parameters");
|
|
1366
|
+
return bridging::callFromJs<double>(rt, &T::worldgenFieldIndex, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1367
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1368
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asString(rt));
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
static jsi::Value __worldgenField(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1372
|
+
static_assert(
|
|
1373
|
+
bridging::getParameterCount(&T::worldgenField) == 5,
|
|
1374
|
+
"Expected worldgenField(...) to have 5 parameters");
|
|
1375
|
+
return bridging::callFromJs<double>(rt, &T::worldgenField, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1376
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1377
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1378
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
1379
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber());
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
static jsi::Value __worldgenTilt(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1383
|
+
static_assert(
|
|
1384
|
+
bridging::getParameterCount(&T::worldgenTilt) == 5,
|
|
1385
|
+
"Expected worldgenTilt(...) to have 5 parameters");
|
|
1386
|
+
return bridging::callFromJs<jsi::Array>(rt, &T::worldgenTilt, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1387
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1388
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1389
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
1390
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber());
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
static jsi::Value __worldgenSight(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1394
|
+
static_assert(
|
|
1395
|
+
bridging::getParameterCount(&T::worldgenSight) == 9,
|
|
1396
|
+
"Expected worldgenSight(...) to have 9 parameters");
|
|
1397
|
+
return bridging::callFromJs<bool>(rt, &T::worldgenSight, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1398
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1399
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1400
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
1401
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
|
|
1402
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber(),
|
|
1403
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asNumber(),
|
|
1404
|
+
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asNumber(),
|
|
1405
|
+
count <= 7 ? throw jsi::JSError(rt, "Expected argument in position 7 to be passed") : args[7].asNumber());
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
static jsi::Value __worldgenMove(jsi::Runtime &rt, TurboModule &turboModule, const jsi::Value* args, size_t count) {
|
|
1409
|
+
static_assert(
|
|
1410
|
+
bridging::getParameterCount(&T::worldgenMove) == 8,
|
|
1411
|
+
"Expected worldgenMove(...) to have 8 parameters");
|
|
1412
|
+
return bridging::callFromJs<jsi::Array>(rt, &T::worldgenMove, static_cast<NativeNayanEngineCxxSpec*>(&turboModule)->jsInvoker_, static_cast<T*>(&turboModule),
|
|
1413
|
+
count <= 0 ? throw jsi::JSError(rt, "Expected argument in position 0 to be passed") : args[0].asNumber(),
|
|
1414
|
+
count <= 1 ? throw jsi::JSError(rt, "Expected argument in position 1 to be passed") : args[1].asNumber(),
|
|
1415
|
+
count <= 2 ? throw jsi::JSError(rt, "Expected argument in position 2 to be passed") : args[2].asNumber(),
|
|
1416
|
+
count <= 3 ? throw jsi::JSError(rt, "Expected argument in position 3 to be passed") : args[3].asNumber(),
|
|
1417
|
+
count <= 4 ? throw jsi::JSError(rt, "Expected argument in position 4 to be passed") : args[4].asNumber(),
|
|
1418
|
+
count <= 5 ? throw jsi::JSError(rt, "Expected argument in position 5 to be passed") : args[5].asNumber(),
|
|
1419
|
+
count <= 6 ? throw jsi::JSError(rt, "Expected argument in position 6 to be passed") : args[6].asObject(rt));
|
|
1420
|
+
}
|
|
1024
1421
|
};
|
|
1025
1422
|
|
|
1026
1423
|
} // namespace facebook::react
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nayan-ui/engine",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.6",
|
|
4
4
|
"description": "Fast 3D game engine for React and React Native: Rust and wgpu rendering, Rapier physics, animation, particle effects, audio, haptics and drawing.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"3d",
|
|
@@ -11,6 +11,9 @@ import { type TurboModule, TurboModuleRegistry } from 'react-native';
|
|
|
11
11
|
* and stay valid until `destroyWorld`.
|
|
12
12
|
*/
|
|
13
13
|
export interface Spec extends TurboModule {
|
|
14
|
+
/** System speech commands; JSON envelope contains value or error. */
|
|
15
|
+
speechRequest(command: string): Promise<string>;
|
|
16
|
+
|
|
14
17
|
createWorld(capacity: number): number;
|
|
15
18
|
destroyWorld(world: number): void;
|
|
16
19
|
|
|
@@ -108,6 +111,10 @@ export interface Spec extends TurboModule {
|
|
|
108
111
|
modelIndices(mesh: number): Object;
|
|
109
112
|
/** Full bounding-box size [x, y, z]. */
|
|
110
113
|
modelSize(mesh: number): Array<number>;
|
|
114
|
+
/** Bakes a model into a new texture (spec: BakeSpec JSON): [texture, center x, center y, extent], or [] on failure (`loadError`). */
|
|
115
|
+
modelBake(mesh: number, spec: string): Array<number>;
|
|
116
|
+
/** Whether a baked picture is kept under `key`. */
|
|
117
|
+
bakeKept(key: string): boolean;
|
|
111
118
|
/** The model's base color texture id, or -1. */
|
|
112
119
|
modelTexture(mesh: number): number;
|
|
113
120
|
/** A new mesh id with `base`'s geometry (to give it another texture), or -1. */
|
|
@@ -235,6 +242,12 @@ export interface Spec extends TurboModule {
|
|
|
235
242
|
width: number,
|
|
236
243
|
height: number
|
|
237
244
|
): void;
|
|
245
|
+
/**
|
|
246
|
+
* Static scenery behind the scene (the world's instance buffers, as `renderOverlay`): drawn into a
|
|
247
|
+
* cached texture with each frame's camera and light, and again only when this is called again or
|
|
248
|
+
* the view, light, size or quality change. count 0 removes it.
|
|
249
|
+
*/
|
|
250
|
+
renderBackdrop(surface: number, matrices: Object, colors: Object, regions: Object, ranges: Object, count: number): void;
|
|
238
251
|
renderError(): string;
|
|
239
252
|
/** "vulkan", "gl" or "metal" ("" before the first surface). */
|
|
240
253
|
renderBackend(): string;
|
|
@@ -255,11 +268,75 @@ export interface Spec extends TurboModule {
|
|
|
255
268
|
audioSetVolume(volume: number): void;
|
|
256
269
|
audioSetMuted(muted: boolean): void;
|
|
257
270
|
audioIsRunning(): boolean;
|
|
271
|
+
/** Frees a sound's samples (a played recording); its id then plays nothing. */
|
|
272
|
+
audioRelease(sound: number): void;
|
|
273
|
+
/** A sound's length in seconds (0 if unknown or released). */
|
|
274
|
+
audioDuration(sound: number): number;
|
|
275
|
+
/** Loudness per `1 / perSecond` s of a sound, as a Float32 ArrayBuffer. */
|
|
276
|
+
audioLevels(sound: number, perSecond: number): Object;
|
|
277
|
+
|
|
278
|
+
// Microphone (global)
|
|
279
|
+
/** 1 granted, 0 not asked yet (or not granted on Android), -1 denied. */
|
|
280
|
+
micPermission(): number;
|
|
281
|
+
/** Shows the system prompt the first time; resolves to whether recording is allowed. */
|
|
282
|
+
micRequestPermission(): Promise<boolean>;
|
|
283
|
+
/** Starts listening, keeping the last `maxSeconds` of input; true if it's opening. */
|
|
284
|
+
micStart(maxSeconds: number): boolean;
|
|
285
|
+
micStop(): void;
|
|
286
|
+
/** 0 off, 1 opening, 2 listening, -1 failed. */
|
|
287
|
+
micState(): number;
|
|
288
|
+
/** Input loudness now, 0..1. */
|
|
289
|
+
micLevel(): number;
|
|
290
|
+
/** Seconds of input held. */
|
|
291
|
+
micHeld(): number;
|
|
292
|
+
/** A sound id of the `seconds` of input that ended `skipEnd` seconds ago, or -1; forgets what was heard. */
|
|
293
|
+
micTake(seconds: number, skipEnd: number): number;
|
|
258
294
|
|
|
259
295
|
// Haptics (global)
|
|
260
296
|
hapticsSupported(): boolean;
|
|
261
297
|
/** Taps as flat [time, intensity, sharpness, ...] triples. */
|
|
262
298
|
hapticsPlay(taps: Array<number>, throttle: boolean): void;
|
|
299
|
+
|
|
300
|
+
// Procedural worlds (global handles; recipes are JSON, see `generateWorld`)
|
|
301
|
+
/** Builds (or, with a `key` saved from the same recipe, restores) a world. 0 on failure (`worldgenError`). */
|
|
302
|
+
worldgenBuild(recipe: string, key: string, prepareTerrain: boolean): number;
|
|
303
|
+
/** `worldgenBuild` on a background native thread. */
|
|
304
|
+
worldgenBuildAsync(recipe: string, key: string, prepareTerrain: boolean): Promise<number>;
|
|
305
|
+
worldgenError(): string;
|
|
306
|
+
/** Whether a world was saved under `key`. */
|
|
307
|
+
worldgenKept(key: string): boolean;
|
|
308
|
+
worldgenFree(world: number): void;
|
|
309
|
+
/** Spawn, restored flag, layer sizes and picked spots as JSON. */
|
|
310
|
+
worldgenInfo(world: number): string;
|
|
311
|
+
/** A scatter layer's items (f64, stride from `worldgenInfo`). */
|
|
312
|
+
worldgenLayer(world: number, name: string): Object;
|
|
313
|
+
/** Reachable cells as f64 [x, z] pairs. */
|
|
314
|
+
worldgenReachable(world: number): Object;
|
|
315
|
+
/** Overview surface codes (u8, size × size). */
|
|
316
|
+
worldgenOverview(world: number): Object;
|
|
317
|
+
/** Re-picks the spots for `run`; false keeps the previous ones. */
|
|
318
|
+
worldgenPick(world: number, run: number): boolean;
|
|
319
|
+
/** The terrain mesh of a material, handed over once: { vertices, indices }. */
|
|
320
|
+
worldgenTerrain(world: number, material: number): Object;
|
|
321
|
+
/** Builds a procedural mesh recipe: { vertices, indices }. */
|
|
322
|
+
worldgenMesh(recipe: string): Object;
|
|
323
|
+
/** Recolors 11-float vertices in place by a field function (`{ fields, out }`) of each surface point. */
|
|
324
|
+
worldgenPaint(vertices: Object, recipe: string): boolean;
|
|
325
|
+
worldgenGround(world: number, x: number, z: number): number;
|
|
326
|
+
worldgenSurface(world: number, x: number, z: number): number;
|
|
327
|
+
/** The platform under a point, or -1. */
|
|
328
|
+
worldgenPlatform(world: number, x: number, z: number): number;
|
|
329
|
+
worldgenWalkable(world: number, x: number, z: number, radius: number): boolean;
|
|
330
|
+
worldgenClearance(world: number, x: number, z: number, radius: number): number;
|
|
331
|
+
worldgenSolidClearance(world: number, x: number, z: number, radius: number, bottom: number, top: number): number;
|
|
332
|
+
/** A named field's index for `worldgenField`, or -1. */
|
|
333
|
+
worldgenFieldIndex(world: number, name: string): number;
|
|
334
|
+
worldgenField(world: number, field: number, x: number, z: number): number;
|
|
335
|
+
/** Ground tilt as a quaternion [x, y, z, w]. */
|
|
336
|
+
worldgenTilt(world: number, x: number, z: number, yaw: number): Array<number>;
|
|
337
|
+
worldgenSight(world: number, ax: number, az: number, bx: number, bz: number, radius: number, step: number, rise: number): boolean;
|
|
338
|
+
/** Swept move-and-slide; `bodies` is an f64 buffer of [x, z, radius] triples. Returns [x, z]. */
|
|
339
|
+
worldgenMove(world: number, x: number, z: number, dx: number, dz: number, radius: number, bodies: Object): Array<number>;
|
|
263
340
|
}
|
|
264
341
|
|
|
265
342
|
export default TurboModuleRegistry.get<Spec>('NativeNayanEngine');
|