@holoscript/core 6.0.2 → 6.0.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 +38 -38
- package/dist/GLTFPipeline-DEN36VNK.js +12 -0
- package/dist/GLTFPipeline-YPCAK236.cjs +33 -0
- package/dist/{HoloScriptPlusParser-BZR5DELQ.js → HoloScriptPlusParser-BN6KVRCM.js} +5 -5
- package/dist/{HoloScriptPlusParser-SBMYDNXO.cjs → HoloScriptPlusParser-NC5FE6AL.cjs} +16 -16
- package/dist/{USDZExporter-YA55ZS35.js → USDZExporter-NTMBNTDB.js} +3 -3
- package/dist/{USDZExporter-MHEHXZB4.cjs → USDZExporter-UWGWNMMD.cjs} +3 -3
- package/dist/{chunk-32TWR3HE.js → chunk-2CWOLHTE.js} +3 -4
- package/dist/{chunk-2UX5LRAP.cjs → chunk-33LSUQDD.cjs} +33 -31
- package/dist/{chunk-LBPEZQAF.js → chunk-3FJCK5XA.js} +7 -7
- package/dist/{chunk-EGIZHYJP.cjs → chunk-3SAK5KFL.cjs} +2 -4
- package/dist/{chunk-PJMOXFPR.cjs → chunk-4XSNJCLC.cjs} +25 -27
- package/dist/{chunk-HKCVM6OK.cjs → chunk-5BGSECRJ.cjs} +21 -21
- package/dist/{chunk-EMO7HAKJ.cjs → chunk-5O6TQC6M.cjs} +26 -30
- package/dist/{chunk-XSUZMPVQ.cjs → chunk-5OEOHAAW.cjs} +26 -26
- package/dist/{chunk-EJA7G2C4.cjs → chunk-5WUNN6ZN.cjs} +2 -2
- package/dist/{chunk-CQDOF3G7.cjs → chunk-6TZPZCOJ.cjs} +18 -18
- package/dist/{chunk-NRUB55IT.cjs → chunk-6UEHYZ7V.cjs} +18 -16
- package/dist/{chunk-V42NTCFH.js → chunk-6XSERL6L.js} +4230 -2197
- package/dist/{chunk-X4YVN7H3.cjs → chunk-72EQECGT.cjs} +37 -17
- package/dist/{chunk-4KJ2R7VP.cjs → chunk-7AGYRWKW.cjs} +19 -19
- package/dist/{chunk-UQW6SLM5.js → chunk-A7PIMZGU.js} +110 -19
- package/dist/{chunk-RT7LJRSF.cjs → chunk-ATSKSYVE.cjs} +1013 -6708
- package/dist/{chunk-WN3YF33G.cjs → chunk-B5TCIAPQ.cjs} +9 -10
- package/dist/{chunk-AIUXRS74.cjs → chunk-BF2235SI.cjs} +4275 -2242
- package/dist/{chunk-DIEDKX5B.cjs → chunk-BND3ST2K.cjs} +18 -16
- package/dist/{chunk-EPWRXL6S.js → chunk-BU7VWW2K.js} +29 -29
- package/dist/{chunk-6OQBLABR.js → chunk-BWFJEM5A.js} +368 -189
- package/dist/{chunk-ARNKA274.cjs → chunk-CAUCGUEA.cjs} +6 -6
- package/dist/{chunk-YCMQQQ5U.cjs → chunk-CBJSLA2E.cjs} +398 -219
- package/dist/{chunk-BU5ZAFMC.js → chunk-CDPGV4DN.js} +6 -7
- package/dist/{chunk-CO2VM2DK.js → chunk-CS2EMTGF.js} +10 -9
- package/dist/{chunk-AW7WAELW.js → chunk-DMG7C4H2.js} +4 -4
- package/dist/{chunk-XSF76QRU.js → chunk-DXJQDCFL.js} +3 -3
- package/dist/{chunk-4FCZDTD5.js → chunk-E3FWRT3Z.js} +7 -9
- package/dist/{chunk-KYM4XRFG.js → chunk-E3UALNFA.js} +4 -4
- package/dist/{chunk-GC3YU46J.js → chunk-EONILVMF.js} +2 -2
- package/dist/{chunk-VJVCD5T5.cjs → chunk-EQV4R3EV.cjs} +22 -22
- package/dist/{chunk-FEFHPUEM.cjs → chunk-F3HH56EB.cjs} +74 -658
- package/dist/{chunk-WYH4GVZ5.js → chunk-F4IULT7N.js} +2 -2
- package/dist/{chunk-XDXZM3ZP.cjs → chunk-FFKU7BTK.cjs} +19 -19
- package/dist/{chunk-NKRKT6V2.js → chunk-FHQVYCH2.js} +11 -10
- package/dist/{chunk-7H5UNJZD.cjs → chunk-FSF7EQVA.cjs} +11 -10
- package/dist/{chunk-KUJRR4FJ.js → chunk-G4VZTCIB.js} +9 -7
- package/dist/{chunk-A6GO3DPZ.cjs → chunk-G7CT3EMP.cjs} +4 -4
- package/dist/{chunk-EUFLX2PI.js → chunk-GGHSW2NN.js} +989 -6611
- package/dist/chunk-GVUR45UF.cjs +777 -0
- package/dist/{chunk-ODGMVILH.js → chunk-H5Z7NASB.js} +3 -3
- package/dist/{chunk-7KPI4EKH.cjs → chunk-HE7ULERA.cjs} +45 -49
- package/dist/{chunk-26TLYBFD.js → chunk-HPS76H7Q.js} +3 -3
- package/dist/{chunk-RE3OKSYF.cjs → chunk-HQUEA5R6.cjs} +6 -6
- package/dist/{chunk-ZGTGVSTZ.js → chunk-HYNTS5CP.js} +2 -2
- package/dist/{chunk-PBA6NXCT.cjs → chunk-IBDG74G2.cjs} +6 -3
- package/dist/chunk-IFNQFCTM.js +3098 -0
- package/dist/{chunk-ZL6VJ6SN.js → chunk-IWI6J7FX.js} +5 -5
- package/dist/{chunk-3KEU5QYY.cjs → chunk-K3JDKWGI.cjs} +118 -23
- package/dist/{chunk-NLPSZT4C.js → chunk-K6EKD26I.js} +6 -6
- package/dist/chunk-KCQ5NDYC.cjs +3172 -0
- package/dist/{chunk-ELLQPFAF.js → chunk-KED34ILP.js} +11 -9
- package/dist/{chunk-BY3B7ZYV.cjs → chunk-KSGXLT74.cjs} +3 -3
- package/dist/{chunk-65RFOWZI.js → chunk-L4G4RLXX.js} +9 -7
- package/dist/{chunk-4SMUJFHL.js → chunk-LDP5OK6G.js} +6 -3
- package/dist/{chunk-VZNKJZTT.cjs → chunk-LGGRPKTV.cjs} +82 -96
- package/dist/{chunk-C2QHVHZF.js → chunk-LSW7P7ML.js} +23 -414
- package/dist/{chunk-HHS6FMOU.cjs → chunk-LXJ4667L.cjs} +83 -22
- package/dist/{chunk-H6WMMLQK.cjs → chunk-LZ266PCM.cjs} +20 -13
- package/dist/{chunk-V2ILLPHK.cjs → chunk-MD6KDHVE.cjs} +10 -10
- package/dist/{chunk-6WNCRE6F.js → chunk-MEASWI2Y.js} +5 -5
- package/dist/chunk-MPXBVFHQ.js +768 -0
- package/dist/{chunk-WUXIRGZP.cjs → chunk-NCUKG4SK.cjs} +304 -144
- package/dist/chunk-NDQNIJEH.js +1715 -0
- package/dist/{chunk-Y5MUAYTO.js → chunk-NOZZ46QU.js} +9 -8
- package/dist/{chunk-F5LVGHNT.js → chunk-OFKWH2IP.js} +3 -3
- package/dist/{chunk-SPDELRRV.cjs → chunk-PMGODDJA.cjs} +12 -12
- package/dist/{chunk-I3XGTIHM.cjs → chunk-Q4QX3AET.cjs} +2 -2
- package/dist/{chunk-Y7VK5TH3.cjs → chunk-Q5JT3YML.cjs} +10 -10
- package/dist/{chunk-TSWTWZ42.cjs → chunk-Q5SJOGHQ.cjs} +247 -205
- package/dist/{chunk-M6FU6S22.js → chunk-QGKNANZ3.js} +251 -91
- package/dist/{chunk-WFJIDI2N.cjs → chunk-QLEAOI3Q.cjs} +10 -10
- package/dist/{chunk-VK5AXKO3.js → chunk-R7MA7QWV.js} +70 -84
- package/dist/{chunk-W76ETJTI.js → chunk-RVYPEYPX.js} +6 -6
- package/dist/{chunk-MWEFR6YQ.js → chunk-S2N5TNMA.js} +7 -9
- package/dist/{chunk-NCUHGRTZ.js → chunk-S565K7NK.js} +7 -7
- package/dist/{chunk-AC4BSHFV.js → chunk-SDAMZIRE.js} +5 -5
- package/dist/{chunk-HBZYCASG.js → chunk-T36DDXSF.js} +75 -33
- package/dist/{chunk-BO2OKHIY.js → chunk-T4NKMBDL.js} +30 -611
- package/dist/{chunk-7X2IEJIE.cjs → chunk-T7LEXZUZ.cjs} +29 -29
- package/dist/{chunk-HUFNKFA6.js → chunk-TEWCN33Y.js} +8 -12
- package/dist/{chunk-L3Z2HIWJ.cjs → chunk-TQSZUOW5.cjs} +2 -2
- package/dist/chunk-TSH3MSQU.cjs +129 -0
- package/dist/{chunk-PLMYCCA4.js → chunk-UERJ3YJV.js} +6 -6
- package/dist/{chunk-7N3JIJMT.js → chunk-UPJBDCVF.js} +6 -6
- package/dist/{chunk-CMYAWUX3.js → chunk-V3NN3HPP.js} +12 -5
- package/dist/{chunk-SUCBB66F.js → chunk-WB4Z63GG.js} +3 -3
- package/dist/{chunk-PPULB4GG.cjs → chunk-WDW67DZB.cjs} +68 -68
- package/dist/chunk-WGMEAYBG.js +126 -0
- package/dist/{chunk-VSXOIUCF.cjs → chunk-X4ZF6CNE.cjs} +7 -7
- package/dist/{chunk-HF4OFY25.cjs → chunk-X6SEAXAX.cjs} +29 -445
- package/dist/{chunk-C7BNX4XJ.js → chunk-XCWFGZAA.js} +6 -6
- package/dist/{chunk-CNVM7J3M.js → chunk-XD6IYDUX.js} +34 -14
- package/dist/chunk-XG23EUQX.cjs +1717 -0
- package/dist/{chunk-DN7UFU63.cjs → chunk-XRKWN5PL.cjs} +12 -11
- package/dist/{chunk-XNMEH2BI.js → chunk-XUTX5CBW.js} +3 -3
- package/dist/{chunk-PQLGZKMC.cjs → chunk-XWPNTWDN.cjs} +26 -26
- package/dist/{chunk-NTMZSDXM.cjs → chunk-XXINBTZK.cjs} +43 -43
- package/dist/{chunk-74YCHHTE.js → chunk-YCXFCXDS.js} +8 -12
- package/dist/{chunk-KDB6BUMB.js → chunk-YQK5JNFK.js} +77 -18
- package/dist/{chunk-DH5G2JUA.cjs → chunk-Z34RLXRA.cjs} +44 -46
- package/dist/{chunk-XH7SE4HH.cjs → chunk-ZP4D3CSX.cjs} +19 -19
- package/dist/cli/holoscript-runner.cjs +33 -32
- package/dist/cli/holoscript-runner.js +13 -12
- package/dist/codebase/index.cjs +1 -1
- package/dist/codebase/index.d.ts +25 -0
- package/dist/codebase/index.js +1 -1
- package/dist/compiler/agent-inference.cjs +7 -8
- package/dist/compiler/agent-inference.js +3 -4
- package/dist/compiler/android-xr.cjs +7 -8
- package/dist/compiler/android-xr.js +5 -6
- package/dist/compiler/android.cjs +8 -9
- package/dist/compiler/android.js +6 -7
- package/dist/compiler/ar.cjs +6 -7
- package/dist/compiler/ar.js +4 -5
- package/dist/compiler/babylon.cjs +8 -9
- package/dist/compiler/babylon.js +7 -8
- package/dist/compiler/coco.cjs +1 -1
- package/dist/compiler/coco.js +1 -1
- package/dist/compiler/domain-block-utils.cjs +158 -151
- package/dist/compiler/domain-block-utils.js +4 -5
- package/dist/compiler/dtdl.cjs +7 -8
- package/dist/compiler/dtdl.js +4 -5
- package/dist/compiler/gltf-pipeline.cjs +9 -9
- package/dist/compiler/gltf-pipeline.js +2 -2
- package/dist/compiler/godot.cjs +6 -7
- package/dist/compiler/godot.js +5 -6
- package/dist/compiler/incremental.cjs +7 -8
- package/dist/compiler/incremental.js +2 -3
- package/dist/compiler/index.cjs +1934 -878
- package/dist/compiler/index.js +1904 -842
- package/dist/compiler/ios.cjs +8 -9
- package/dist/compiler/ios.js +6 -7
- package/dist/compiler/multi-layer.cjs +10 -17
- package/dist/compiler/multi-layer.js +9 -10
- package/dist/compiler/nodetoy.cjs +1 -1
- package/dist/compiler/nodetoy.js +1 -1
- package/dist/compiler/openxr.cjs +6 -7
- package/dist/compiler/openxr.js +5 -6
- package/dist/compiler/playcanvas.cjs +7 -8
- package/dist/compiler/playcanvas.js +6 -7
- package/dist/compiler/r3f.cjs +13 -14
- package/dist/compiler/r3f.js +8 -9
- package/dist/compiler/remotion.cjs +1 -1
- package/dist/compiler/remotion.js +1 -1
- package/dist/compiler/reproducibility.cjs +1 -1
- package/dist/compiler/reproducibility.js +1 -1
- package/dist/compiler/sdf.cjs +7 -8
- package/dist/compiler/sdf.js +5 -6
- package/dist/compiler/semantic-scene.cjs +7 -7
- package/dist/compiler/semantic-scene.js +2 -2
- package/dist/compiler/state.cjs +5 -6
- package/dist/compiler/state.js +3 -4
- package/dist/compiler/trait-composition.cjs +7 -8
- package/dist/compiler/trait-composition.js +3 -4
- package/dist/compiler/unity.cjs +6 -7
- package/dist/compiler/unity.js +5 -6
- package/dist/compiler/unreal.cjs +7 -8
- package/dist/compiler/unreal.js +5 -6
- package/dist/compiler/urdf.cjs +13 -14
- package/dist/compiler/urdf.js +5 -6
- package/dist/compiler/usd-physics.cjs +7 -8
- package/dist/compiler/usd-physics.js +4 -5
- package/dist/compiler/visionos.cjs +6 -7
- package/dist/compiler/visionos.js +5 -6
- package/dist/compiler/vrchat.cjs +7 -8
- package/dist/compiler/vrchat.js +5 -6
- package/dist/compiler/vrr.cjs +7 -8
- package/dist/compiler/vrr.js +5 -6
- package/dist/compiler/wasm.cjs +10 -11
- package/dist/compiler/wasm.js +5 -6
- package/dist/compiler/webgpu.cjs +6 -7
- package/dist/compiler/webgpu.js +5 -6
- package/dist/constants.d.ts +3 -0
- package/dist/debugger.cjs +7 -7
- package/dist/debugger.js +5 -5
- package/dist/entries/interop.cjs +1 -1
- package/dist/entries/interop.d.ts +9 -0
- package/dist/entries/interop.js +1 -1
- package/dist/entries/scripting.cjs +18 -17
- package/dist/entries/scripting.d.ts +7 -0
- package/dist/entries/scripting.js +8 -7
- package/dist/index.cjs +6773 -27555
- package/dist/index.d.ts +19 -0
- package/dist/index.js +5212 -26101
- package/dist/math/vec3.cjs +1 -1
- package/dist/math/vec3.js +1 -1
- package/dist/ml-dsa-PHCWUBPX.cjs +1178 -0
- package/dist/ml-dsa-WYLJHJO6.js +1178 -0
- package/dist/parser.cjs +11 -10
- package/dist/parser.js +8 -7
- package/dist/{playwright-BIZXMLD2.js → playwright-5OSAPTNH.js} +3 -3
- package/dist/{playwright-7DTEQCBD.cjs → playwright-RL6GY4F7.cjs} +1985 -1985
- package/dist/runtime.cjs +5 -5
- package/dist/runtime.js +4 -4
- package/dist/self-improvement/index.d.ts +0 -48
- package/dist/storage/index.cjs +1 -1
- package/dist/storage/index.d.ts +24 -0
- package/dist/storage/index.js +1 -1
- package/dist/tools/index.d.ts +12 -0
- package/dist/traits/index.cjs +925 -607
- package/dist/traits/index.js +137 -20
- package/dist/type-checker.cjs +4 -4
- package/dist/type-checker.js +2 -2
- package/package.json +54 -19
- package/LICENSE +0 -21
- package/dist/GLTFPipeline-3KLWWUQO.cjs +0 -34
- package/dist/GLTFPipeline-LYII2ZVQ.js +0 -13
- package/dist/chunk-CN4NOESF.cjs +0 -416
- package/dist/chunk-DXVCEFZB.js +0 -2027
- package/dist/chunk-ENV7K6XA.js +0 -282
- package/dist/chunk-H7XMORZI.js +0 -2731
- package/dist/chunk-HAN4V3PF.cjs +0 -2037
- package/dist/chunk-LER4WXW5.cjs +0 -286
- package/dist/chunk-QHVVVN47.cjs +0 -2033
- package/dist/chunk-QWKUKVRE.js +0 -2026
- package/dist/chunk-UITWA6DV.cjs +0 -2829
- package/dist/chunk-X67XRI2T.js +0 -410
- package/dist/post-quantum-JTTAAGO3.cjs +0 -6
- package/dist/post-quantum-RVPVDEPI.js +0 -4
- package/dist/wot/index.cjs +0 -29
- package/dist/wot/index.js +0 -4
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkPMGODDJA_cjs = require('./chunk-PMGODDJA.cjs');
|
|
4
|
+
var chunkCAUCGUEA_cjs = require('./chunk-CAUCGUEA.cjs');
|
|
5
|
+
var chunkBF2235SI_cjs = require('./chunk-BF2235SI.cjs');
|
|
6
|
+
var chunk3SAK5KFL_cjs = require('./chunk-3SAK5KFL.cjs');
|
|
7
|
+
var platform = require('@holoscript/platform');
|
|
7
8
|
|
|
8
9
|
// src/compiler/AndroidCompiler.ts
|
|
9
10
|
var AndroidCompiler_exports = {};
|
|
10
|
-
|
|
11
|
+
chunk3SAK5KFL_cjs.__export(AndroidCompiler_exports, {
|
|
11
12
|
AndroidCompiler: () => exports.AndroidCompiler,
|
|
12
13
|
compileToAndroid: () => compileToAndroid
|
|
13
14
|
});
|
|
@@ -16,23 +17,22 @@ function compileToAndroid(composition, options) {
|
|
|
16
17
|
return Promise.resolve(compiler.compile(composition, "test-token", void 0));
|
|
17
18
|
}
|
|
18
19
|
exports.AndroidCompiler = void 0;
|
|
19
|
-
var init_AndroidCompiler =
|
|
20
|
+
var init_AndroidCompiler = chunk3SAK5KFL_cjs.__esm({
|
|
20
21
|
"src/compiler/AndroidCompiler.ts"() {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
exports.AndroidCompiler = class extends chunkQHVVVN47_cjs.CompilerBase {
|
|
22
|
+
chunkBF2235SI_cjs.init_CompilerBase();
|
|
23
|
+
chunkPMGODDJA_cjs.init_geospatial();
|
|
24
|
+
chunkPMGODDJA_cjs.init_depth_scanner();
|
|
25
|
+
chunkCAUCGUEA_cjs.init_portal_ar();
|
|
26
|
+
chunkCAUCGUEA_cjs.init_camera_hand_tracking();
|
|
27
|
+
chunkCAUCGUEA_cjs.init_npu_scene();
|
|
28
|
+
chunkPMGODDJA_cjs.init_spatial_authoring();
|
|
29
|
+
chunkPMGODDJA_cjs.init_haptic_feedback();
|
|
30
|
+
chunkPMGODDJA_cjs.init_nearby_connections();
|
|
31
|
+
chunkPMGODDJA_cjs.init_foldable_display();
|
|
32
|
+
chunkPMGODDJA_cjs.init_samsung_dex();
|
|
33
|
+
chunkPMGODDJA_cjs.init_google_lens();
|
|
34
|
+
chunkPMGODDJA_cjs.init_webxr();
|
|
35
|
+
exports.AndroidCompiler = class extends chunkBF2235SI_cjs.CompilerBase {
|
|
36
36
|
constructor(options = {}) {
|
|
37
37
|
super();
|
|
38
38
|
this.compilerName = "AndroidCompiler";
|
|
@@ -50,7 +50,7 @@ var init_AndroidCompiler = chunkEGIZHYJP_cjs.__esm({
|
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
52
|
getRequiredCapability() {
|
|
53
|
-
return
|
|
53
|
+
return platform.ANSCapabilityPath.ANDROID;
|
|
54
54
|
}
|
|
55
55
|
compile(composition, agentToken, outputPath) {
|
|
56
56
|
this.validateCompilerAccess(agentToken, outputPath);
|
|
@@ -403,9 +403,7 @@ var init_AndroidCompiler = chunkEGIZHYJP_cjs.__esm({
|
|
|
403
403
|
this.indentLevel = 0;
|
|
404
404
|
const pkg = this.options.packageName;
|
|
405
405
|
this.emit("// Auto-generated by HoloScript AndroidCompiler");
|
|
406
|
-
this.emit(
|
|
407
|
-
`// Node Factory: ${this.escapeStringValue(composition.name, "Kotlin")}`
|
|
408
|
-
);
|
|
406
|
+
this.emit(`// Node Factory: ${this.escapeStringValue(composition.name, "Kotlin")}`);
|
|
409
407
|
this.emit("");
|
|
410
408
|
this.emit(`package ${pkg}`);
|
|
411
409
|
this.emit("");
|
|
@@ -680,12 +678,16 @@ dependencies {
|
|
|
680
678
|
emitGeoAnchorSetup(composition) {
|
|
681
679
|
this.emit("");
|
|
682
680
|
this.emit("// === Geo-Anchor: GPS-pinned persistent holograms ===");
|
|
683
|
-
this.emit(
|
|
681
|
+
this.emit(
|
|
682
|
+
"private var fusedLocationClient: com.google.android.gms.location.FusedLocationProviderClient? = null"
|
|
683
|
+
);
|
|
684
684
|
this.emit("private val geoAnchors = mutableMapOf<String, Anchor>()");
|
|
685
685
|
this.emit("");
|
|
686
686
|
this.emit("private fun setupGeoAnchors() {");
|
|
687
687
|
this.indentLevel++;
|
|
688
|
-
this.emit(
|
|
688
|
+
this.emit(
|
|
689
|
+
"fusedLocationClient = com.google.android.gms.location.LocationServices.getFusedLocationProviderClient(this)"
|
|
690
|
+
);
|
|
689
691
|
this.emit("");
|
|
690
692
|
const usesGeospatial = this.compositionHasTrait(composition, "geo_arcore_geospatial");
|
|
691
693
|
if (usesGeospatial) {
|
|
@@ -723,7 +725,9 @@ dependencies {
|
|
|
723
725
|
const headingConfig = typeof headingTrait === "string" ? {} : headingTrait?.config || {};
|
|
724
726
|
const heading = headingConfig.degrees ?? 0;
|
|
725
727
|
this.emit(`// Geo-anchor: ${this.escapeStringValue(obj.name, "Kotlin")}`);
|
|
726
|
-
this.emit(
|
|
728
|
+
this.emit(
|
|
729
|
+
`createGeoAnchor("${this.escapeStringValue(obj.name, "Kotlin")}", ${lat}, ${lng}, ${alt}, ${heading}f)`
|
|
730
|
+
);
|
|
727
731
|
}
|
|
728
732
|
const usesPersist = this.compositionHasTrait(composition, "geo_persist");
|
|
729
733
|
const usesCloud = this.compositionHasTrait(composition, "geo_cloud_anchor");
|
|
@@ -735,13 +739,17 @@ dependencies {
|
|
|
735
739
|
this.indentLevel--;
|
|
736
740
|
this.emit("}");
|
|
737
741
|
this.emit("");
|
|
738
|
-
this.emit(
|
|
742
|
+
this.emit(
|
|
743
|
+
"private fun createGeoAnchor(name: String, lat: Double, lng: Double, alt: Double, heading: Float) {"
|
|
744
|
+
);
|
|
739
745
|
this.indentLevel++;
|
|
740
746
|
this.emit("val session = arFragment.arSceneView.session ?: return");
|
|
741
747
|
this.emit("val earth = session.earth ?: return");
|
|
742
748
|
this.emit("if (earth.trackingState != TrackingState.TRACKING) return");
|
|
743
749
|
this.emit("");
|
|
744
|
-
this.emit(
|
|
750
|
+
this.emit(
|
|
751
|
+
"val anchor = earth.createAnchor(lat, lng, alt, 0f, 0f, Math.sin(Math.toRadians(heading.toDouble() / 2)).toFloat(), Math.cos(Math.toRadians(heading.toDouble() / 2)).toFloat())"
|
|
752
|
+
);
|
|
745
753
|
this.emit("geoAnchors[name] = anchor");
|
|
746
754
|
this.emit("");
|
|
747
755
|
this.emit("val anchorNode = AnchorNode(anchor)");
|
|
@@ -845,14 +853,18 @@ dependencies {
|
|
|
845
853
|
this.emit(`val horizontalAccuracy = geospatialState.horizontalAccuracy`);
|
|
846
854
|
this.emit(`val headingAccuracy = geospatialState.headingAccuracy`);
|
|
847
855
|
this.emit("");
|
|
848
|
-
this.emit(
|
|
856
|
+
this.emit(
|
|
857
|
+
`if (horizontalAccuracy > ${chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.vps.accuracyThreshold} || headingAccuracy > ${chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.vps.headingAccuracyThreshold}) {`
|
|
858
|
+
);
|
|
849
859
|
this.indentLevel++;
|
|
850
860
|
this.emit("// Accuracy not yet sufficient for anchoring");
|
|
851
861
|
this.emit("return@addOnUpdateListener");
|
|
852
862
|
this.indentLevel--;
|
|
853
863
|
this.emit("}");
|
|
854
864
|
this.emit("");
|
|
855
|
-
this.emit(
|
|
865
|
+
this.emit(
|
|
866
|
+
'android.util.Log.d("HoloScript", "Geospatial tracking: accuracy=$horizontalAccuracy m, heading=$headingAccuracy deg")'
|
|
867
|
+
);
|
|
856
868
|
if (usesStreetscape) {
|
|
857
869
|
this.emit("");
|
|
858
870
|
this.emit("// Process Streetscape Geometry meshes");
|
|
@@ -867,37 +879,47 @@ dependencies {
|
|
|
867
879
|
const tName = typeof trait === "string" ? trait : trait.name;
|
|
868
880
|
const tConfig = typeof trait === "string" ? {} : trait.config || {};
|
|
869
881
|
if (tName === "geospatial_anchor") {
|
|
870
|
-
const lat = tConfig.latitude ??
|
|
871
|
-
const lng = tConfig.longitude ??
|
|
872
|
-
const alt = tConfig.altitude ??
|
|
873
|
-
const heading = tConfig.heading ??
|
|
874
|
-
this.emit(
|
|
882
|
+
const lat = tConfig.latitude ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.anchor.latitude;
|
|
883
|
+
const lng = tConfig.longitude ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.anchor.longitude;
|
|
884
|
+
const alt = tConfig.altitude ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.anchor.altitude;
|
|
885
|
+
const heading = tConfig.heading ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.anchor.heading;
|
|
886
|
+
this.emit(
|
|
887
|
+
`createGeospatialAnchor("${this.escapeStringValue(obj.name, "Kotlin")}", ${lat}, ${lng}, ${alt}, ${heading}f)`
|
|
888
|
+
);
|
|
875
889
|
}
|
|
876
890
|
if (tName === "geospatial_terrain_anchor") {
|
|
877
|
-
const lat = tConfig.latitude ??
|
|
878
|
-
const lng = tConfig.longitude ??
|
|
879
|
-
const altOffset = tConfig.altitudeOffset ??
|
|
880
|
-
const heading = tConfig.heading ??
|
|
881
|
-
this.emit(
|
|
891
|
+
const lat = tConfig.latitude ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.terrainAnchor.latitude;
|
|
892
|
+
const lng = tConfig.longitude ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.terrainAnchor.longitude;
|
|
893
|
+
const altOffset = tConfig.altitudeOffset ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.terrainAnchor.altitudeOffset;
|
|
894
|
+
const heading = tConfig.heading ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.terrainAnchor.heading;
|
|
895
|
+
this.emit(
|
|
896
|
+
`resolveTerrainAnchor("${this.escapeStringValue(obj.name, "Kotlin")}", ${lat}, ${lng}, ${altOffset}, ${heading}f)`
|
|
897
|
+
);
|
|
882
898
|
}
|
|
883
899
|
if (tName === "geospatial_rooftop_anchor") {
|
|
884
|
-
const lat = tConfig.latitude ??
|
|
885
|
-
const lng = tConfig.longitude ??
|
|
886
|
-
const altOffset = tConfig.altitudeOffset ??
|
|
887
|
-
const heading = tConfig.heading ??
|
|
888
|
-
this.emit(
|
|
900
|
+
const lat = tConfig.latitude ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.rooftopAnchor.latitude;
|
|
901
|
+
const lng = tConfig.longitude ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.rooftopAnchor.longitude;
|
|
902
|
+
const altOffset = tConfig.altitudeOffset ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.rooftopAnchor.altitudeOffset;
|
|
903
|
+
const heading = tConfig.heading ?? chunkPMGODDJA_cjs.GEOSPATIAL_DEFAULTS.rooftopAnchor.heading;
|
|
904
|
+
this.emit(
|
|
905
|
+
`resolveRooftopAnchor("${this.escapeStringValue(obj.name, "Kotlin")}", ${lat}, ${lng}, ${altOffset}, ${heading}f)`
|
|
906
|
+
);
|
|
889
907
|
}
|
|
890
908
|
}
|
|
891
909
|
}
|
|
892
910
|
this.indentLevel--;
|
|
893
911
|
this.emit("}");
|
|
894
912
|
this.emit("");
|
|
895
|
-
this.emit(
|
|
913
|
+
this.emit(
|
|
914
|
+
"private fun createGeospatialAnchor(name: String, lat: Double, lng: Double, alt: Double, heading: Float) {"
|
|
915
|
+
);
|
|
896
916
|
this.indentLevel++;
|
|
897
917
|
this.emit("val earthRef = earth ?: return");
|
|
898
918
|
this.emit("if (earthRef.trackingState != TrackingState.TRACKING) return");
|
|
899
919
|
this.emit("");
|
|
900
|
-
this.emit(
|
|
920
|
+
this.emit(
|
|
921
|
+
"val anchor = earthRef.createAnchor(lat, lng, alt, 0f, 0f, Math.sin(Math.toRadians(heading.toDouble() / 2)).toFloat(), Math.cos(Math.toRadians(heading.toDouble() / 2)).toFloat())"
|
|
922
|
+
);
|
|
901
923
|
this.emit("geospatialAnchors[name] = anchor");
|
|
902
924
|
this.emit("");
|
|
903
925
|
this.emit("val anchorNode = AnchorNode(anchor)");
|
|
@@ -916,7 +938,9 @@ dependencies {
|
|
|
916
938
|
this.emit("}");
|
|
917
939
|
this.emit("");
|
|
918
940
|
if (this.compositionHasTrait(composition, "geospatial_terrain_anchor")) {
|
|
919
|
-
this.emit(
|
|
941
|
+
this.emit(
|
|
942
|
+
"private fun resolveTerrainAnchor(name: String, lat: Double, lng: Double, altOffset: Double, heading: Float) {"
|
|
943
|
+
);
|
|
920
944
|
this.indentLevel++;
|
|
921
945
|
this.emit("val earthRef = earth ?: return");
|
|
922
946
|
this.emit("if (earthRef.trackingState != TrackingState.TRACKING) return");
|
|
@@ -926,7 +950,9 @@ dependencies {
|
|
|
926
950
|
this.emit("val qz = 0f");
|
|
927
951
|
this.emit("val qw = Math.cos(Math.toRadians(heading.toDouble() / 2)).toFloat()");
|
|
928
952
|
this.emit("");
|
|
929
|
-
this.emit(
|
|
953
|
+
this.emit(
|
|
954
|
+
"earthRef.resolveAnchorOnTerrainAsync(lat, lng, altOffset, qx, qy, qz, qw) { anchor, state ->"
|
|
955
|
+
);
|
|
930
956
|
this.indentLevel++;
|
|
931
957
|
this.emit("if (state == Anchor.TerrainAnchorState.SUCCESS && anchor != null) {");
|
|
932
958
|
this.indentLevel++;
|
|
@@ -934,7 +960,9 @@ dependencies {
|
|
|
934
960
|
this.emit("val anchorNode = AnchorNode(anchor)");
|
|
935
961
|
this.emit("anchorNode.setParent(arFragment.arSceneView.scene)");
|
|
936
962
|
this.emit("");
|
|
937
|
-
this.emit(
|
|
963
|
+
this.emit(
|
|
964
|
+
"NodeFactory.createDefaultNode(this@" + this.options.className + "Activity) { renderable ->"
|
|
965
|
+
);
|
|
938
966
|
this.indentLevel++;
|
|
939
967
|
this.emit("val node = TransformableNode(arFragment.transformationSystem)");
|
|
940
968
|
this.emit("node.setParent(anchorNode)");
|
|
@@ -952,7 +980,9 @@ dependencies {
|
|
|
952
980
|
this.emit("");
|
|
953
981
|
}
|
|
954
982
|
if (this.compositionHasTrait(composition, "geospatial_rooftop_anchor")) {
|
|
955
|
-
this.emit(
|
|
983
|
+
this.emit(
|
|
984
|
+
"private fun resolveRooftopAnchor(name: String, lat: Double, lng: Double, altOffset: Double, heading: Float) {"
|
|
985
|
+
);
|
|
956
986
|
this.indentLevel++;
|
|
957
987
|
this.emit("val earthRef = earth ?: return");
|
|
958
988
|
this.emit("if (earthRef.trackingState != TrackingState.TRACKING) return");
|
|
@@ -962,7 +992,9 @@ dependencies {
|
|
|
962
992
|
this.emit("val qz = 0f");
|
|
963
993
|
this.emit("val qw = Math.cos(Math.toRadians(heading.toDouble() / 2)).toFloat()");
|
|
964
994
|
this.emit("");
|
|
965
|
-
this.emit(
|
|
995
|
+
this.emit(
|
|
996
|
+
"earthRef.resolveAnchorOnRooftopAsync(lat, lng, altOffset, qx, qy, qz, qw) { anchor, state ->"
|
|
997
|
+
);
|
|
966
998
|
this.indentLevel++;
|
|
967
999
|
this.emit("if (state == Anchor.RooftopAnchorState.SUCCESS && anchor != null) {");
|
|
968
1000
|
this.indentLevel++;
|
|
@@ -970,7 +1002,9 @@ dependencies {
|
|
|
970
1002
|
this.emit("val anchorNode = AnchorNode(anchor)");
|
|
971
1003
|
this.emit("anchorNode.setParent(arFragment.arSceneView.scene)");
|
|
972
1004
|
this.emit("");
|
|
973
|
-
this.emit(
|
|
1005
|
+
this.emit(
|
|
1006
|
+
"NodeFactory.createDefaultNode(this@" + this.options.className + "Activity) { renderable ->"
|
|
1007
|
+
);
|
|
974
1008
|
this.indentLevel++;
|
|
975
1009
|
this.emit("val node = TransformableNode(arFragment.transformationSystem)");
|
|
976
1010
|
this.emit("node.setParent(anchorNode)");
|
|
@@ -990,14 +1024,18 @@ dependencies {
|
|
|
990
1024
|
if (usesStreetscape) {
|
|
991
1025
|
this.emit("private fun processStreetscapeGeometry(session: Session) {");
|
|
992
1026
|
this.indentLevel++;
|
|
993
|
-
this.emit(
|
|
1027
|
+
this.emit(
|
|
1028
|
+
"val streetscapeGeometries = session.getAllTrackables(StreetscapeGeometry::class.java)"
|
|
1029
|
+
);
|
|
994
1030
|
this.emit("for (geometry in streetscapeGeometries) {");
|
|
995
1031
|
this.indentLevel++;
|
|
996
1032
|
this.emit("if (geometry.trackingState != TrackingState.TRACKING) continue");
|
|
997
1033
|
this.emit("");
|
|
998
1034
|
this.emit("val mesh = geometry.meshes.firstOrNull() ?: continue");
|
|
999
1035
|
this.emit("val type = geometry.type");
|
|
1000
|
-
this.emit(
|
|
1036
|
+
this.emit(
|
|
1037
|
+
'android.util.Log.d("HoloScript", "Streetscape geometry: type=$type, vertices=${mesh.vertexList.size}")'
|
|
1038
|
+
);
|
|
1001
1039
|
this.emit("");
|
|
1002
1040
|
this.emit("// Streetscape mesh available for occlusion, raycasting, or rendering");
|
|
1003
1041
|
this.emit("// Type is TERRAIN or BUILDING");
|
|
@@ -1016,7 +1054,7 @@ dependencies {
|
|
|
1016
1054
|
for (const obj of composition.objects || []) {
|
|
1017
1055
|
for (const trait of obj.traits || []) {
|
|
1018
1056
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
1019
|
-
if (
|
|
1057
|
+
if (chunkPMGODDJA_cjs.DEPTH_SCANNER_TRAITS.includes(name)) return true;
|
|
1020
1058
|
}
|
|
1021
1059
|
}
|
|
1022
1060
|
return false;
|
|
@@ -1035,9 +1073,11 @@ dependencies {
|
|
|
1035
1073
|
const hasExport = this.compositionHasTrait(composition, "depth_export");
|
|
1036
1074
|
this.emit("");
|
|
1037
1075
|
this.emit("// === Depth Scanner: ARCore depth, ToF, stereo (M.010.02b) ===");
|
|
1038
|
-
this.emit(
|
|
1039
|
-
|
|
1040
|
-
|
|
1076
|
+
this.emit(
|
|
1077
|
+
`private val depthConfidenceThreshold = ${chunkPMGODDJA_cjs.DEPTH_SCANNER_DEFAULTS.scan.confidenceThreshold}`
|
|
1078
|
+
);
|
|
1079
|
+
this.emit(`private val depthMaxMeters = ${chunkPMGODDJA_cjs.DEPTH_SCANNER_DEFAULTS.scan.maxDepthMeters}f`);
|
|
1080
|
+
this.emit(`private val depthMeshDecimation = ${chunkPMGODDJA_cjs.DEPTH_SCANNER_DEFAULTS.scan.meshDecimation}f`);
|
|
1041
1081
|
this.emit("private var depthImage: android.media.Image? = null");
|
|
1042
1082
|
if (hasConfidence) {
|
|
1043
1083
|
this.emit("private var depthConfidenceImage: android.media.Image? = null");
|
|
@@ -1106,13 +1146,17 @@ dependencies {
|
|
|
1106
1146
|
this.emit("val session = arFragment.arSceneView.session ?: return");
|
|
1107
1147
|
this.emit("");
|
|
1108
1148
|
this.emit("// Check ToF sensor availability");
|
|
1109
|
-
this.emit(
|
|
1149
|
+
this.emit(
|
|
1150
|
+
'val hasToF = packageManager.hasSystemFeature("android.hardware.sensor.proximity")'
|
|
1151
|
+
);
|
|
1110
1152
|
this.emit("");
|
|
1111
1153
|
this.emit("// Check ARCore depth support");
|
|
1112
1154
|
this.emit("val hasARCoreDepth = session.isDepthModeSupported(Config.DepthMode.AUTOMATIC)");
|
|
1113
1155
|
this.emit("");
|
|
1114
1156
|
this.emit("// Check dual camera for stereo depth");
|
|
1115
|
-
this.emit(
|
|
1157
|
+
this.emit(
|
|
1158
|
+
"val cameraManager = getSystemService(android.hardware.camera2.CameraManager::class.java)"
|
|
1159
|
+
);
|
|
1116
1160
|
this.emit("val hasStereo = (cameraManager?.cameraIdList?.size ?: 0) >= 2");
|
|
1117
1161
|
this.emit("");
|
|
1118
1162
|
this.emit("// Priority: ToF > ARCore ML > Stereo");
|
|
@@ -1124,7 +1168,9 @@ dependencies {
|
|
|
1124
1168
|
this.emit('else -> "None"');
|
|
1125
1169
|
this.indentLevel--;
|
|
1126
1170
|
this.emit("}");
|
|
1127
|
-
this.emit(
|
|
1171
|
+
this.emit(
|
|
1172
|
+
'android.util.Log.d("HoloScript", "Depth source selected: $depthSource (ToF=$hasToF, ARCore=$hasARCoreDepth, Stereo=$hasStereo)")'
|
|
1173
|
+
);
|
|
1128
1174
|
this.indentLevel--;
|
|
1129
1175
|
this.emit("}");
|
|
1130
1176
|
this.emit("");
|
|
@@ -1179,7 +1225,9 @@ dependencies {
|
|
|
1179
1225
|
this.indentLevel--;
|
|
1180
1226
|
this.emit("}");
|
|
1181
1227
|
this.emit("");
|
|
1182
|
-
this.emit(
|
|
1228
|
+
this.emit(
|
|
1229
|
+
'android.util.Log.d("HoloScript", "Depth mesh: ${vertices.size} vertices, ${indices.size / 3} triangles")'
|
|
1230
|
+
);
|
|
1183
1231
|
if (hasMeshToHolo) {
|
|
1184
1232
|
this.emit("convertMeshToHolo(vertices, indices)");
|
|
1185
1233
|
}
|
|
@@ -1204,13 +1252,15 @@ dependencies {
|
|
|
1204
1252
|
this.emit("))");
|
|
1205
1253
|
this.indentLevel--;
|
|
1206
1254
|
this.emit("}");
|
|
1207
|
-
this.emit(
|
|
1255
|
+
this.emit(
|
|
1256
|
+
'android.util.Log.d("HoloScript", "Converted ${holoEntities.size} depth points to .holo entities")'
|
|
1257
|
+
);
|
|
1208
1258
|
this.indentLevel--;
|
|
1209
1259
|
this.emit("}");
|
|
1210
1260
|
this.emit("");
|
|
1211
1261
|
}
|
|
1212
1262
|
if (hasExport) {
|
|
1213
|
-
const format =
|
|
1263
|
+
const format = chunkPMGODDJA_cjs.DEPTH_SCANNER_DEFAULTS.export.format;
|
|
1214
1264
|
this.emit("private fun exportDepthMesh(vertices: List<Vector3>, indices: List<Int>) {");
|
|
1215
1265
|
this.indentLevel++;
|
|
1216
1266
|
this.emit(`val format = "${format}"`);
|
|
@@ -1251,7 +1301,7 @@ dependencies {
|
|
|
1251
1301
|
* Check whether the composition references any npu_* scene understanding traits.
|
|
1252
1302
|
*/
|
|
1253
1303
|
hasNPUSceneTraits(composition) {
|
|
1254
|
-
const npuNames =
|
|
1304
|
+
const npuNames = chunkCAUCGUEA_cjs.NPU_SCENE_TRAITS;
|
|
1255
1305
|
for (const obj of composition.objects || []) {
|
|
1256
1306
|
for (const trait of obj.traits || []) {
|
|
1257
1307
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -1269,18 +1319,20 @@ dependencies {
|
|
|
1269
1319
|
this.indentLevel = 0;
|
|
1270
1320
|
const pkg = this.options.packageName;
|
|
1271
1321
|
const cls = this.options.className;
|
|
1272
|
-
const defaults =
|
|
1322
|
+
const defaults = chunkCAUCGUEA_cjs.NPU_SCENE_DEFAULTS;
|
|
1273
1323
|
const usedTraits = /* @__PURE__ */ new Set();
|
|
1274
1324
|
for (const obj of composition.objects || []) {
|
|
1275
1325
|
for (const trait of obj.traits || []) {
|
|
1276
1326
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
1277
|
-
if (
|
|
1327
|
+
if (chunkCAUCGUEA_cjs.NPU_SCENE_TRAITS.includes(name)) {
|
|
1278
1328
|
usedTraits.add(name);
|
|
1279
1329
|
}
|
|
1280
1330
|
}
|
|
1281
1331
|
}
|
|
1282
1332
|
this.emit("// Auto-generated by HoloScript AndroidCompiler \u2014 NPU Scene Understanding");
|
|
1283
|
-
this.emit(
|
|
1333
|
+
this.emit(
|
|
1334
|
+
`// Source: composition "${this.escapeStringValue(composition.name, "Kotlin")}"`
|
|
1335
|
+
);
|
|
1284
1336
|
this.emit("// Requires ML Kit, CameraX, NNAPI delegate");
|
|
1285
1337
|
this.emit("// Do not edit manually \u2014 regenerate from .holo source");
|
|
1286
1338
|
this.emit("");
|
|
@@ -1369,7 +1421,9 @@ dependencies {
|
|
|
1369
1421
|
this.emit(" .addOnSuccessListener { objects ->");
|
|
1370
1422
|
this.indentLevel++;
|
|
1371
1423
|
this.emit("val results = objects");
|
|
1372
|
-
this.emit(
|
|
1424
|
+
this.emit(
|
|
1425
|
+
" .filter { it.labels.isNotEmpty() && (it.labels.firstOrNull()?.confidence ?: 0f) >= confidenceThreshold }"
|
|
1426
|
+
);
|
|
1373
1427
|
this.emit(" .take(maxDetections)");
|
|
1374
1428
|
this.emit(" .map { obj ->");
|
|
1375
1429
|
this.indentLevel++;
|
|
@@ -1473,7 +1527,9 @@ dependencies {
|
|
|
1473
1527
|
if (usedTraits.has("npu_entity_pipe")) {
|
|
1474
1528
|
this.emit("// MARK: Entity Pipeline (npu_entity_pipe)");
|
|
1475
1529
|
this.emit("");
|
|
1476
|
-
this.emit(
|
|
1530
|
+
this.emit(
|
|
1531
|
+
"fun mapDetectionsToEntities(detections: List<NPUDetection>, arFragment: com.google.ar.sceneform.ux.ArFragment) {"
|
|
1532
|
+
);
|
|
1477
1533
|
this.indentLevel++;
|
|
1478
1534
|
this.emit("val scene = arFragment.arSceneView.scene");
|
|
1479
1535
|
this.emit("for (detection in detections) {");
|
|
@@ -1492,8 +1548,12 @@ dependencies {
|
|
|
1492
1548
|
this.emit(" com.google.ar.sceneform.rendering.Color(0.2f, 0.6f, 1.0f, 0.6f))");
|
|
1493
1549
|
this.emit(" .thenAccept { material ->");
|
|
1494
1550
|
this.indentLevel++;
|
|
1495
|
-
this.emit(
|
|
1496
|
-
|
|
1551
|
+
this.emit(
|
|
1552
|
+
`val renderable = com.google.ar.sceneform.rendering.ShapeFactory.makeSphere(${defaults.entityScale}f, com.google.ar.sceneform.math.Vector3.zero(), material)`
|
|
1553
|
+
);
|
|
1554
|
+
this.emit(
|
|
1555
|
+
"val node = com.google.ar.sceneform.ux.TransformableNode(arFragment.transformationSystem)"
|
|
1556
|
+
);
|
|
1497
1557
|
this.emit("node.setParent(anchorNode)");
|
|
1498
1558
|
this.emit("node.renderable = renderable");
|
|
1499
1559
|
this.emit("node.name = detection.label");
|
|
@@ -1529,7 +1589,9 @@ dependencies {
|
|
|
1529
1589
|
this.emit("val mediaImage = imageProxy.image");
|
|
1530
1590
|
this.emit("if (mediaImage != null) {");
|
|
1531
1591
|
this.indentLevel++;
|
|
1532
|
-
this.emit(
|
|
1592
|
+
this.emit(
|
|
1593
|
+
"val image = InputImage.fromMediaImage(mediaImage, imageProxy.imageInfo.rotationDegrees)"
|
|
1594
|
+
);
|
|
1533
1595
|
if (usedTraits.has("npu_classify")) {
|
|
1534
1596
|
this.emit("classifyImage(image)");
|
|
1535
1597
|
}
|
|
@@ -1584,7 +1646,9 @@ dependencies {
|
|
|
1584
1646
|
this.emit(") {");
|
|
1585
1647
|
this.indentLevel++;
|
|
1586
1648
|
this.emit("com.google.ar.sceneform.rendering.ViewRenderable.builder()");
|
|
1587
|
-
this.emit(
|
|
1649
|
+
this.emit(
|
|
1650
|
+
" .setView(arFragment.requireContext(), android.widget.TextView(arFragment.requireContext()).apply {"
|
|
1651
|
+
);
|
|
1588
1652
|
this.indentLevel++;
|
|
1589
1653
|
this.emit('text = "${detection.label} (${(detection.confidence * 100).toInt()}%)"');
|
|
1590
1654
|
this.emit("setTextColor(android.graphics.Color.WHITE)");
|
|
@@ -1598,7 +1662,9 @@ dependencies {
|
|
|
1598
1662
|
this.indentLevel++;
|
|
1599
1663
|
this.emit("val labelNode = com.google.ar.sceneform.Node()");
|
|
1600
1664
|
this.emit("labelNode.setParent(anchorNode)");
|
|
1601
|
-
this.emit(
|
|
1665
|
+
this.emit(
|
|
1666
|
+
`labelNode.localPosition = com.google.ar.sceneform.math.Vector3(0f, ${defaults.labelOffsetY}f, 0f)`
|
|
1667
|
+
);
|
|
1602
1668
|
this.emit("labelNode.renderable = renderable");
|
|
1603
1669
|
this.emit('Log.d("HoloScript", "Label overlay: ${detection.label}")');
|
|
1604
1670
|
this.indentLevel--;
|
|
@@ -1684,7 +1750,7 @@ dependencies {
|
|
|
1684
1750
|
}
|
|
1685
1751
|
// === Portal AR Methods (M.010.06) ===
|
|
1686
1752
|
hasPortalARTraits(composition) {
|
|
1687
|
-
const portalNames =
|
|
1753
|
+
const portalNames = chunkCAUCGUEA_cjs.PORTAL_AR_TRAITS;
|
|
1688
1754
|
for (const obj of composition.objects || []) {
|
|
1689
1755
|
for (const trait of obj.traits || []) {
|
|
1690
1756
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -1790,7 +1856,9 @@ dependencies {
|
|
|
1790
1856
|
this.indentLevel++;
|
|
1791
1857
|
this.emit("override fun onSensorChanged(event: SensorEvent) {");
|
|
1792
1858
|
this.indentLevel++;
|
|
1793
|
-
this.emit(
|
|
1859
|
+
this.emit(
|
|
1860
|
+
"val tiltAngle = Math.toDegrees(Math.atan2(event.values[1].toDouble(), event.values[2].toDouble())).toFloat()"
|
|
1861
|
+
);
|
|
1794
1862
|
this.emit("portalRenderer?.setPortalVisibility(Math.abs(tiltAngle) > portalTiltThreshold)");
|
|
1795
1863
|
this.indentLevel--;
|
|
1796
1864
|
this.emit("}");
|
|
@@ -1831,7 +1899,7 @@ dependencies {
|
|
|
1831
1899
|
}
|
|
1832
1900
|
// === Camera Hand Tracking Methods (M.010.04) ===
|
|
1833
1901
|
hasHandTrackingTraits(composition) {
|
|
1834
|
-
const handTraitNames =
|
|
1902
|
+
const handTraitNames = chunkCAUCGUEA_cjs.CAMERA_HAND_TRACKING_TRAITS;
|
|
1835
1903
|
for (const obj of composition.objects || []) {
|
|
1836
1904
|
for (const trait of obj.traits || []) {
|
|
1837
1905
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -1859,7 +1927,9 @@ dependencies {
|
|
|
1859
1927
|
this.emit("val options = com.google.mediapipe.solutions.hands.HandsOptions.builder()");
|
|
1860
1928
|
this.emit(` .setMaxNumHands(${maxHands})`);
|
|
1861
1929
|
this.emit(" .setStaticImageMode(false)");
|
|
1862
|
-
this.emit(
|
|
1930
|
+
this.emit(
|
|
1931
|
+
" .setRunningMode(com.google.mediapipe.solutions.hands.Hands.RUNNING_MODE_LIVE_STREAM)"
|
|
1932
|
+
);
|
|
1863
1933
|
if (hasConfidence) {
|
|
1864
1934
|
this.emit(" .setMinHandDetectionConfidence(0.7f)");
|
|
1865
1935
|
} else {
|
|
@@ -1882,15 +1952,21 @@ dependencies {
|
|
|
1882
1952
|
this.emit("");
|
|
1883
1953
|
this.emit("private fun startCameraForHandTracking() {");
|
|
1884
1954
|
this.indentLevel++;
|
|
1885
|
-
this.emit(
|
|
1955
|
+
this.emit(
|
|
1956
|
+
"val cameraProviderFuture = androidx.camera.lifecycle.ProcessCameraProvider.getInstance(this)"
|
|
1957
|
+
);
|
|
1886
1958
|
this.emit("cameraProviderFuture.addListener({");
|
|
1887
1959
|
this.indentLevel++;
|
|
1888
1960
|
this.emit("val cameraProvider = cameraProviderFuture.get()");
|
|
1889
1961
|
this.emit("val preview = androidx.camera.core.Preview.Builder().build()");
|
|
1890
1962
|
this.emit("val imageAnalysis = androidx.camera.core.ImageAnalysis.Builder()");
|
|
1891
|
-
this.emit(
|
|
1963
|
+
this.emit(
|
|
1964
|
+
" .setBackpressureStrategy(androidx.camera.core.ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)"
|
|
1965
|
+
);
|
|
1892
1966
|
this.emit(" .build()");
|
|
1893
|
-
this.emit(
|
|
1967
|
+
this.emit(
|
|
1968
|
+
"imageAnalysis.setAnalyzer(java.util.concurrent.Executors.newSingleThreadExecutor()) { imageProxy ->"
|
|
1969
|
+
);
|
|
1894
1970
|
this.indentLevel++;
|
|
1895
1971
|
this.emit("handsolution?.send(imageProxy)");
|
|
1896
1972
|
this.indentLevel--;
|
|
@@ -1903,7 +1979,9 @@ dependencies {
|
|
|
1903
1979
|
this.indentLevel--;
|
|
1904
1980
|
this.emit("}");
|
|
1905
1981
|
this.emit("");
|
|
1906
|
-
this.emit(
|
|
1982
|
+
this.emit(
|
|
1983
|
+
"private fun processHandResults(result: com.google.mediapipe.solutions.hands.HandsResult) {"
|
|
1984
|
+
);
|
|
1907
1985
|
this.indentLevel++;
|
|
1908
1986
|
this.emit("if (result.multiHandLandmarks().isEmpty()) return");
|
|
1909
1987
|
this.emit("");
|
|
@@ -1953,7 +2031,9 @@ dependencies {
|
|
|
1953
2031
|
if (hasConfidence) {
|
|
1954
2032
|
this.emit("// Filter low-confidence landmarks");
|
|
1955
2033
|
this.emit("val minConfidence = 0.7f");
|
|
1956
|
-
this.emit(
|
|
2034
|
+
this.emit(
|
|
2035
|
+
"if (thumbTip.visibility < minConfidence || indexTip.visibility < minConfidence) {"
|
|
2036
|
+
);
|
|
1957
2037
|
this.indentLevel++;
|
|
1958
2038
|
this.emit("continue");
|
|
1959
2039
|
this.indentLevel--;
|
|
@@ -2026,7 +2106,9 @@ dependencies {
|
|
|
2026
2106
|
this.emit("}");
|
|
2027
2107
|
if (hasToSpatial) {
|
|
2028
2108
|
this.emit("");
|
|
2029
|
-
this.emit(
|
|
2109
|
+
this.emit(
|
|
2110
|
+
"private fun onSpatialInput(gesture: String, handIndex: Int, x: Float, y: Float, z: Float) {"
|
|
2111
|
+
);
|
|
2030
2112
|
this.indentLevel++;
|
|
2031
2113
|
this.emit("// Bridge to HoloScript spatial_input event system");
|
|
2032
2114
|
this.emit("val event = mapOf(");
|
|
@@ -2044,7 +2126,7 @@ dependencies {
|
|
|
2044
2126
|
}
|
|
2045
2127
|
// === Spatial Authoring Methods (M.010.08) ===
|
|
2046
2128
|
hasAuthoringTraits(composition) {
|
|
2047
|
-
const authoringNames =
|
|
2129
|
+
const authoringNames = chunkPMGODDJA_cjs.SPATIAL_AUTHORING_TRAITS;
|
|
2048
2130
|
for (const obj of composition.objects || []) {
|
|
2049
2131
|
for (const trait of obj.traits || []) {
|
|
2050
2132
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -2064,25 +2146,25 @@ dependencies {
|
|
|
2064
2146
|
const hasVoice = this.compositionHasTrait(composition, "author_voice_cmd");
|
|
2065
2147
|
const hasShake = this.compositionHasTrait(composition, "author_shake_undo");
|
|
2066
2148
|
if (hasGyro) {
|
|
2067
|
-
this.emit(`private val gyroFilterAlpha = ${
|
|
2149
|
+
this.emit(`private val gyroFilterAlpha = ${chunkPMGODDJA_cjs.SPATIAL_AUTHORING_DEFAULTS.gyroFilterAlpha}f`);
|
|
2068
2150
|
this.emit("private var sensorManager: android.hardware.SensorManager? = null");
|
|
2069
2151
|
this.emit("private var rotationSensor: android.hardware.Sensor? = null");
|
|
2070
2152
|
}
|
|
2071
2153
|
if (hasPinch) {
|
|
2072
|
-
this.emit(`private val pinchScaleMin = ${
|
|
2073
|
-
this.emit(`private val pinchScaleMax = ${
|
|
2154
|
+
this.emit(`private val pinchScaleMin = ${chunkPMGODDJA_cjs.SPATIAL_AUTHORING_DEFAULTS.pinchScaleMin}f`);
|
|
2155
|
+
this.emit(`private val pinchScaleMax = ${chunkPMGODDJA_cjs.SPATIAL_AUTHORING_DEFAULTS.pinchScaleMax}f`);
|
|
2074
2156
|
this.emit("private var scaleGestureDetector: android.view.ScaleGestureDetector? = null");
|
|
2075
2157
|
}
|
|
2076
2158
|
if (hasSwipe) {
|
|
2077
2159
|
this.emit("private var gestureDetector: android.view.GestureDetector? = null");
|
|
2078
2160
|
}
|
|
2079
2161
|
if (hasVoice) {
|
|
2080
|
-
this.emit(`private val speechLocale = "${
|
|
2162
|
+
this.emit(`private val speechLocale = "${chunkPMGODDJA_cjs.SPATIAL_AUTHORING_DEFAULTS.speechLocale}"`);
|
|
2081
2163
|
this.emit("private var speechRecognizer: android.speech.SpeechRecognizer? = null");
|
|
2082
2164
|
}
|
|
2083
2165
|
if (hasShake) {
|
|
2084
|
-
this.emit(`private val shakeThreshold = ${
|
|
2085
|
-
this.emit(`private val undoStackDepth = ${
|
|
2166
|
+
this.emit(`private val shakeThreshold = ${chunkPMGODDJA_cjs.SPATIAL_AUTHORING_DEFAULTS.shakeThreshold}f`);
|
|
2167
|
+
this.emit(`private val undoStackDepth = ${chunkPMGODDJA_cjs.SPATIAL_AUTHORING_DEFAULTS.undoStackDepth}`);
|
|
2086
2168
|
this.emit("private val undoStack = ArrayDeque<() -> Unit>()");
|
|
2087
2169
|
}
|
|
2088
2170
|
return this.lines.join("\n");
|
|
@@ -2093,15 +2175,21 @@ dependencies {
|
|
|
2093
2175
|
if (this.compositionHasTrait(composition, "author_gyro_place")) {
|
|
2094
2176
|
this.emit("private fun setupGyroPlacement() {");
|
|
2095
2177
|
this.indentLevel++;
|
|
2096
|
-
this.emit(
|
|
2097
|
-
|
|
2178
|
+
this.emit(
|
|
2179
|
+
"sensorManager = getSystemService(SENSOR_SERVICE) as android.hardware.SensorManager"
|
|
2180
|
+
);
|
|
2181
|
+
this.emit(
|
|
2182
|
+
"rotationSensor = sensorManager?.getDefaultSensor(android.hardware.Sensor.TYPE_ROTATION_VECTOR)"
|
|
2183
|
+
);
|
|
2098
2184
|
this.indentLevel--;
|
|
2099
2185
|
this.emit("}");
|
|
2100
2186
|
}
|
|
2101
2187
|
if (this.compositionHasTrait(composition, "author_pinch_scale")) {
|
|
2102
2188
|
this.emit("private fun setupPinchScale() {");
|
|
2103
2189
|
this.indentLevel++;
|
|
2104
|
-
this.emit(
|
|
2190
|
+
this.emit(
|
|
2191
|
+
"scaleGestureDetector = android.view.ScaleGestureDetector(this, object : android.view.ScaleGestureDetector.SimpleOnScaleGestureListener() {"
|
|
2192
|
+
);
|
|
2105
2193
|
this.indentLevel++;
|
|
2106
2194
|
this.emit("override fun onScale(detector: android.view.ScaleGestureDetector): Boolean {");
|
|
2107
2195
|
this.indentLevel++;
|
|
@@ -2118,7 +2206,9 @@ dependencies {
|
|
|
2118
2206
|
if (this.compositionHasTrait(composition, "author_shake_undo")) {
|
|
2119
2207
|
this.emit("private fun setupShakeUndo() {");
|
|
2120
2208
|
this.indentLevel++;
|
|
2121
|
-
this.emit(
|
|
2209
|
+
this.emit(
|
|
2210
|
+
"val accelerometer = sensorManager?.getDefaultSensor(android.hardware.Sensor.TYPE_ACCELEROMETER)"
|
|
2211
|
+
);
|
|
2122
2212
|
this.emit("// Shake detection triggers undoStack.removeLastOrNull()?.invoke()");
|
|
2123
2213
|
this.indentLevel--;
|
|
2124
2214
|
this.emit("}");
|
|
@@ -2126,7 +2216,7 @@ dependencies {
|
|
|
2126
2216
|
}
|
|
2127
2217
|
// ─── Haptic Feedback (M.010.05) ─────────────────────────────────────
|
|
2128
2218
|
hasHapticTraits(composition) {
|
|
2129
|
-
const names =
|
|
2219
|
+
const names = chunkPMGODDJA_cjs.HAPTIC_FEEDBACK_TRAITS;
|
|
2130
2220
|
for (const obj of composition.objects || []) {
|
|
2131
2221
|
for (const trait of obj.traits || []) {
|
|
2132
2222
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -2141,7 +2231,9 @@ dependencies {
|
|
|
2141
2231
|
const pkg = this.options.packageName;
|
|
2142
2232
|
const cls = this.options.className;
|
|
2143
2233
|
this.emit("// Auto-generated by HoloScript AndroidCompiler \u2014 Haptic Feedback");
|
|
2144
|
-
this.emit(
|
|
2234
|
+
this.emit(
|
|
2235
|
+
`// Source: composition "${this.escapeStringValue(composition.name, "Kotlin")}"`
|
|
2236
|
+
);
|
|
2145
2237
|
this.emit("// Requires Android API 26+ (VibrationEffect)");
|
|
2146
2238
|
this.emit("");
|
|
2147
2239
|
this.emit(`package ${pkg}`);
|
|
@@ -2158,11 +2250,15 @@ dependencies {
|
|
|
2158
2250
|
this.emit("");
|
|
2159
2251
|
this.emit("private val vibrator: Vibrator = if (Build.VERSION.SDK_INT >= 31) {");
|
|
2160
2252
|
this.indentLevel++;
|
|
2161
|
-
this.emit(
|
|
2253
|
+
this.emit(
|
|
2254
|
+
"(context.getSystemService(Context.VIBRATOR_MANAGER_SERVICE) as VibratorManager).defaultVibrator"
|
|
2255
|
+
);
|
|
2162
2256
|
this.indentLevel--;
|
|
2163
2257
|
this.emit("} else {");
|
|
2164
2258
|
this.indentLevel++;
|
|
2165
|
-
this.emit(
|
|
2259
|
+
this.emit(
|
|
2260
|
+
'@Suppress("DEPRECATION") context.getSystemService(Context.VIBRATOR_SERVICE) as Vibrator'
|
|
2261
|
+
);
|
|
2166
2262
|
this.indentLevel--;
|
|
2167
2263
|
this.emit("}");
|
|
2168
2264
|
this.emit("");
|
|
@@ -2187,7 +2283,9 @@ dependencies {
|
|
|
2187
2283
|
this.emit("fun onProximity(distance: Float) {");
|
|
2188
2284
|
this.indentLevel++;
|
|
2189
2285
|
this.emit("if (!enabled) return");
|
|
2190
|
-
this.emit(
|
|
2286
|
+
this.emit(
|
|
2287
|
+
"val amplitude = ((1.0f - distance.coerceIn(0f, 1f)) * 255 * intensityMultiplier).toInt()"
|
|
2288
|
+
);
|
|
2191
2289
|
this.emit("vibrator.vibrate(VibrationEffect.createOneShot(50, amplitude.coerceIn(1, 255)))");
|
|
2192
2290
|
this.indentLevel--;
|
|
2193
2291
|
this.emit("}");
|
|
@@ -2214,7 +2312,7 @@ dependencies {
|
|
|
2214
2312
|
}
|
|
2215
2313
|
// ─── Nearby Connections (M.010.16) ──────────────────────────────────
|
|
2216
2314
|
hasNearbyTraits(composition) {
|
|
2217
|
-
const names =
|
|
2315
|
+
const names = chunkPMGODDJA_cjs.NEARBY_CONNECTIONS_TRAITS;
|
|
2218
2316
|
for (const obj of composition.objects || []) {
|
|
2219
2317
|
for (const trait of obj.traits || []) {
|
|
2220
2318
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -2229,7 +2327,9 @@ dependencies {
|
|
|
2229
2327
|
const pkg = this.options.packageName;
|
|
2230
2328
|
const cls = this.options.className;
|
|
2231
2329
|
this.emit("// Auto-generated by HoloScript AndroidCompiler \u2014 Nearby Connections");
|
|
2232
|
-
this.emit(
|
|
2330
|
+
this.emit(
|
|
2331
|
+
`// Source: composition "${this.escapeStringValue(composition.name, "Kotlin")}"`
|
|
2332
|
+
);
|
|
2233
2333
|
this.emit("// Requires Google Play Services Nearby");
|
|
2234
2334
|
this.emit("");
|
|
2235
2335
|
this.emit(`package ${pkg}`);
|
|
@@ -2253,12 +2353,16 @@ dependencies {
|
|
|
2253
2353
|
this.emit("Nearby.getConnectionsClient(context).acceptConnection(endpointId, payloadCallback)");
|
|
2254
2354
|
this.indentLevel--;
|
|
2255
2355
|
this.emit("}");
|
|
2256
|
-
this.emit(
|
|
2356
|
+
this.emit(
|
|
2357
|
+
"override fun onConnectionResult(endpointId: String, result: ConnectionResolution) {"
|
|
2358
|
+
);
|
|
2257
2359
|
this.indentLevel++;
|
|
2258
2360
|
this.emit("if (result.status.isSuccess) { connectedEndpoints.add(endpointId) }");
|
|
2259
2361
|
this.indentLevel--;
|
|
2260
2362
|
this.emit("}");
|
|
2261
|
-
this.emit(
|
|
2363
|
+
this.emit(
|
|
2364
|
+
"override fun onDisconnected(endpointId: String) { connectedEndpoints.remove(endpointId) }"
|
|
2365
|
+
);
|
|
2262
2366
|
this.indentLevel--;
|
|
2263
2367
|
this.emit("}");
|
|
2264
2368
|
this.emit("");
|
|
@@ -2269,15 +2373,21 @@ dependencies {
|
|
|
2269
2373
|
this.emit('Log.d(TAG, "Payload received from $endpointId")');
|
|
2270
2374
|
this.indentLevel--;
|
|
2271
2375
|
this.emit("}");
|
|
2272
|
-
this.emit(
|
|
2376
|
+
this.emit(
|
|
2377
|
+
"override fun onPayloadTransferUpdate(endpointId: String, update: PayloadTransferUpdate) {}"
|
|
2378
|
+
);
|
|
2273
2379
|
this.indentLevel--;
|
|
2274
2380
|
this.emit("}");
|
|
2275
2381
|
this.emit("");
|
|
2276
2382
|
if (this.compositionHasTrait(composition, "nearby_advertise")) {
|
|
2277
2383
|
this.emit("fun startAdvertising() {");
|
|
2278
2384
|
this.indentLevel++;
|
|
2279
|
-
this.emit(
|
|
2280
|
-
|
|
2385
|
+
this.emit(
|
|
2386
|
+
"val options = AdvertisingOptions.Builder().setStrategy(Strategy.P2P_CLUSTER).build()"
|
|
2387
|
+
);
|
|
2388
|
+
this.emit(
|
|
2389
|
+
'Nearby.getConnectionsClient(context).startAdvertising("HoloDevice", SERVICE_ID, connectionCallback, options)'
|
|
2390
|
+
);
|
|
2281
2391
|
this.indentLevel--;
|
|
2282
2392
|
this.emit("}");
|
|
2283
2393
|
this.emit("");
|
|
@@ -2285,15 +2395,23 @@ dependencies {
|
|
|
2285
2395
|
if (this.compositionHasTrait(composition, "nearby_discover")) {
|
|
2286
2396
|
this.emit("fun startDiscovery() {");
|
|
2287
2397
|
this.indentLevel++;
|
|
2288
|
-
this.emit(
|
|
2289
|
-
|
|
2398
|
+
this.emit(
|
|
2399
|
+
"val options = DiscoveryOptions.Builder().setStrategy(Strategy.P2P_CLUSTER).build()"
|
|
2400
|
+
);
|
|
2401
|
+
this.emit(
|
|
2402
|
+
"Nearby.getConnectionsClient(context).startDiscovery(SERVICE_ID, object : EndpointDiscoveryCallback() {"
|
|
2403
|
+
);
|
|
2290
2404
|
this.indentLevel++;
|
|
2291
2405
|
this.emit("override fun onEndpointFound(endpointId: String, info: DiscoveredEndpointInfo) {");
|
|
2292
2406
|
this.indentLevel++;
|
|
2293
|
-
this.emit(
|
|
2407
|
+
this.emit(
|
|
2408
|
+
'Nearby.getConnectionsClient(context).requestConnection("HoloDevice", endpointId, connectionCallback)'
|
|
2409
|
+
);
|
|
2294
2410
|
this.indentLevel--;
|
|
2295
2411
|
this.emit("}");
|
|
2296
|
-
this.emit(
|
|
2412
|
+
this.emit(
|
|
2413
|
+
'override fun onEndpointLost(endpointId: String) { Log.d(TAG, "Lost $endpointId") }'
|
|
2414
|
+
);
|
|
2297
2415
|
this.indentLevel--;
|
|
2298
2416
|
this.emit("}, options)");
|
|
2299
2417
|
this.indentLevel--;
|
|
@@ -2304,7 +2422,9 @@ dependencies {
|
|
|
2304
2422
|
this.emit("fun broadcast(data: ByteArray) {");
|
|
2305
2423
|
this.indentLevel++;
|
|
2306
2424
|
this.emit("val payload = Payload.fromBytes(data)");
|
|
2307
|
-
this.emit(
|
|
2425
|
+
this.emit(
|
|
2426
|
+
"connectedEndpoints.forEach { Nearby.getConnectionsClient(context).sendPayload(it, payload) }"
|
|
2427
|
+
);
|
|
2308
2428
|
this.indentLevel--;
|
|
2309
2429
|
this.emit("}");
|
|
2310
2430
|
this.emit("");
|
|
@@ -2321,7 +2441,7 @@ dependencies {
|
|
|
2321
2441
|
}
|
|
2322
2442
|
// ─── Foldable Display (M.010.17) ────────────────────────────────────
|
|
2323
2443
|
hasFoldableTraits(composition) {
|
|
2324
|
-
const names =
|
|
2444
|
+
const names = chunkPMGODDJA_cjs.FOLDABLE_DISPLAY_TRAITS;
|
|
2325
2445
|
for (const obj of composition.objects || []) {
|
|
2326
2446
|
for (const trait of obj.traits || []) {
|
|
2327
2447
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -2336,7 +2456,9 @@ dependencies {
|
|
|
2336
2456
|
const pkg = this.options.packageName;
|
|
2337
2457
|
const cls = this.options.className;
|
|
2338
2458
|
this.emit("// Auto-generated by HoloScript AndroidCompiler \u2014 Foldable Display");
|
|
2339
|
-
this.emit(
|
|
2459
|
+
this.emit(
|
|
2460
|
+
`// Source: composition "${this.escapeStringValue(composition.name, "Kotlin")}"`
|
|
2461
|
+
);
|
|
2340
2462
|
this.emit("// Requires Jetpack WindowManager");
|
|
2341
2463
|
this.emit("");
|
|
2342
2464
|
this.emit(`package ${pkg}`);
|
|
@@ -2366,9 +2488,13 @@ dependencies {
|
|
|
2366
2488
|
this.indentLevel++;
|
|
2367
2489
|
this.emit("viewModelScope.launch {");
|
|
2368
2490
|
this.indentLevel++;
|
|
2369
|
-
this.emit(
|
|
2491
|
+
this.emit(
|
|
2492
|
+
"WindowInfoTracker.getOrCreate(activity).windowLayoutInfo(activity).collect { layoutInfo ->"
|
|
2493
|
+
);
|
|
2370
2494
|
this.indentLevel++;
|
|
2371
|
-
this.emit(
|
|
2495
|
+
this.emit(
|
|
2496
|
+
"val foldingFeature = layoutInfo.displayFeatures.filterIsInstance<FoldingFeature>().firstOrNull()"
|
|
2497
|
+
);
|
|
2372
2498
|
this.emit("if (foldingFeature != null) {");
|
|
2373
2499
|
this.indentLevel++;
|
|
2374
2500
|
this.emit("_foldState.value = when (foldingFeature.state) {");
|
|
@@ -2380,7 +2506,9 @@ dependencies {
|
|
|
2380
2506
|
this.emit("}");
|
|
2381
2507
|
if (this.compositionHasTrait(composition, "foldable_hinge_angle")) {
|
|
2382
2508
|
this.emit("// Hinge angle exposed via foldingFeature orientation");
|
|
2383
|
-
this.emit(
|
|
2509
|
+
this.emit(
|
|
2510
|
+
'Log.d("HoloFoldable", "Fold state: ${foldingFeature.state}, orientation: ${foldingFeature.orientation}")'
|
|
2511
|
+
);
|
|
2384
2512
|
}
|
|
2385
2513
|
this.indentLevel--;
|
|
2386
2514
|
this.emit("}");
|
|
@@ -2392,7 +2520,9 @@ dependencies {
|
|
|
2392
2520
|
this.emit("}");
|
|
2393
2521
|
this.emit("");
|
|
2394
2522
|
if (this.compositionHasTrait(composition, "foldable_split_view")) {
|
|
2395
|
-
this.emit(
|
|
2523
|
+
this.emit(
|
|
2524
|
+
"fun isSplitViewRecommended(): Boolean = _foldState.value == FoldState.HALF_OPENED"
|
|
2525
|
+
);
|
|
2396
2526
|
this.emit("");
|
|
2397
2527
|
}
|
|
2398
2528
|
if (this.compositionHasTrait(composition, "foldable_tabletop")) {
|
|
@@ -2405,7 +2535,7 @@ dependencies {
|
|
|
2405
2535
|
}
|
|
2406
2536
|
// ─── Samsung DeX (M.010.18) ─────────────────────────────────────────
|
|
2407
2537
|
hasDexTraits(composition) {
|
|
2408
|
-
const names =
|
|
2538
|
+
const names = chunkPMGODDJA_cjs.SAMSUNG_DEX_TRAITS;
|
|
2409
2539
|
for (const obj of composition.objects || []) {
|
|
2410
2540
|
for (const trait of obj.traits || []) {
|
|
2411
2541
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -2420,7 +2550,9 @@ dependencies {
|
|
|
2420
2550
|
const pkg = this.options.packageName;
|
|
2421
2551
|
const cls = this.options.className;
|
|
2422
2552
|
this.emit("// Auto-generated by HoloScript AndroidCompiler \u2014 Samsung DeX");
|
|
2423
|
-
this.emit(
|
|
2553
|
+
this.emit(
|
|
2554
|
+
`// Source: composition "${this.escapeStringValue(composition.name, "Kotlin")}"`
|
|
2555
|
+
);
|
|
2424
2556
|
this.emit("// Samsung DeX mode detection and desktop UI transition");
|
|
2425
2557
|
this.emit("");
|
|
2426
2558
|
this.emit(`package ${pkg}`);
|
|
@@ -2440,7 +2572,9 @@ dependencies {
|
|
|
2440
2572
|
this.emit("return try {");
|
|
2441
2573
|
this.indentLevel++;
|
|
2442
2574
|
this.emit("val configClass = config.javaClass");
|
|
2443
|
-
this.emit(
|
|
2575
|
+
this.emit(
|
|
2576
|
+
'val semDesktopModeEnabled = configClass.getField("SEM_DESKTOP_MODE_ENABLED").getInt(configClass)'
|
|
2577
|
+
);
|
|
2444
2578
|
this.emit('val enabledField = configClass.getField("semDesktopModeEnabled").getInt(config)');
|
|
2445
2579
|
this.emit("enabledField == semDesktopModeEnabled");
|
|
2446
2580
|
this.indentLevel--;
|
|
@@ -2497,7 +2631,7 @@ dependencies {
|
|
|
2497
2631
|
}
|
|
2498
2632
|
// ─── Google Lens (M.010.20) ─────────────────────────────────────────
|
|
2499
2633
|
hasLensTraits(composition) {
|
|
2500
|
-
const names =
|
|
2634
|
+
const names = chunkPMGODDJA_cjs.GOOGLE_LENS_TRAITS;
|
|
2501
2635
|
for (const obj of composition.objects || []) {
|
|
2502
2636
|
for (const trait of obj.traits || []) {
|
|
2503
2637
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -2515,13 +2649,15 @@ dependencies {
|
|
|
2515
2649
|
for (const obj of composition.objects || []) {
|
|
2516
2650
|
for (const trait of obj.traits || []) {
|
|
2517
2651
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
2518
|
-
if (
|
|
2652
|
+
if (chunkPMGODDJA_cjs.GOOGLE_LENS_TRAITS.includes(name)) {
|
|
2519
2653
|
usedTraits.add(name);
|
|
2520
2654
|
}
|
|
2521
2655
|
}
|
|
2522
2656
|
}
|
|
2523
2657
|
this.emit("// Auto-generated by HoloScript AndroidCompiler \u2014 Google Lens Integration");
|
|
2524
|
-
this.emit(
|
|
2658
|
+
this.emit(
|
|
2659
|
+
`// Source: composition "${this.escapeStringValue(composition.name, "Kotlin")}"`
|
|
2660
|
+
);
|
|
2525
2661
|
this.emit("// Requires ML Kit (vision, text, translate)");
|
|
2526
2662
|
this.emit("");
|
|
2527
2663
|
this.emit(`package ${pkg}`);
|
|
@@ -2550,7 +2686,9 @@ dependencies {
|
|
|
2550
2686
|
this.emit("import com.google.mlkit.nl.translate.TranslatorOptions");
|
|
2551
2687
|
}
|
|
2552
2688
|
this.emit("");
|
|
2553
|
-
this.emit(
|
|
2689
|
+
this.emit(
|
|
2690
|
+
"data class LensDetection(val label: String, val confidence: Float, val text: String? = null)"
|
|
2691
|
+
);
|
|
2554
2692
|
this.emit("");
|
|
2555
2693
|
this.emit(`class ${cls}LensManager : ViewModel() {`);
|
|
2556
2694
|
this.indentLevel++;
|
|
@@ -2572,7 +2710,9 @@ dependencies {
|
|
|
2572
2710
|
this.indentLevel++;
|
|
2573
2711
|
this.emit("objectDetector.process(image).addOnSuccessListener { objects ->");
|
|
2574
2712
|
this.indentLevel++;
|
|
2575
|
-
this.emit(
|
|
2713
|
+
this.emit(
|
|
2714
|
+
"_detections.value = objects.flatMap { it.labels }.map { LensDetection(it.text, it.confidence) }"
|
|
2715
|
+
);
|
|
2576
2716
|
this.indentLevel--;
|
|
2577
2717
|
this.emit("}");
|
|
2578
2718
|
this.indentLevel--;
|
|
@@ -2580,7 +2720,9 @@ dependencies {
|
|
|
2580
2720
|
this.emit("");
|
|
2581
2721
|
}
|
|
2582
2722
|
if (usedTraits.has("lens_text_overlay")) {
|
|
2583
|
-
this.emit(
|
|
2723
|
+
this.emit(
|
|
2724
|
+
"private val textRecognizer by lazy { TextRecognition.getClient(TextRecognizerOptions.Builder().build()) }"
|
|
2725
|
+
);
|
|
2584
2726
|
this.emit("");
|
|
2585
2727
|
this.emit("fun recognizeText(image: InputImage) {");
|
|
2586
2728
|
this.indentLevel++;
|
|
@@ -2594,7 +2736,9 @@ dependencies {
|
|
|
2594
2736
|
this.emit("");
|
|
2595
2737
|
}
|
|
2596
2738
|
if (usedTraits.has("lens_translate")) {
|
|
2597
|
-
this.emit(
|
|
2739
|
+
this.emit(
|
|
2740
|
+
'fun translateText(text: String, targetLang: String = "es", callback: (String) -> Unit) {'
|
|
2741
|
+
);
|
|
2598
2742
|
this.indentLevel++;
|
|
2599
2743
|
this.emit("val options = TranslatorOptions.Builder()");
|
|
2600
2744
|
this.emit(" .setSourceLanguage(TranslateLanguage.ENGLISH)");
|
|
@@ -2618,7 +2762,7 @@ dependencies {
|
|
|
2618
2762
|
// Emits JavaScript/HTML — runs in Chrome on Android, no app install.
|
|
2619
2763
|
// =====================================================================
|
|
2620
2764
|
hasWebXRTraits(composition) {
|
|
2621
|
-
const names =
|
|
2765
|
+
const names = chunkPMGODDJA_cjs.WEBXR_TRAITS;
|
|
2622
2766
|
for (const obj of composition.objects || []) {
|
|
2623
2767
|
for (const trait of obj.traits || []) {
|
|
2624
2768
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
@@ -2632,7 +2776,7 @@ dependencies {
|
|
|
2632
2776
|
for (const obj of composition.objects || []) {
|
|
2633
2777
|
for (const trait of obj.traits || []) {
|
|
2634
2778
|
const name = typeof trait === "string" ? trait : trait.name;
|
|
2635
|
-
if (
|
|
2779
|
+
if (chunkPMGODDJA_cjs.WEBXR_TRAITS.includes(name)) {
|
|
2636
2780
|
usedTraits.add(name);
|
|
2637
2781
|
}
|
|
2638
2782
|
}
|
|
@@ -2666,14 +2810,22 @@ dependencies {
|
|
|
2666
2810
|
this.emit("body { margin: 0; overflow: hidden; }");
|
|
2667
2811
|
this.emit("canvas { display: block; }");
|
|
2668
2812
|
if (usedTraits.has("webxr_dom_overlay")) {
|
|
2669
|
-
this.emit(
|
|
2670
|
-
|
|
2813
|
+
this.emit(
|
|
2814
|
+
"#overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; }"
|
|
2815
|
+
);
|
|
2816
|
+
this.emit(
|
|
2817
|
+
"#overlay .ui-panel { pointer-events: auto; background: rgba(0,0,0,0.6); color: #fff; padding: 12px; border-radius: 8px; margin: 16px; font-family: sans-serif; }"
|
|
2818
|
+
);
|
|
2671
2819
|
}
|
|
2672
|
-
this.emit(
|
|
2820
|
+
this.emit(
|
|
2821
|
+
"#no-xr { display: none; padding: 20px; text-align: center; font-family: sans-serif; }"
|
|
2822
|
+
);
|
|
2673
2823
|
this.indentLevel--;
|
|
2674
2824
|
this.emit("</style>");
|
|
2675
2825
|
this.emit('<script type="importmap">');
|
|
2676
|
-
this.emit(
|
|
2826
|
+
this.emit(
|
|
2827
|
+
'{ "imports": { "three": "https://unpkg.com/three@0.160.0/build/three.module.js", "three/addons/": "https://unpkg.com/three@0.160.0/examples/jsm/" } }'
|
|
2828
|
+
);
|
|
2677
2829
|
this.emit("</script>");
|
|
2678
2830
|
this.indentLevel--;
|
|
2679
2831
|
this.emit("</head>");
|
|
@@ -2705,7 +2857,9 @@ dependencies {
|
|
|
2705
2857
|
this.emit("document.body.appendChild(renderer.domElement);");
|
|
2706
2858
|
this.emit("");
|
|
2707
2859
|
this.emit("const scene = new THREE.Scene();");
|
|
2708
|
-
this.emit(
|
|
2860
|
+
this.emit(
|
|
2861
|
+
"const camera = new THREE.PerspectiveCamera(70, window.innerWidth / window.innerHeight, 0.01, 100);"
|
|
2862
|
+
);
|
|
2709
2863
|
this.emit("");
|
|
2710
2864
|
this.emit("scene.add(new THREE.AmbientLight(0xffffff, 0.6));");
|
|
2711
2865
|
if (usedTraits.has("webxr_light_estimation")) {
|
|
@@ -2799,12 +2953,16 @@ dependencies {
|
|
|
2799
2953
|
this.emit("domOverlay: { root: document.getElementById('overlay') },");
|
|
2800
2954
|
}
|
|
2801
2955
|
if (usedTraits.has("webxr_depth_sensing")) {
|
|
2802
|
-
this.emit(
|
|
2956
|
+
this.emit(
|
|
2957
|
+
'depthSensing: { usagePreference: ["cpu-optimized"], dataFormatPreference: ["luminance-alpha"] },'
|
|
2958
|
+
);
|
|
2803
2959
|
}
|
|
2804
2960
|
this.indentLevel--;
|
|
2805
2961
|
this.emit("};");
|
|
2806
2962
|
this.emit("");
|
|
2807
|
-
this.emit(
|
|
2963
|
+
this.emit(
|
|
2964
|
+
`navigator.xr.requestSession('${sessionType}', sessionOptions).then(async (session) => {`
|
|
2965
|
+
);
|
|
2808
2966
|
this.indentLevel++;
|
|
2809
2967
|
this.emit(`const refSpace = await session.requestReferenceSpace('${refSpace}');`);
|
|
2810
2968
|
this.emit("renderer.xr.setReferenceSpace(refSpace);");
|
|
@@ -2896,7 +3054,9 @@ dependencies {
|
|
|
2896
3054
|
this.indentLevel--;
|
|
2897
3055
|
this.emit("});");
|
|
2898
3056
|
this.indentLevel--;
|
|
2899
|
-
this.emit(
|
|
3057
|
+
this.emit(
|
|
3058
|
+
"}).catch(err => { console.error('WebXR session failed:', err); document.getElementById('no-xr').style.display = 'block'; });"
|
|
3059
|
+
);
|
|
2900
3060
|
this.indentLevel--;
|
|
2901
3061
|
this.emit("</script>");
|
|
2902
3062
|
this.indentLevel--;
|
|
@@ -2911,5 +3071,5 @@ dependencies {
|
|
|
2911
3071
|
exports.AndroidCompiler_exports = AndroidCompiler_exports;
|
|
2912
3072
|
exports.compileToAndroid = compileToAndroid;
|
|
2913
3073
|
exports.init_AndroidCompiler = init_AndroidCompiler;
|
|
2914
|
-
//# sourceMappingURL=chunk-
|
|
2915
|
-
//# sourceMappingURL=chunk-
|
|
3074
|
+
//# sourceMappingURL=chunk-NCUKG4SK.cjs.map
|
|
3075
|
+
//# sourceMappingURL=chunk-NCUKG4SK.cjs.map
|