@holoscript/core 8.0.8 → 8.0.9
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/bin/holoscript.cjs +5 -1
- package/dist/GLTFPipeline-L76YTXKA.js +15 -0
- package/dist/GLTFPipeline-ZWJN7GI6.cjs +36 -0
- package/dist/HoloCompositionParser-K76KTEEE.js +12 -0
- package/dist/HoloCompositionParser-UZH6Y4HO.cjs +45 -0
- package/dist/HoloScriptCodeParser-2D4ERFUZ.js +6 -0
- package/dist/HoloScriptCodeParser-UDRLDA7I.cjs +23 -0
- package/dist/HoloScriptPlusParser-FTMCGWXD.js +13 -0
- package/dist/HoloScriptPlusParser-LQR5GIKF.cjs +30 -0
- package/dist/HoloScriptRuntime-UTRLJI5L.js +12 -0
- package/dist/HoloScriptRuntime-YBYXJHJN.cjs +21 -0
- package/dist/SceneIRCompiler-63KA3M2F.js +17 -0
- package/dist/SceneIRCompiler-KWUFHZ4O.cjs +42 -0
- package/dist/{USDZExporter-AUHZODOF.cjs → USDZExporter-ML4UMIGC.cjs} +3 -3
- package/dist/{USDZExporter-GXB4AUSG.js → USDZExporter-ZFKLQ76G.js} +3 -3
- package/dist/agents/index.cjs +1 -1
- package/dist/agents/index.js +1 -1
- package/dist/audit/AuditLogger.d.ts +106 -0
- package/dist/audit/AuditQueryBuilder.d.ts +79 -0
- package/dist/audit/ComplianceReporter.d.ts +90 -0
- package/dist/audit/index.d.ts +13 -0
- package/dist/{chunk-FGMDMJM7.js → chunk-2BYAUHBO.js} +3 -3
- package/dist/{chunk-EDPYCLRC.cjs → chunk-2E6PP5UE.cjs} +83 -59
- package/dist/{chunk-GASCWJK5.js → chunk-2EGGAZT3.js} +65 -287
- package/dist/{chunk-SIEXCILW.js → chunk-2I3XAGMF.js} +3 -3
- package/dist/{chunk-OS533P33.cjs → chunk-2KKOYZYI.cjs} +1074 -1655
- package/dist/chunk-2MQKNDNH.js +51 -0
- package/dist/{chunk-7DMMMBCY.cjs → chunk-2X3IPCBK.cjs} +10 -10
- package/dist/chunk-2ZOTBO25.cjs +202 -0
- package/dist/chunk-356N4NPM.cjs +152 -0
- package/dist/{chunk-X3GJPRVK.cjs → chunk-36NPLOI4.cjs} +92 -81
- package/dist/{chunk-SLU6UPJI.cjs → chunk-37HHY7RH.cjs} +5 -5
- package/dist/{chunk-YDPEHCCI.cjs → chunk-3CDDRUER.cjs} +3 -118
- package/dist/chunk-3F7ZZWIN.js +1651 -0
- package/dist/chunk-3ILD7TKP.cjs +187 -0
- package/dist/{chunk-X27QRG4C.cjs → chunk-3IUHTGDD.cjs} +153 -41
- package/dist/{chunk-PXNZ6TME.js → chunk-4376VHNJ.js} +60 -36
- package/dist/{chunk-YKGPCZEE.cjs → chunk-4FIBOJW6.cjs} +10 -10
- package/dist/chunk-4Q7RKQQI.cjs +14195 -0
- package/dist/{chunk-YCM6QQRT.cjs → chunk-566ZB4LZ.cjs} +180 -8
- package/dist/{chunk-2Y3V22SG.js → chunk-5CURIYGT.js} +3 -3
- package/dist/{chunk-QBWNJXNR.js → chunk-5FYMCVBY.js} +5 -5
- package/dist/{chunk-ZA34AN3R.js → chunk-5LVFTGKH.js} +841 -12
- package/dist/chunk-63AUAIL6.js +48 -0
- package/dist/chunk-655FATJU.js +110 -0
- package/dist/{chunk-TQ377OLB.cjs → chunk-65S62L4D.cjs} +28 -22
- package/dist/chunk-6NTAZN5Z.cjs +502 -0
- package/dist/chunk-6TRX6AR2.js +9376 -0
- package/dist/chunk-6ZCCLKS2.cjs +51 -0
- package/dist/{chunk-MDR235RZ.js → chunk-734OB5SK.js} +721 -8
- package/dist/{chunk-Q2Q34NF3.js → chunk-77QI552M.js} +6 -6
- package/dist/{chunk-WKX5AMOY.js → chunk-7I74JWPW.js} +3 -3
- package/dist/{chunk-5FSKKMR7.cjs → chunk-7IDJDMPU.cjs} +232 -4
- package/dist/chunk-7VBKRGIZ.cjs +847 -0
- package/dist/{chunk-KCPHASCO.js → chunk-AATYYLYK.js} +5 -5
- package/dist/{chunk-WFKVS2K4.cjs → chunk-AUZRKIHQ.cjs} +1101 -55
- package/dist/{chunk-DTGBOSEM.cjs → chunk-AWXFEAQL.cjs} +12 -12
- package/dist/{chunk-THCK6ECW.js → chunk-B3CWTCK2.js} +231 -3
- package/dist/chunk-BCP4E7MD.cjs +997 -0
- package/dist/chunk-BG7RPYJP.js +91 -0
- package/dist/{chunk-VF257YKO.js → chunk-BP4KTMLY.js} +117 -5
- package/dist/{chunk-YN6IETRZ.js → chunk-BQJ3YBF3.js} +6424 -987
- package/dist/{chunk-KOUAQL2B.cjs → chunk-CANAL6CT.cjs} +1569 -168
- package/dist/{chunk-FDSGHPAK.js → chunk-CBSDJF3B.js} +3 -3
- package/dist/{chunk-FEWUHQNM.cjs → chunk-CFVK26P4.cjs} +4 -4
- package/dist/{chunk-M7K4LE66.cjs → chunk-CI33NINL.cjs} +4 -4
- package/dist/{chunk-2OWDB4FB.js → chunk-CKV5NYAE.js} +6 -6
- package/dist/{chunk-LPS5AMQD.cjs → chunk-CM4NHXVO.cjs} +24 -24
- package/dist/chunk-D3HSRXYB.js +115 -0
- package/dist/{chunk-FNHJRI32.js → chunk-DBH3D2MU.js} +1561 -160
- package/dist/{chunk-GW3LKD5C.js → chunk-DJNH4HFW.js} +3 -3
- package/dist/{chunk-2GCNOI2U.cjs → chunk-DN6F4DHH.cjs} +9 -3
- package/dist/chunk-DQRJ5RJG.js +432 -0
- package/dist/{chunk-C7ZBSV2Q.js → chunk-DUG3OQAS.js} +106 -43
- package/dist/chunk-ECUYJOJ2.cjs +199 -0
- package/dist/chunk-EEMTCAK7.js +182 -0
- package/dist/{chunk-3SKLAUDD.cjs → chunk-EI3J6LTW.cjs} +359 -581
- package/dist/{chunk-SSSN7VAM.js → chunk-EM2OGPYE.js} +4 -4
- package/dist/{chunk-56VOWURB.cjs → chunk-ENZCIQZC.cjs} +522 -453
- package/dist/chunk-ESBXUYOC.cjs +836 -0
- package/dist/{chunk-L5U4W6JC.js → chunk-ESSEF6U2.js} +4 -4
- package/dist/chunk-ET3AN4W3.js +824 -0
- package/dist/chunk-EXKSFGSX.cjs +14 -14
- package/dist/{chunk-I76GIKN7.cjs → chunk-F3YT6GUF.cjs} +17 -17
- package/dist/{chunk-WRWEX5ZF.js → chunk-F75DZBBI.js} +3 -3
- package/dist/{chunk-4JGRWHZJ.js → chunk-FG6PYGIZ.js} +12 -6
- package/dist/chunk-FGGJQRLZ.js +14 -14
- package/dist/{chunk-SXOSDZD6.js → chunk-FWCHPCD4.js} +128 -10
- package/dist/{chunk-XW6IXEQH.cjs → chunk-G35CAQ7I.cjs} +5 -5
- package/dist/{chunk-7VMGP2FW.js → chunk-G6KACNMO.js} +132 -188
- package/dist/{chunk-FJPADH77.cjs → chunk-GAWJJAGT.cjs} +6 -6
- package/dist/chunk-GGR7QUKK.cjs +4724 -0
- package/dist/chunk-GIBF4BHH.js +14098 -0
- package/dist/{chunk-AWB7QYY6.cjs → chunk-GILYQ5VH.cjs} +6 -6
- package/dist/{chunk-FWVYAMNW.cjs → chunk-GKFCHGCM.cjs} +4 -4
- package/dist/{chunk-Y3ZFVUUU.js → chunk-GLEJ2TLS.js} +3 -3
- package/dist/{chunk-3GWWJT7L.js → chunk-GP3OKSKT.js} +13 -13
- package/dist/chunk-GTIPOEHN.js +196 -0
- package/dist/{chunk-LMJ5EBV7.cjs → chunk-GZPUA2TL.cjs} +16 -15
- package/dist/{chunk-IELX2OKI.js → chunk-H4LJ4HEA.js} +3 -115
- package/dist/{chunk-ACVWFGBI.cjs → chunk-HCX4SMFK.cjs} +3 -3
- package/dist/{chunk-HYNTS5CP.js → chunk-HHRZ6STP.js} +24 -2
- package/dist/chunk-HIDEIEFG.js +48 -0
- package/dist/{chunk-W6RW64BB.cjs → chunk-HSWBIDZM.cjs} +228 -5
- package/dist/{chunk-GSOUNWEL.js → chunk-HVX7QQYK.js} +1035 -1616
- package/dist/{chunk-TRCGG42I.cjs → chunk-IFW5IW4L.cjs} +6502 -1019
- package/dist/{chunk-F5LKJ6F5.cjs → chunk-IJU6AS67.cjs} +32 -28
- package/dist/{chunk-TVANHNJ7.js → chunk-IK6Z2HNC.js} +173 -3
- package/dist/{chunk-QGMUTVVH.cjs → chunk-IS7NTKY5.cjs} +20 -20
- package/dist/{chunk-YFVQWSNJ.js → chunk-IXWGYWH6.js} +3 -3
- package/dist/chunk-J2DAS2PL.js +148 -0
- package/dist/chunk-JBQXZIWB.js +148 -0
- package/dist/chunk-JBYBMBMW.js +261 -0
- package/dist/{chunk-LWUOUCYL.js → chunk-JEJ7TT54.js} +5 -5
- package/dist/{chunk-DUCB6LGL.js → chunk-JOTCTHN5.js} +211 -5
- package/dist/{chunk-47RUFYKR.js → chunk-K56UVEXV.js} +3 -3
- package/dist/{chunk-XSFNHP2E.js → chunk-KB26H447.js} +3 -3
- package/dist/{chunk-3NGDZZR4.js → chunk-KEYG7HGY.js} +430 -37
- package/dist/{chunk-DY72BMU5.js → chunk-KFVNCW4Q.js} +4 -4
- package/dist/chunk-KPGC7SK2.js +192 -0
- package/dist/chunk-KROXXBK5.cjs +53 -0
- package/dist/{chunk-ZPZAVHXL.cjs → chunk-LB3ZZMKT.cjs} +137 -19
- package/dist/chunk-LDYZWNJW.cjs +1654 -0
- package/dist/{chunk-ULMSSHCJ.cjs → chunk-LMB555QB.cjs} +405 -38
- package/dist/{chunk-CBJY23VL.js → chunk-MD4IVS42.js} +3 -3
- package/dist/{chunk-VMLKSV26.js → chunk-MDDWEBCX.js} +226 -3
- package/dist/chunk-MUWH4QK5.cjs +94 -0
- package/dist/{chunk-T6W3Z3SH.cjs → chunk-N2ILK7BF.cjs} +4 -4
- package/dist/{chunk-6EX3I5P4.cjs → chunk-N74QRJGP.cjs} +6 -6
- package/dist/chunk-NFFHLX37.cjs +132 -0
- package/dist/chunk-NJSYWX7H.js +190 -0
- package/dist/{chunk-SH5PPVK7.cjs → chunk-NQN5LFN4.cjs} +165 -221
- package/dist/chunk-NTQRFOPP.cjs +56 -0
- package/dist/{chunk-YFWRJW4B.js → chunk-NWMJPTVL.js} +51 -55
- package/dist/{chunk-63ZGNR2T.cjs → chunk-OC6GV5QH.cjs} +42 -42
- package/dist/{chunk-7E7GCQCK.js → chunk-OG3MBHM3.js} +9 -3
- package/dist/chunk-OMNHTCS4.cjs +264 -0
- package/dist/chunk-OQXB6NNC.cjs +117 -0
- package/dist/{chunk-Y57W2CT5.cjs → chunk-OV46CCA2.cjs} +51 -55
- package/dist/{chunk-6PRZIHGL.cjs → chunk-OV6HHKLE.cjs} +21 -266
- package/dist/{chunk-C37BHB7N.cjs → chunk-P26YYPOO.cjs} +5 -5
- package/dist/{chunk-2BZHWUSR.cjs → chunk-P7JEKJTZ.cjs} +16 -16
- package/dist/{chunk-NGBXXZLL.cjs → chunk-PDXX5UI4.cjs} +45 -45
- package/dist/{chunk-FHQFPYV4.js → chunk-PJFTTSKE.js} +8 -7
- package/dist/{chunk-GVFJ6T4S.cjs → chunk-PVODJEJ7.cjs} +721 -8
- package/dist/{chunk-ZZ7RO2UQ.js → chunk-Q265VZJ4.js} +3 -3
- package/dist/{chunk-E7JP3BS3.cjs → chunk-Q47JEE2C.cjs} +4 -4
- package/dist/chunk-QBY7LRN2.js +281 -0
- package/dist/{chunk-Z6PMDS4G.js → chunk-QDQWKSU3.js} +1090 -53
- package/dist/{chunk-GH6C2QGW.cjs → chunk-QEDMOGF3.cjs} +857 -16
- package/dist/{chunk-5WUNN6ZN.cjs → chunk-QHSAVOOL.cjs} +24 -2
- package/dist/chunk-QJNCDVYM.cjs +137 -0
- package/dist/chunk-QM7FJB5W.js +4717 -0
- package/dist/chunk-QQFB4RT2.cjs +448 -0
- package/dist/chunk-QSYBHQAD.cjs +196 -0
- package/dist/{chunk-UGXHYIWT.cjs → chunk-QUJ3ZB55.cjs} +28 -28
- package/dist/{chunk-2YSNA2F2.cjs → chunk-QVJMDVYZ.cjs} +5 -5
- package/dist/chunk-RAJMAX6D.js +131 -0
- package/dist/{chunk-VVKVQZI6.js → chunk-RAN3ECAS.js} +3 -3
- package/dist/chunk-RKGUZBOC.js +79 -0
- package/dist/{chunk-HLFDZ35S.cjs → chunk-RRQIAJLQ.cjs} +8 -8
- package/dist/{chunk-PABONWKI.js → chunk-RXQNRZ5F.js} +3 -3
- package/dist/{chunk-7ZHYEITD.cjs → chunk-S4O7CFHQ.cjs} +10 -11
- package/dist/chunk-SE7ANBGN.js +128 -0
- package/dist/{chunk-X2AVEAZM.cjs → chunk-SJIRCTIS.cjs} +176 -2
- package/dist/{chunk-WXQ57LAO.js → chunk-SQXAZHDG.js} +4 -4
- package/dist/chunk-SR73L5ZP.cjs +84 -0
- package/dist/{chunk-OABEO6HH.js → chunk-SZOLTWWD.js} +2349 -214
- package/dist/{chunk-5JEU52DW.js → chunk-TPZ3BN2D.js} +3 -3
- package/dist/{chunk-QFU53KRH.js → chunk-TSTFYGGX.js} +4 -5
- package/dist/{chunk-EBS32AJI.cjs → chunk-TZCFKZ6Z.cjs} +5 -5
- package/dist/chunk-UCVZXQ63.js +724 -0
- package/dist/chunk-UGQ3QNV6.js +992 -0
- package/dist/chunk-UNMVGZVW.js +142 -0
- package/dist/{chunk-TEVX443G.js → chunk-UTUD6GJI.js} +178 -6
- package/dist/chunk-UXBYA7DV.cjs +155 -0
- package/dist/chunk-V6GXFSK7.cjs +443 -0
- package/dist/chunk-VHORVGCG.cjs +761 -0
- package/dist/{chunk-B4EKV6HQ.js → chunk-VKCTYLDN.js} +500 -442
- package/dist/{chunk-O3MGZDCT.cjs → chunk-VTEXJOSD.cjs} +63 -63
- package/dist/chunk-VVAAZITA.cjs +287 -0
- package/dist/{chunk-V7AKE5VT.cjs → chunk-W2GA3EQB.cjs} +435 -42
- package/dist/chunk-W4GABFCR.js +37 -0
- package/dist/chunk-WKEK4NCA.js +490 -0
- package/dist/{chunk-5A4TCHOC.cjs → chunk-WNYXT4TE.cjs} +4 -4
- package/dist/{chunk-S762UEV5.js → chunk-WTH23ISI.js} +6 -6
- package/dist/{chunk-BTKZGHAV.js → chunk-WWNCM473.js} +10 -6
- package/dist/{chunk-7X5PNIQJ.js → chunk-X3YFRH6K.js} +27 -25
- package/dist/{chunk-4YNYPHH3.cjs → chunk-X75H75UY.cjs} +2351 -213
- package/dist/{chunk-LYJJI7ZK.cjs → chunk-XCUDDFKC.cjs} +216 -9
- package/dist/chunk-YAO4HPJL.cjs +120 -0
- package/dist/chunk-YKY2JBER.cjs +9443 -0
- package/dist/chunk-YP5CHEYU.cjs +154 -0
- package/dist/{chunk-WRNEH5MO.js → chunk-YW3I2FQL.js} +18 -7
- package/dist/{chunk-BRNUPDHJ.js → chunk-Z557DVYN.js} +386 -19
- package/dist/{chunk-VSACG2AR.js → chunk-Z6LZUYZF.js} +21 -264
- package/dist/chunk-ZHPMP447.cjs +43 -0
- package/dist/{chunk-LODTHGST.cjs → chunk-ZK7KX5CD.cjs} +133 -70
- package/dist/{chunk-CCPSNT6B.cjs → chunk-ZRPALBQB.cjs} +5 -5
- package/dist/chunk-ZVFHPMC5.js +824 -0
- package/dist/chunk-ZVQMKUGJ.js +443 -0
- package/dist/cli/holoscript-runner.cjs +86 -48
- package/dist/cli/holoscript-runner.js +54 -16
- package/dist/codebase/index.cjs +1 -1
- package/dist/codebase/index.js +1 -1
- package/dist/compiler/agent-inference.cjs +11 -11
- package/dist/compiler/agent-inference.js +9 -6
- package/dist/compiler/android-xr.cjs +13 -12
- package/dist/compiler/android-xr.js +11 -10
- package/dist/compiler/android.cjs +12 -12
- package/dist/compiler/android.js +10 -10
- package/dist/compiler/business-quest.cjs +10 -10
- package/dist/compiler/business-quest.js +2 -2
- package/dist/compiler/coco.cjs +1 -1
- package/dist/compiler/coco.js +1 -1
- package/dist/compiler/context.cjs +9 -9
- package/dist/compiler/context.js +6 -6
- package/dist/compiler/daimon-seed.cjs +36 -0
- package/dist/compiler/daimon-seed.js +12 -0
- package/dist/compiler/domain-block-utils.cjs +205 -156
- package/dist/compiler/domain-block-utils.js +8 -7
- package/dist/compiler/dtdl.cjs +10 -10
- package/dist/compiler/dtdl.js +7 -7
- package/dist/compiler/gltf-pipeline.cjs +9 -9
- package/dist/compiler/gltf-pipeline.js +2 -2
- package/dist/compiler/godot.cjs +10 -9
- package/dist/compiler/godot.js +9 -8
- package/dist/compiler/incremental.cjs +11 -11
- package/dist/compiler/incremental.js +6 -6
- package/dist/compiler/index.cjs +2585 -3273
- package/dist/compiler/index.d.ts +149 -35
- package/dist/compiler/index.js +2197 -3102
- package/dist/compiler/ios.cjs +11 -11
- package/dist/compiler/ios.js +9 -9
- package/dist/compiler/llm-provider-capabilities.cjs +9 -9
- package/dist/compiler/llm-provider-capabilities.js +6 -6
- package/dist/compiler/nodetoy.cjs +1 -1
- package/dist/compiler/nodetoy.js +1 -1
- package/dist/compiler/openxr.cjs +11 -10
- package/dist/compiler/openxr.js +10 -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 +11 -10
- package/dist/compiler/sdf.js +9 -8
- package/dist/compiler/semantic-scene.cjs +7 -7
- package/dist/compiler/semantic-scene.js +2 -2
- package/dist/compiler/state.cjs +9 -9
- package/dist/compiler/state.js +7 -7
- package/dist/compiler/trait-composition.cjs +11 -11
- package/dist/compiler/trait-composition.js +7 -7
- package/dist/compiler/traits/ProvenanceSemiring.d.ts +167 -0
- package/dist/compiler/traits/Semiring.d.ts +26 -0
- package/dist/compiler/unity.cjs +11 -10
- package/dist/compiler/unity.js +10 -9
- package/dist/compiler/unreal.cjs +12 -11
- package/dist/compiler/unreal.js +10 -9
- package/dist/compiler/urdf.cjs +18 -17
- package/dist/compiler/urdf.js +9 -8
- package/dist/compiler/usd-physics.cjs +11 -10
- package/dist/compiler/usd-physics.js +8 -7
- package/dist/compiler/visionos.cjs +11 -10
- package/dist/compiler/visionos.js +10 -9
- package/dist/compiler/vrchat.cjs +11 -10
- package/dist/compiler/vrchat.js +9 -8
- package/dist/compiler/wasm.cjs +14 -13
- package/dist/compiler/wasm.js +9 -8
- package/dist/compiler/webgpu.cjs +10 -9
- package/dist/compiler/webgpu.js +9 -8
- package/dist/constants.cjs +398 -0
- package/dist/constants.js +9 -0
- package/dist/coordinators/index.cjs +4 -1
- package/dist/coordinators/index.js +4 -1
- package/dist/debugger.cjs +11 -9
- package/dist/debugger.js +9 -7
- package/dist/{dist-ACXG6IH5.cjs → dist-GRMOP2UL.cjs} +341 -65
- package/dist/{dist-VD4L6V7Q.js → dist-ZBUKU2JG.js} +333 -63
- package/dist/entries/interop.cjs +23 -23
- package/dist/entries/interop.js +3 -3
- package/dist/entries/scripting.cjs +12 -11
- package/dist/entries/scripting.js +8 -7
- package/dist/evolution/index.cjs +66 -0
- package/dist/evolution/index.d.ts +162 -0
- package/dist/evolution/index.js +17 -0
- package/dist/hololand/index.cjs +41 -37
- package/dist/hololand/index.js +3 -3
- package/dist/index.cjs +12394 -3224
- package/dist/index.d.ts +260 -18
- package/dist/index.js +10755 -2182
- package/dist/keyword-registry/PluginKeywordRegistry.d.ts +138 -0
- package/dist/keyword-registry/index.cjs +29 -0
- package/dist/keyword-registry/index.d.ts +1 -0
- package/dist/keyword-registry/index.js +4 -0
- package/dist/math/tropical-spmv.cjs +11 -11
- package/dist/math/tropical-spmv.d.ts +1 -0
- package/dist/math/tropical-spmv.js +2 -2
- package/dist/math/tropicalSpmv.d.ts +43 -0
- package/dist/math/vec3.cjs +1 -1
- package/dist/math/vec3.js +1 -1
- package/dist/matter/StagedMatter.d.ts +82 -0
- package/dist/matter/index.cjs +17 -0
- package/dist/matter/index.d.ts +1 -0
- package/dist/matter/index.js +4 -0
- package/dist/{ml-dsa-Z7JDKW4L.js → ml-dsa-J6VKVT4K.js} +3 -3
- package/dist/{ml-dsa-FSKBTE3W.cjs → ml-dsa-MTIK4ZUQ.cjs} +23 -23
- package/dist/paper-0c-spike/index.cjs +1 -1
- package/dist/paper-0c-spike/index.js +1 -1
- package/dist/parameter-envelope/ParameterEnvelope.d.ts +128 -0
- package/dist/parameter-envelope/index.cjs +17 -0
- package/dist/parameter-envelope/index.d.ts +2 -0
- package/dist/parameter-envelope/index.js +4 -0
- package/dist/parser/HoloCompositionTypes.d.ts +2013 -0
- package/dist/parser/PipelineParser.d.ts +162 -0
- package/dist/parser.cjs +36 -20
- package/dist/parser.js +13 -9
- package/dist/plugin-manifest/ManifestAutoLoader.d.ts +35 -0
- package/dist/plugin-manifest/PluginManifest.d.ts +156 -0
- package/dist/plugin-manifest/index.cjs +25 -0
- package/dist/plugin-manifest/index.d.ts +2 -0
- package/dist/plugin-manifest/index.js +4 -0
- package/dist/plugin-solver-contract/PluginSolverContract.d.ts +288 -0
- package/dist/plugin-solver-contract/index.cjs +41 -0
- package/dist/plugin-solver-contract/index.d.ts +1 -0
- package/dist/plugin-solver-contract/index.js +4 -0
- package/dist/policy/ContentPolicyGate.d.ts +51 -0
- package/dist/policy/PolicyPack.d.ts +120 -0
- package/dist/policy/blocklist.d.ts +32 -0
- package/dist/policy/defaults.d.ts +44 -0
- package/dist/policy/index.cjs +106 -0
- package/dist/policy/index.d.ts +17 -0
- package/dist/policy/index.js +5 -0
- package/dist/policy/jsonLogic.d.ts +31 -0
- package/dist/policy/types.d.ts +174 -0
- package/dist/proof-composition/ProofCompositionLaw.d.ts +93 -0
- package/dist/proof-composition/index.cjs +25 -0
- package/dist/proof-composition/index.d.ts +1 -0
- package/dist/proof-composition/index.js +4 -0
- package/dist/receipts/hash-policy.d.ts +85 -0
- package/dist/reconstruction/index.cjs +75 -47
- package/dist/reconstruction/index.js +5 -5
- package/dist/runtime/plugin-trait-registrar.d.ts +36 -0
- package/dist/runtime.cjs +81 -79
- package/dist/runtime.js +9 -7
- package/dist/scene-presets-EDKYZ5GW.js +4 -0
- package/dist/scene-presets-NCW2CFRS.cjs +17 -0
- package/dist/self-improvement/index.cjs +1 -1
- package/dist/self-improvement/index.js +1 -1
- package/dist/{src-PT2FERDV.cjs → src-G3D7ZATQ.cjs} +545 -21
- package/dist/{src-J6CM4AUR.js → src-UXYA7HM6.js} +539 -16
- package/dist/storage/index.cjs +10 -10
- package/dist/storage/index.js +3 -3
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +1 -1
- package/dist/tools/index.cjs +3631 -0
- package/dist/tools/index.js +3581 -0
- package/dist/traitDocs/traitDocs.cjs +9 -9
- package/dist/traitDocs/traitDocs.d.ts +1 -0
- package/dist/traitDocs/traitDocs.js +3 -3
- package/dist/traits/ControlLoopTrait.d.ts +154 -0
- package/dist/traits/KinematicChainTrait.d.ts +116 -0
- package/dist/traits/SensorSamplingTrait.d.ts +154 -0
- package/dist/traits/TraitTypes.d.ts +270 -0
- package/dist/traits/TransactionTrait.d.ts +121 -0
- package/dist/traits/botanical-lotus.cjs +54 -50
- package/dist/traits/botanical-lotus.js +2 -5
- package/dist/traits/control-loop.cjs +21 -0
- package/dist/traits/control-loop.d.ts +1 -0
- package/dist/traits/control-loop.js +4 -0
- package/dist/traits/engines/cloth-verlet.d.ts +65 -0
- package/dist/traits/engines/index.cjs +19 -19
- package/dist/traits/engines/index.d.ts +15 -275
- package/dist/traits/engines/index.js +3 -3
- package/dist/traits/engines/motion-data-schema.d.ts +119 -0
- package/dist/traits/engines/motion-matching.d.ts +102 -0
- package/dist/traits/engines/noise.d.ts +25 -0
- package/dist/traits/engines/onnx-adapter.d.ts +173 -0
- package/dist/traits/engines/onnx-motion-matching.d.ts +163 -0
- package/dist/traits/engines/pfnn-network.d.ts +92 -0
- package/dist/traits/engines/synthetic-walk-cycle.d.ts +38 -0
- package/dist/traits/engines/tensor-ops.d.ts +15 -0
- package/dist/traits/index.cjs +2789 -1259
- package/dist/traits/index.d.ts +35 -0
- package/dist/traits/index.js +1692 -411
- package/dist/traits/kinematic-chain.cjs +25 -0
- package/dist/traits/kinematic-chain.d.ts +1 -0
- package/dist/traits/kinematic-chain.js +4 -0
- package/dist/traits/sensor-sampling.cjs +33 -0
- package/dist/traits/sensor-sampling.d.ts +1 -0
- package/dist/traits/sensor-sampling.js +4 -0
- package/dist/traits/simulation-solver-factory.cjs +1 -1
- package/dist/traits/simulation-solver-factory.js +1 -1
- package/dist/traits/transaction.cjs +29 -0
- package/dist/traits/transaction.d.ts +1 -0
- package/dist/traits/transaction.js +4 -0
- package/dist/traits/webcam-gaze.cjs +1 -1
- package/dist/traits/webcam-gaze.js +1 -1
- package/dist/type-checker.cjs +7 -6
- package/dist/type-checker.js +5 -4
- package/dist/types/AdvancedTypeSystem.d.ts +489 -0
- package/dist/types/HoloScriptPlus.d.ts +810 -0
- package/dist/types/base.d.ts +248 -0
- package/dist/types.d.ts +799 -0
- package/dist/world/index.cjs +3 -4
- package/dist/world/index.js +3 -4
- package/dist/world-model/index.cjs +1 -1
- package/dist/world-model/index.js +1 -1
- package/dist/wot/index.cjs +1 -1
- package/dist/wot/index.js +1 -1
- package/package.json +113 -46
- package/dist/GLTFPipeline-3EJLL3TS.cjs +0 -38
- package/dist/GLTFPipeline-3OWJV2VK.js +0 -17
- package/dist/HoloScriptPlusParser-ADWRY5OS.cjs +0 -698
- package/dist/HoloScriptPlusParser-JLJDXHSC.js +0 -693
- package/dist/HoloScriptPlusParser-QCGFPWIL.cjs +0 -27
- package/dist/HoloScriptPlusParser-WENAFEFV.js +0 -10
- package/dist/HoloScriptRuntime-GGRVEU4T.cjs +0 -19
- package/dist/HoloScriptRuntime-GJK6VJPH.js +0 -10
- package/dist/chunk-22Q5A6RV.js +0 -979
- package/dist/chunk-4C57PR42.js +0 -468
- package/dist/chunk-4W5G5QVL.cjs +0 -847
- package/dist/chunk-5ET6L4NS.js +0 -487
- package/dist/chunk-C4GSLCHE.cjs +0 -7153
- package/dist/chunk-F2G6CWFT.js +0 -7089
- package/dist/chunk-G6PNEASF.cjs +0 -814
- package/dist/chunk-GTA4Q3A3.js +0 -1491
- package/dist/chunk-HCCQLAA4.cjs +0 -74
- package/dist/chunk-HFSVMKM3.cjs +0 -72
- package/dist/chunk-KAIVDEIG.cjs +0 -4539
- package/dist/chunk-KQU64CIX.cjs +0 -1508
- package/dist/chunk-MSYSQ2AJ.js +0 -4533
- package/dist/chunk-NHJLP37F.js +0 -70
- package/dist/chunk-NHYRRAGI.cjs +0 -490
- package/dist/chunk-OIQYIIO3.cjs +0 -473
- package/dist/chunk-OL46QLBJ.js +0 -61
- package/dist/chunk-SKZPC5AG.cjs +0 -984
- package/dist/chunk-SLHLXUMO.js +0 -445
- package/dist/chunk-UOIGFQXC.cjs +0 -9750
- package/dist/chunk-UOL6Y5TD.cjs +0 -759
- package/dist/chunk-UVFI7XIR.cjs +0 -452
- package/dist/chunk-VEPGBETF.js +0 -844
- package/dist/chunk-XQ5MWMP2.js +0 -756
- package/dist/chunk-XT6JY5W5.js +0 -9684
- package/dist/chunk-YRRAUB35.js +0 -811
- package/dist/compiler/GasOptimizationAnalyzer.d.ts +0 -73
- package/dist/compiler/NFTMarketplaceCompiler.d.ts +0 -23
- package/dist/compiler/ar.cjs +0 -23
- package/dist/compiler/ar.js +0 -11
- package/dist/compiler/babylon.cjs +0 -21
- package/dist/compiler/babylon.js +0 -15
- package/dist/compiler/multi-layer.cjs +0 -24
- package/dist/compiler/multi-layer.js +0 -15
- package/dist/compiler/playcanvas.cjs +0 -19
- package/dist/compiler/playcanvas.js +0 -13
- package/dist/compiler/r3f.cjs +0 -39
- package/dist/compiler/r3f.d.ts +0 -22
- package/dist/compiler/r3f.js +0 -17
- package/dist/compiler/vrr.cjs +0 -24
- package/dist/compiler/vrr.js +0 -12
- package/dist/parser/NFTMarketplaceTypes.d.ts +0 -191
- package/dist/playwright-3AT3AKTV.cjs +0 -98673
- package/dist/playwright-VZPDVUEQ.js +0 -98660
package/dist/chunk-UOL6Y5TD.cjs
DELETED
|
@@ -1,759 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunkOIQYIIO3_cjs = require('./chunk-OIQYIIO3.cjs');
|
|
4
|
-
var chunkGH6C2QGW_cjs = require('./chunk-GH6C2QGW.cjs');
|
|
5
|
-
var chunkLODTHGST_cjs = require('./chunk-LODTHGST.cjs');
|
|
6
|
-
var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
|
|
7
|
-
var ans = require('@holoscript/core-types/ans');
|
|
8
|
-
|
|
9
|
-
// src/compiler/PlayCanvasCompiler.ts
|
|
10
|
-
var PlayCanvasCompiler_exports = {};
|
|
11
|
-
chunkHCCQLAA4_cjs.__export(PlayCanvasCompiler_exports, {
|
|
12
|
-
PlayCanvasCompiler: () => exports.PlayCanvasCompiler
|
|
13
|
-
});
|
|
14
|
-
var SHAPE_TO_PRIMITIVE; exports.PlayCanvasCompiler = void 0;
|
|
15
|
-
var init_PlayCanvasCompiler = chunkHCCQLAA4_cjs.__esm({
|
|
16
|
-
"src/compiler/PlayCanvasCompiler.ts"() {
|
|
17
|
-
chunkOIQYIIO3_cjs.init_TraitCompositor();
|
|
18
|
-
chunkLODTHGST_cjs.init_CompilerBase();
|
|
19
|
-
chunkGH6C2QGW_cjs.init_DomainBlockCompilerMixin();
|
|
20
|
-
SHAPE_TO_PRIMITIVE = {
|
|
21
|
-
sphere: "sphere",
|
|
22
|
-
orb: "sphere",
|
|
23
|
-
cube: "box",
|
|
24
|
-
box: "box",
|
|
25
|
-
cylinder: "cylinder",
|
|
26
|
-
cone: "cone",
|
|
27
|
-
pyramid: "cone",
|
|
28
|
-
plane: "plane",
|
|
29
|
-
ground: "plane",
|
|
30
|
-
torus: "torus",
|
|
31
|
-
ring: "torus",
|
|
32
|
-
capsule: "capsule",
|
|
33
|
-
disc: "plane"
|
|
34
|
-
};
|
|
35
|
-
exports.PlayCanvasCompiler = class extends chunkLODTHGST_cjs.CompilerBase {
|
|
36
|
-
constructor(options = {}) {
|
|
37
|
-
super();
|
|
38
|
-
this.compilerName = "PlayCanvasCompiler";
|
|
39
|
-
this.lines = [];
|
|
40
|
-
this.indentLevel = 0;
|
|
41
|
-
this.options = {
|
|
42
|
-
className: options.className || "GeneratedScene",
|
|
43
|
-
enablePhysics: options.enablePhysics ?? true,
|
|
44
|
-
enableXR: options.enableXR ?? false,
|
|
45
|
-
indent: options.indent || " ",
|
|
46
|
-
provenanceHash: options.provenanceHash ?? ""
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
getRequiredCapability() {
|
|
50
|
-
return ans.ANSCapabilityPath.PLAYCANVAS;
|
|
51
|
-
}
|
|
52
|
-
compile(composition, agentToken, outputPath) {
|
|
53
|
-
this.validateCompilerAccess(agentToken, outputPath);
|
|
54
|
-
this.lines = [];
|
|
55
|
-
this.indentLevel = 0;
|
|
56
|
-
this.emit("// Auto-generated by HoloScript PlayCanvasCompiler");
|
|
57
|
-
this.emit(
|
|
58
|
-
`// Source: composition "${this.escapeStringValue(composition.name, "TypeScript")}"`
|
|
59
|
-
);
|
|
60
|
-
if (this.options.provenanceHash) {
|
|
61
|
-
this.emit(`// Provenance Hash: ${this.options.provenanceHash}`);
|
|
62
|
-
}
|
|
63
|
-
this.emit("");
|
|
64
|
-
this.emitImports(composition);
|
|
65
|
-
this.emit("");
|
|
66
|
-
this.emit(`export class ${this.options.className} {`);
|
|
67
|
-
this.indent();
|
|
68
|
-
this.emit("private app: pc.Application;");
|
|
69
|
-
this.emit("private canvas: HTMLCanvasElement;");
|
|
70
|
-
this.emit("");
|
|
71
|
-
this.emit("constructor(canvas: HTMLCanvasElement) {");
|
|
72
|
-
this.indent();
|
|
73
|
-
this.emit("this.canvas = canvas;");
|
|
74
|
-
this.emit("this.app = new pc.Application(canvas, {");
|
|
75
|
-
this.indent();
|
|
76
|
-
this.emit("mouse: new pc.Mouse(canvas),");
|
|
77
|
-
this.emit("touch: new pc.TouchDevice(canvas),");
|
|
78
|
-
this.emit("keyboard: new pc.Keyboard(window),");
|
|
79
|
-
this.dedent();
|
|
80
|
-
this.emit("});");
|
|
81
|
-
this.emit("this.app.setCanvasFillMode(pc.FILLMODE_FILL_WINDOW);");
|
|
82
|
-
this.emit("this.app.setCanvasResolution(pc.RESOLUTION_AUTO);");
|
|
83
|
-
this.dedent();
|
|
84
|
-
this.emit("}");
|
|
85
|
-
this.emit("");
|
|
86
|
-
this.emit("async build(): Promise<void> {");
|
|
87
|
-
this.indent();
|
|
88
|
-
this.emitSceneSetup(composition);
|
|
89
|
-
if (composition.environment) this.emitEnvironment(composition.environment);
|
|
90
|
-
if (composition.lights?.length) {
|
|
91
|
-
for (const light of composition.lights) this.emitLight(light);
|
|
92
|
-
} else {
|
|
93
|
-
this.emit("// Default light");
|
|
94
|
-
this.emit('const defaultLight = new pc.Entity("defaultLight");');
|
|
95
|
-
this.emit('defaultLight.addComponent("light", {');
|
|
96
|
-
this.indent();
|
|
97
|
-
this.emit('type: "directional",');
|
|
98
|
-
this.emit("color: new pc.Color(1, 1, 1),");
|
|
99
|
-
this.emit("intensity: 0.7,");
|
|
100
|
-
this.emit("castShadows: true,");
|
|
101
|
-
this.dedent();
|
|
102
|
-
this.emit("});");
|
|
103
|
-
this.emit("defaultLight.setEulerAngles(45, 30, 0);");
|
|
104
|
-
this.emit("this.app.root.addChild(defaultLight);");
|
|
105
|
-
this.emit("");
|
|
106
|
-
}
|
|
107
|
-
if (composition.camera) this.emitCamera(composition.camera);
|
|
108
|
-
else {
|
|
109
|
-
this.emit("// Default camera");
|
|
110
|
-
this.emit('const camera = new pc.Entity("defaultCamera");');
|
|
111
|
-
this.emit('camera.addComponent("camera", {');
|
|
112
|
-
this.indent();
|
|
113
|
-
this.emit("clearColor: new pc.Color(0.05, 0.05, 0.1),");
|
|
114
|
-
this.dedent();
|
|
115
|
-
this.emit("});");
|
|
116
|
-
this.emit("camera.setPosition(0, 5, 10);");
|
|
117
|
-
this.emit("camera.lookAt(0, 0, 0);");
|
|
118
|
-
this.emit("this.app.root.addChild(camera);");
|
|
119
|
-
this.emit("");
|
|
120
|
-
}
|
|
121
|
-
if (composition.objects?.length) for (const obj of composition.objects) this.emitObject(obj);
|
|
122
|
-
if (composition.spatialGroups?.length)
|
|
123
|
-
for (const g of composition.spatialGroups) this.emitGroup(g);
|
|
124
|
-
if (composition.timelines?.length)
|
|
125
|
-
for (const tl of composition.timelines) this.emitTimeline(tl);
|
|
126
|
-
if (composition.audio?.length) for (const a of composition.audio) this.emitAudio(a);
|
|
127
|
-
if (composition.zones?.length) for (const z of composition.zones) this.emitZone(z);
|
|
128
|
-
if (composition.ui) this.emitUI(composition.ui);
|
|
129
|
-
if (composition.effects) this.emitEffects(composition.effects);
|
|
130
|
-
if (composition.transitions?.length)
|
|
131
|
-
for (const t of composition.transitions) this.emitTransition(t);
|
|
132
|
-
if (this.options.enableXR) this.emitXRSetup();
|
|
133
|
-
this.compilePlayCanvasDomainBlocks(composition);
|
|
134
|
-
this.emitStartApp();
|
|
135
|
-
this.dedent();
|
|
136
|
-
this.emit("}");
|
|
137
|
-
this.emit("");
|
|
138
|
-
this.emit("dispose(): void { this.app.destroy(); }");
|
|
139
|
-
this.dedent();
|
|
140
|
-
this.emit("}");
|
|
141
|
-
return this.lines.join("\n");
|
|
142
|
-
}
|
|
143
|
-
compilePlayCanvasDomainBlocks(composition) {
|
|
144
|
-
const domainBlocks = composition.domainBlocks ?? [];
|
|
145
|
-
if (domainBlocks.length === 0) return;
|
|
146
|
-
this.emit("");
|
|
147
|
-
this.emit("// === v4.2 Domain Blocks ===");
|
|
148
|
-
let blockIdx = 0;
|
|
149
|
-
const compiled = chunkGH6C2QGW_cjs.compileDomainBlocks(
|
|
150
|
-
// @ts-expect-error During migration
|
|
151
|
-
domainBlocks,
|
|
152
|
-
{
|
|
153
|
-
material: (block) => {
|
|
154
|
-
const mat = chunkGH6C2QGW_cjs.compileMaterialBlock(block);
|
|
155
|
-
return chunkGH6C2QGW_cjs.materialToPlayCanvas(mat, `db${blockIdx++}`);
|
|
156
|
-
},
|
|
157
|
-
physics: (block) => {
|
|
158
|
-
const phys = chunkGH6C2QGW_cjs.compilePhysicsBlock(block);
|
|
159
|
-
return chunkGH6C2QGW_cjs.physicsToPlayCanvas(phys, `db${blockIdx++}`);
|
|
160
|
-
},
|
|
161
|
-
vfx: (block) => {
|
|
162
|
-
const ps = chunkGH6C2QGW_cjs.compileParticleBlock(block);
|
|
163
|
-
return chunkGH6C2QGW_cjs.particlesToPlayCanvas(ps, `db${blockIdx++}`);
|
|
164
|
-
},
|
|
165
|
-
postfx: (block) => {
|
|
166
|
-
const pp = chunkGH6C2QGW_cjs.compilePostProcessingBlock(block);
|
|
167
|
-
return `// Post-Processing: ${pp.keyword} \u2014 configure via PlayCanvas PostEffects
|
|
168
|
-
` + pp.effects.map((e) => `// Effect: ${e.type} \u2014 ${JSON.stringify(e.properties)}`).join("\n");
|
|
169
|
-
},
|
|
170
|
-
audio: (block) => {
|
|
171
|
-
const audio = chunkGH6C2QGW_cjs.compileAudioSourceBlock(block);
|
|
172
|
-
return chunkGH6C2QGW_cjs.audioSourceToPlayCanvas(audio, `db${blockIdx++}`);
|
|
173
|
-
},
|
|
174
|
-
weather: (block) => {
|
|
175
|
-
const weather = chunkGH6C2QGW_cjs.compileWeatherBlock(block);
|
|
176
|
-
return `// Weather: ${weather.keyword} "${weather.name || ""}" \u2014 implement via PlayCanvas particle system
|
|
177
|
-
` + weather.layers.map((l) => `// Layer: ${l.type} \u2014 ${JSON.stringify(l.properties)}`).join("\n");
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
(block) => `// Domain block: ${block.domain}/${block.keyword} "${this.escapeStringValue(block.name, "TypeScript")}"`
|
|
181
|
-
);
|
|
182
|
-
for (const line of compiled) {
|
|
183
|
-
for (const l of line.split("\n")) {
|
|
184
|
-
this.emit(l);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
// --- Imports ---
|
|
189
|
-
emitImports(_composition) {
|
|
190
|
-
this.emit('import * as pc from "playcanvas";');
|
|
191
|
-
}
|
|
192
|
-
// --- Scene Setup ---
|
|
193
|
-
emitSceneSetup(_composition) {
|
|
194
|
-
if (this.options.enablePhysics) {
|
|
195
|
-
this.emit("this.app.systems.rigidbody?.setGravity(0, -9.81, 0);");
|
|
196
|
-
}
|
|
197
|
-
this.emit("");
|
|
198
|
-
}
|
|
199
|
-
// --- Environment ---
|
|
200
|
-
emitEnvironment(env) {
|
|
201
|
-
for (const prop of env.properties) {
|
|
202
|
-
if (prop.key === "skybox" || prop.key === "preset") {
|
|
203
|
-
this.emit(`this.app.scene.setSkybox(null); // Skybox: "${prop.value}"`);
|
|
204
|
-
this.emit(`this.app.scene.skyboxIntensity = 1.0;`);
|
|
205
|
-
} else if (prop.key === "fog" && typeof prop.value === "object") {
|
|
206
|
-
const fog = prop.value;
|
|
207
|
-
this.emit(`this.app.scene.fog = pc.FOG_LINEAR;`);
|
|
208
|
-
if (fog.color) this.emit(`this.app.scene.fogColor = ${this.toPlayCanvasColor(fog.color)};`);
|
|
209
|
-
if (fog.near !== void 0) this.emit(`this.app.scene.fogStart = ${fog.near};`);
|
|
210
|
-
if (fog.far !== void 0) this.emit(`this.app.scene.fogEnd = ${fog.far};`);
|
|
211
|
-
} else if (prop.key === "ambient_light") {
|
|
212
|
-
this.emit(
|
|
213
|
-
`this.app.scene.ambientLight = new pc.Color(${prop.value}, ${prop.value}, ${prop.value});`
|
|
214
|
-
);
|
|
215
|
-
} else if (prop.key === "ground") {
|
|
216
|
-
this.emit('const ground = new pc.Entity("ground");');
|
|
217
|
-
this.emit('ground.addComponent("render", { type: "plane" });');
|
|
218
|
-
this.emit("ground.setLocalScale(100, 1, 100);");
|
|
219
|
-
if (typeof prop.value === "object" && prop.value !== null) {
|
|
220
|
-
const g = prop.value;
|
|
221
|
-
if (g.color) {
|
|
222
|
-
this.emit("const groundMat = new pc.StandardMaterial();");
|
|
223
|
-
this.emit(`groundMat.diffuse = ${this.toPlayCanvasColor(g.color)};`);
|
|
224
|
-
this.emit("groundMat.update();");
|
|
225
|
-
this.emit("ground.render!.meshInstances[0].material = groundMat;");
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
this.emit("this.app.root.addChild(ground);");
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
this.emit("");
|
|
232
|
-
}
|
|
233
|
-
// --- Objects ---
|
|
234
|
-
emitObject(obj, parentVar) {
|
|
235
|
-
const v = this.sanitizeName(obj.name);
|
|
236
|
-
let geom = "cube", modelSrc, textContent;
|
|
237
|
-
let position, rotation, scale, size;
|
|
238
|
-
const mat = {};
|
|
239
|
-
for (const p of obj.properties) {
|
|
240
|
-
switch (p.key) {
|
|
241
|
-
case "geometry":
|
|
242
|
-
case "mesh":
|
|
243
|
-
case "type":
|
|
244
|
-
if (typeof p.value === "string") geom = p.value;
|
|
245
|
-
break;
|
|
246
|
-
case "position":
|
|
247
|
-
if (Array.isArray(p.value)) position = p.value;
|
|
248
|
-
break;
|
|
249
|
-
case "rotation":
|
|
250
|
-
if (Array.isArray(p.value)) rotation = p.value;
|
|
251
|
-
break;
|
|
252
|
-
case "scale":
|
|
253
|
-
scale = p.value;
|
|
254
|
-
break;
|
|
255
|
-
case "size":
|
|
256
|
-
size = p.value;
|
|
257
|
-
break;
|
|
258
|
-
case "color":
|
|
259
|
-
mat.color = p.value;
|
|
260
|
-
break;
|
|
261
|
-
case "roughness":
|
|
262
|
-
mat.roughness = p.value;
|
|
263
|
-
break;
|
|
264
|
-
case "metalness":
|
|
265
|
-
case "metallic":
|
|
266
|
-
mat.metalness = p.value;
|
|
267
|
-
break;
|
|
268
|
-
case "opacity":
|
|
269
|
-
mat.opacity = p.value;
|
|
270
|
-
break;
|
|
271
|
-
case "emissive":
|
|
272
|
-
mat.emissive = p.value;
|
|
273
|
-
break;
|
|
274
|
-
case "emissive_intensity":
|
|
275
|
-
case "emissiveIntensity":
|
|
276
|
-
mat.emissiveIntensity = p.value;
|
|
277
|
-
break;
|
|
278
|
-
case "material":
|
|
279
|
-
if (typeof p.value === "object" && p.value !== null)
|
|
280
|
-
Object.assign(mat, p.value);
|
|
281
|
-
break;
|
|
282
|
-
case "model":
|
|
283
|
-
case "src":
|
|
284
|
-
if (typeof p.value === "string") modelSrc = p.value;
|
|
285
|
-
break;
|
|
286
|
-
case "text":
|
|
287
|
-
if (typeof p.value === "string") textContent = p.value;
|
|
288
|
-
break;
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
this.emit(`// Object: ${this.escapeStringValue(obj.name, "TypeScript")}`);
|
|
292
|
-
this.emit(
|
|
293
|
-
`const ${v} = new pc.Entity("${this.escapeStringValue(obj.name, "TypeScript")}");`
|
|
294
|
-
);
|
|
295
|
-
if (modelSrc) {
|
|
296
|
-
this.emit(`// Model: ${modelSrc} \u2014 load via asset registry`);
|
|
297
|
-
this.emit(`${v}.addComponent("render", { type: "asset" });`);
|
|
298
|
-
} else if (geom === "text" || textContent) {
|
|
299
|
-
this.emit(`${v}.addComponent("element", {`);
|
|
300
|
-
this.indent();
|
|
301
|
-
this.emit(`type: "text",`);
|
|
302
|
-
this.emit(`text: "${textContent || ""}",`);
|
|
303
|
-
this.emit(`fontSize: 48,`);
|
|
304
|
-
this.emit(`color: new pc.Color(1, 1, 1),`);
|
|
305
|
-
this.emit(`anchor: new pc.Vec4(0.5, 0.5, 0.5, 0.5),`);
|
|
306
|
-
this.dedent();
|
|
307
|
-
this.emit("});");
|
|
308
|
-
} else {
|
|
309
|
-
const prim = this.mapShapeToPrimitive(geom);
|
|
310
|
-
this.emit(`${v}.addComponent("render", { type: "${prim}" });`);
|
|
311
|
-
if (Object.keys(mat).length > 0) {
|
|
312
|
-
this.emit(`const ${v}Mat = new pc.StandardMaterial();`);
|
|
313
|
-
if (mat.color) this.emit(`${v}Mat.diffuse = ${this.toPlayCanvasColor(mat.color)};`);
|
|
314
|
-
if (mat.roughness !== void 0)
|
|
315
|
-
this.emit(`${v}Mat.shininess = ${(1 - mat.roughness) * 100};`);
|
|
316
|
-
if (mat.metalness !== void 0) this.emit(`${v}Mat.metalness = ${mat.metalness};`);
|
|
317
|
-
if (mat.opacity !== void 0 && mat.opacity < 1) {
|
|
318
|
-
this.emit(`${v}Mat.opacity = ${mat.opacity};`);
|
|
319
|
-
this.emit(`${v}Mat.blendType = pc.BLEND_NORMAL;`);
|
|
320
|
-
}
|
|
321
|
-
if (mat.emissive) this.emit(`${v}Mat.emissive = ${this.toPlayCanvasColor(mat.emissive)};`);
|
|
322
|
-
if (mat.emissiveIntensity !== void 0)
|
|
323
|
-
this.emit(`${v}Mat.emissiveIntensity = ${mat.emissiveIntensity};`);
|
|
324
|
-
this.emit(`${v}Mat.update();`);
|
|
325
|
-
this.emit(`${v}.render!.meshInstances[0].material = ${v}Mat;`);
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
if (position) this.emit(`${v}.setPosition(${position[0]}, ${position[1]}, ${position[2]});`);
|
|
329
|
-
if (rotation) this.emit(`${v}.setEulerAngles(${rotation[0]}, ${rotation[1]}, ${rotation[2]});`);
|
|
330
|
-
if (scale) {
|
|
331
|
-
if (Array.isArray(scale))
|
|
332
|
-
this.emit(`${v}.setLocalScale(${scale[0]}, ${scale[1]}, ${scale[2]});`);
|
|
333
|
-
else this.emit(`${v}.setLocalScale(${scale}, ${scale}, ${scale});`);
|
|
334
|
-
}
|
|
335
|
-
if (size) {
|
|
336
|
-
const s = typeof size === "number" ? size : 1;
|
|
337
|
-
this.emit(`${v}.setLocalScale(${s}, ${s}, ${s});`);
|
|
338
|
-
}
|
|
339
|
-
for (const trait of obj.traits || []) {
|
|
340
|
-
if (trait.name === "grabbable") {
|
|
341
|
-
this.emit(`${v}.addComponent("button", { active: true });`);
|
|
342
|
-
this.emit(
|
|
343
|
-
`${v}.button!.on("click", () => { console.log("Picked: ${this.escapeStringValue(obj.name, "TypeScript")}"); });`
|
|
344
|
-
);
|
|
345
|
-
} else if (trait.name === "physics" || trait.name === "collidable") {
|
|
346
|
-
const mt = (trait.config?.type || "dynamic") === "static" ? "static" : "dynamic";
|
|
347
|
-
this.emit(`${v}.addComponent("rigidbody", {`);
|
|
348
|
-
this.indent();
|
|
349
|
-
this.emit(`type: "${mt}",`);
|
|
350
|
-
this.emit(`mass: ${trait.config?.mass ?? 1},`);
|
|
351
|
-
if (trait.config?.restitution !== void 0)
|
|
352
|
-
this.emit(`restitution: ${trait.config.restitution},`);
|
|
353
|
-
if (trait.config?.friction !== void 0) this.emit(`friction: ${trait.config.friction},`);
|
|
354
|
-
this.dedent();
|
|
355
|
-
this.emit("});");
|
|
356
|
-
this.emit(`${v}.addComponent("collision", { type: "${this.mapShapeToPrimitive(geom)}" });`);
|
|
357
|
-
} else if (trait.name === "hoverable") {
|
|
358
|
-
this.emit(`${v}.addComponent("button", { active: true });`);
|
|
359
|
-
this.emit(`${v}.button!.on("mouseenter", () => { /* hover enter */ });`);
|
|
360
|
-
this.emit(`${v}.button!.on("mouseleave", () => { /* hover exit */ });`);
|
|
361
|
-
} else if (trait.name === "accessible") {
|
|
362
|
-
this.emit(
|
|
363
|
-
`// @accessible: role="${trait.config?.role || "generic"}" for "${this.escapeStringValue(obj.name, "TypeScript")}"`
|
|
364
|
-
);
|
|
365
|
-
} else if (trait.name === "shadow") {
|
|
366
|
-
this.emit(`${v}.render!.castShadows = true;`);
|
|
367
|
-
this.emit(`${v}.render!.receiveShadows = true;`);
|
|
368
|
-
} else {
|
|
369
|
-
this.emit(
|
|
370
|
-
`// @${this.escapeStringValue(trait.name, "TypeScript")}: ${JSON.stringify(trait.config || {})}`
|
|
371
|
-
);
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
if (obj.traits && Array.isArray(obj.traits) && obj.traits.length > 0) {
|
|
375
|
-
const traitNames = obj.traits.map((t) => t.name);
|
|
376
|
-
const compositor = new chunkOIQYIIO3_cjs.TraitCompositor();
|
|
377
|
-
const composed = compositor.compose(traitNames);
|
|
378
|
-
if (Object.keys(composed).length > 0) {
|
|
379
|
-
const matVar = `${v}ComposedMat`;
|
|
380
|
-
this.emit(`// TraitCompositor: composed ${traitNames.join(" + ")}`);
|
|
381
|
-
this.emit(`const ${matVar} = new pc.StandardMaterial();`);
|
|
382
|
-
if (composed.color)
|
|
383
|
-
this.emit(`${matVar}.diffuse = ${this.toPlayCanvasColor(composed.color)};`);
|
|
384
|
-
if (composed.roughness !== void 0)
|
|
385
|
-
this.emit(`${matVar}.shininess = ${(1 - composed.roughness) * 100};`);
|
|
386
|
-
if (composed.metalness !== void 0)
|
|
387
|
-
this.emit(`${matVar}.metalness = ${composed.metalness};`);
|
|
388
|
-
if (composed.opacity !== void 0 && composed.opacity < 1) {
|
|
389
|
-
this.emit(`${matVar}.opacity = ${composed.opacity};`);
|
|
390
|
-
this.emit(`${matVar}.blendType = pc.BLEND_NORMAL;`);
|
|
391
|
-
}
|
|
392
|
-
if (composed.emissive)
|
|
393
|
-
this.emit(`${matVar}.emissive = ${this.toPlayCanvasColor(composed.emissive)};`);
|
|
394
|
-
if (composed.emissiveIntensity !== void 0)
|
|
395
|
-
this.emit(`${matVar}.emissiveIntensity = ${composed.emissiveIntensity};`);
|
|
396
|
-
this.emit(`${matVar}.update();`);
|
|
397
|
-
this.emit(`${v}.render!.meshInstances[0].material = ${matVar};`);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
const parent = parentVar || "this.app.root";
|
|
401
|
-
this.emit(`${parent}.addChild(${v});`);
|
|
402
|
-
if (obj.children?.length) for (const child of obj.children) this.emitObject(child, v);
|
|
403
|
-
this.emit("");
|
|
404
|
-
}
|
|
405
|
-
// --- Groups ---
|
|
406
|
-
emitGroup(group, parentVar) {
|
|
407
|
-
const v = this.sanitizeName(group.name);
|
|
408
|
-
this.emit(
|
|
409
|
-
`const ${v} = new pc.Entity("${this.escapeStringValue(group.name, "TypeScript")}");`
|
|
410
|
-
);
|
|
411
|
-
for (const p of group.properties) {
|
|
412
|
-
if (p.key === "position" && Array.isArray(p.value))
|
|
413
|
-
this.emit(`${v}.setPosition(${p.value[0]}, ${p.value[1]}, ${p.value[2]});`);
|
|
414
|
-
else if (p.key === "rotation" && Array.isArray(p.value))
|
|
415
|
-
this.emit(`${v}.setEulerAngles(${p.value[0]}, ${p.value[1]}, ${p.value[2]});`);
|
|
416
|
-
else if (p.key === "scale") {
|
|
417
|
-
if (Array.isArray(p.value))
|
|
418
|
-
this.emit(`${v}.setLocalScale(${p.value[0]}, ${p.value[1]}, ${p.value[2]});`);
|
|
419
|
-
else this.emit(`${v}.setLocalScale(${p.value}, ${p.value}, ${p.value});`);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
const parent = parentVar || "this.app.root";
|
|
423
|
-
this.emit(`${parent}.addChild(${v});`);
|
|
424
|
-
for (const obj of group.objects) this.emitObject(obj, v);
|
|
425
|
-
if (group.groups) for (const sub of group.groups) this.emitGroup(sub, v);
|
|
426
|
-
this.emit("");
|
|
427
|
-
}
|
|
428
|
-
// --- Lights ---
|
|
429
|
-
emitLight(light) {
|
|
430
|
-
const v = this.sanitizeName(light.name);
|
|
431
|
-
let pos, color, intensity;
|
|
432
|
-
let dir, castShadow = false, angle, dist;
|
|
433
|
-
for (const p of light.properties) {
|
|
434
|
-
if (p.key === "position" && Array.isArray(p.value)) pos = p.value;
|
|
435
|
-
else if (p.key === "color") color = p.value;
|
|
436
|
-
else if (p.key === "intensity") intensity = p.value;
|
|
437
|
-
else if (p.key === "direction" && Array.isArray(p.value)) dir = p.value;
|
|
438
|
-
else if (p.key === "cast_shadow" || p.key === "castShadow") castShadow = !!p.value;
|
|
439
|
-
else if (p.key === "angle") angle = p.value;
|
|
440
|
-
else if (p.key === "distance") dist = p.value;
|
|
441
|
-
}
|
|
442
|
-
const pcType = this.mapLightType(light.lightType);
|
|
443
|
-
this.emit(
|
|
444
|
-
`const ${v} = new pc.Entity("${this.escapeStringValue(light.name, "TypeScript")}");`
|
|
445
|
-
);
|
|
446
|
-
this.emit(`${v}.addComponent("light", {`);
|
|
447
|
-
this.indent();
|
|
448
|
-
this.emit(`type: "${pcType}",`);
|
|
449
|
-
if (color) this.emit(`color: ${this.toPlayCanvasColor(color)},`);
|
|
450
|
-
if (intensity !== void 0) this.emit(`intensity: ${intensity},`);
|
|
451
|
-
if (castShadow) this.emit("castShadows: true,");
|
|
452
|
-
if (dist !== void 0) this.emit(`range: ${dist},`);
|
|
453
|
-
if (angle !== void 0 && pcType === "spot")
|
|
454
|
-
this.emit(`outerConeAngle: ${angle * (180 / Math.PI)},`);
|
|
455
|
-
this.dedent();
|
|
456
|
-
this.emit("});");
|
|
457
|
-
if (pos) this.emit(`${v}.setPosition(${pos[0]}, ${pos[1]}, ${pos[2]});`);
|
|
458
|
-
if (dir) this.emit(`${v}.setEulerAngles(${this.directionToEuler(dir)});`);
|
|
459
|
-
this.emit("this.app.root.addChild(" + v + ");");
|
|
460
|
-
this.emit("");
|
|
461
|
-
}
|
|
462
|
-
// --- Camera ---
|
|
463
|
-
emitCamera(cam) {
|
|
464
|
-
let fov, pos, lookAt;
|
|
465
|
-
let near, far;
|
|
466
|
-
for (const p of cam.properties) {
|
|
467
|
-
if (p.key === "fov" || p.key === "field_of_view") fov = p.value;
|
|
468
|
-
else if (p.key === "position" && Array.isArray(p.value)) pos = p.value;
|
|
469
|
-
else if ((p.key === "look_at" || p.key === "lookAt") && Array.isArray(p.value))
|
|
470
|
-
lookAt = p.value;
|
|
471
|
-
else if (p.key === "near") near = p.value;
|
|
472
|
-
else if (p.key === "far") far = p.value;
|
|
473
|
-
}
|
|
474
|
-
this.emit('const camera = new pc.Entity("camera");');
|
|
475
|
-
this.emit('camera.addComponent("camera", {');
|
|
476
|
-
this.indent();
|
|
477
|
-
this.emit("clearColor: new pc.Color(0.05, 0.05, 0.1),");
|
|
478
|
-
if (cam.cameraType === "orthographic") {
|
|
479
|
-
this.emit("projection: pc.PROJECTION_ORTHOGRAPHIC,");
|
|
480
|
-
}
|
|
481
|
-
if (fov !== void 0) this.emit(`fov: ${fov},`);
|
|
482
|
-
if (near !== void 0) this.emit(`nearClip: ${near},`);
|
|
483
|
-
if (far !== void 0) this.emit(`farClip: ${far},`);
|
|
484
|
-
this.dedent();
|
|
485
|
-
this.emit("});");
|
|
486
|
-
if (pos) this.emit(`camera.setPosition(${pos[0]}, ${pos[1]}, ${pos[2]});`);
|
|
487
|
-
else this.emit("camera.setPosition(0, 5, 10);");
|
|
488
|
-
if (lookAt) this.emit(`camera.lookAt(${lookAt[0]}, ${lookAt[1]}, ${lookAt[2]});`);
|
|
489
|
-
else this.emit("camera.lookAt(0, 0, 0);");
|
|
490
|
-
this.emit("this.app.root.addChild(camera);");
|
|
491
|
-
this.emit("");
|
|
492
|
-
}
|
|
493
|
-
// --- Timeline ---
|
|
494
|
-
emitTimeline(timeline) {
|
|
495
|
-
this.sanitizeName(timeline.name);
|
|
496
|
-
this.emit(`// Timeline: "${this.escapeStringValue(timeline.name, "TypeScript")}"`);
|
|
497
|
-
for (const entry of timeline.entries) {
|
|
498
|
-
const a = entry.action;
|
|
499
|
-
if (a.kind === "animate") {
|
|
500
|
-
this.emit(`// @${entry.time}s: animate ${a.target} ${JSON.stringify(a.properties)}`);
|
|
501
|
-
} else if (a.kind === "emit") {
|
|
502
|
-
this.emit(
|
|
503
|
-
`// @${entry.time}s: emit "${this.escapeStringValue(a.event, "TypeScript")}"`
|
|
504
|
-
);
|
|
505
|
-
} else if (a.kind === "call") {
|
|
506
|
-
this.emit(
|
|
507
|
-
`// @${entry.time}s: call ${this.escapeStringValue(a.method, "TypeScript")}()`
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
if (timeline.autoplay) this.emit(`// autoplay: ${timeline.loop ? "loop" : "once"}`);
|
|
512
|
-
this.emit("");
|
|
513
|
-
}
|
|
514
|
-
// --- Audio ---
|
|
515
|
-
emitAudio(audio) {
|
|
516
|
-
const v = this.sanitizeName(audio.name);
|
|
517
|
-
let src = "", volume = 1, loop = false, spatial = false;
|
|
518
|
-
let position, dist;
|
|
519
|
-
for (const p of audio.properties) {
|
|
520
|
-
if (p.key === "src" || p.key === "source") src = String(p.value);
|
|
521
|
-
else if (p.key === "volume") volume = p.value;
|
|
522
|
-
else if (p.key === "loop") loop = !!p.value;
|
|
523
|
-
else if (p.key === "spatial") spatial = !!p.value;
|
|
524
|
-
else if (p.key === "position" && Array.isArray(p.value)) position = p.value;
|
|
525
|
-
else if (p.key === "distance") dist = p.value;
|
|
526
|
-
}
|
|
527
|
-
this.emit(
|
|
528
|
-
`const ${v} = new pc.Entity("${this.escapeStringValue(audio.name, "TypeScript")}");`
|
|
529
|
-
);
|
|
530
|
-
this.emit(`${v}.addComponent("sound");`);
|
|
531
|
-
this.emit(`${v}.sound!.addSlot("default", {`);
|
|
532
|
-
this.indent();
|
|
533
|
-
this.emit(`asset: null, // Load "${src}" via asset registry`);
|
|
534
|
-
this.emit(`loop: ${loop},`);
|
|
535
|
-
this.emit(`volume: ${volume},`);
|
|
536
|
-
this.emit(`autoPlay: true,`);
|
|
537
|
-
if (dist !== void 0) this.emit(`maxDistance: ${dist},`);
|
|
538
|
-
if (spatial) this.emit("positional: true,");
|
|
539
|
-
this.dedent();
|
|
540
|
-
this.emit("});");
|
|
541
|
-
if (position) this.emit(`${v}.setPosition(${position[0]}, ${position[1]}, ${position[2]});`);
|
|
542
|
-
this.emit(`this.app.root.addChild(${v});`);
|
|
543
|
-
this.emit("");
|
|
544
|
-
}
|
|
545
|
-
// --- Zone ---
|
|
546
|
-
emitZone(zone) {
|
|
547
|
-
const v = this.sanitizeName(zone.name);
|
|
548
|
-
let shape = "box", position, size, radius;
|
|
549
|
-
for (const p of zone.properties) {
|
|
550
|
-
if (p.key === "shape") shape = String(p.value);
|
|
551
|
-
else if (p.key === "position" && Array.isArray(p.value)) position = p.value;
|
|
552
|
-
else if (p.key === "size") size = p.value;
|
|
553
|
-
else if (p.key === "radius") radius = p.value;
|
|
554
|
-
}
|
|
555
|
-
this.emit(
|
|
556
|
-
`const ${v} = new pc.Entity("${this.escapeStringValue(zone.name, "TypeScript")}");`
|
|
557
|
-
);
|
|
558
|
-
if (shape === "sphere") {
|
|
559
|
-
this.emit(`${v}.addComponent("collision", { type: "sphere", radius: ${radius || 5} });`);
|
|
560
|
-
} else {
|
|
561
|
-
const s = Array.isArray(size) ? size : [size || 5, size || 5, size || 5];
|
|
562
|
-
this.emit(
|
|
563
|
-
`${v}.addComponent("collision", { type: "box", halfExtents: new pc.Vec3(${s[0] / 2}, ${s[1] / 2}, ${s[2] / 2}) });`
|
|
564
|
-
);
|
|
565
|
-
}
|
|
566
|
-
this.emit(`${v}.addComponent("rigidbody", { type: "static" });`);
|
|
567
|
-
if (position) this.emit(`${v}.setPosition(${position[0]}, ${position[1]}, ${position[2]});`);
|
|
568
|
-
if (zone.handlers?.length) {
|
|
569
|
-
for (const h of zone.handlers) {
|
|
570
|
-
const event = h.event === "on_enter" ? "triggerenter" : h.event === "on_exit" ? "triggerleave" : h.event;
|
|
571
|
-
this.emit(
|
|
572
|
-
`${v}.collision!.on("${event}", (result: unknown) => { /* ${this.escapeStringValue(h.event, "TypeScript")} */ });`
|
|
573
|
-
);
|
|
574
|
-
}
|
|
575
|
-
}
|
|
576
|
-
this.emit(`this.app.root.addChild(${v});`);
|
|
577
|
-
this.emit("");
|
|
578
|
-
}
|
|
579
|
-
// --- UI ---
|
|
580
|
-
emitUI(ui) {
|
|
581
|
-
this.emit('const screenEntity = new pc.Entity("screen");');
|
|
582
|
-
this.emit(
|
|
583
|
-
'screenEntity.addComponent("screen", { screenSpace: true, referenceResolution: new pc.Vec2(1280, 720) });'
|
|
584
|
-
);
|
|
585
|
-
this.emit("this.app.root.addChild(screenEntity);");
|
|
586
|
-
for (const el of ui.elements) {
|
|
587
|
-
const v = this.sanitizeName(el.name);
|
|
588
|
-
let elType = "text", text = "", fontSize = 24, color = "#ffffff";
|
|
589
|
-
for (const p of el.properties) {
|
|
590
|
-
if (p.key === "type") elType = String(p.value);
|
|
591
|
-
else if (p.key === "text") text = String(p.value);
|
|
592
|
-
else if (p.key === "font_size" || p.key === "fontSize") fontSize = p.value;
|
|
593
|
-
else if (p.key === "color") color = String(p.value);
|
|
594
|
-
else if (p.key === "background") String(p.value);
|
|
595
|
-
}
|
|
596
|
-
this.emit(
|
|
597
|
-
`const ${v} = new pc.Entity("${this.escapeStringValue(el.name, "TypeScript")}");`
|
|
598
|
-
);
|
|
599
|
-
if (elType === "button") {
|
|
600
|
-
this.emit(`${v}.addComponent("element", {`);
|
|
601
|
-
this.indent();
|
|
602
|
-
this.emit(`type: "text",`);
|
|
603
|
-
this.emit(`text: "${text}",`);
|
|
604
|
-
this.emit(`fontSize: ${fontSize},`);
|
|
605
|
-
this.emit(`color: ${this.toPlayCanvasColor(color)},`);
|
|
606
|
-
this.emit(`anchor: new pc.Vec4(0.5, 0.5, 0.5, 0.5),`);
|
|
607
|
-
this.emit(`pivot: new pc.Vec2(0.5, 0.5),`);
|
|
608
|
-
this.emit(`width: 150,`);
|
|
609
|
-
this.emit(`height: 40,`);
|
|
610
|
-
this.dedent();
|
|
611
|
-
this.emit("});");
|
|
612
|
-
this.emit(`${v}.addComponent("button", { active: true });`);
|
|
613
|
-
} else if (elType === "progress") {
|
|
614
|
-
this.emit(`${v}.addComponent("element", {`);
|
|
615
|
-
this.indent();
|
|
616
|
-
this.emit('type: "image",');
|
|
617
|
-
this.emit("anchor: new pc.Vec4(0.5, 0.5, 0.5, 0.5),");
|
|
618
|
-
this.emit("width: 200,");
|
|
619
|
-
this.emit("height: 20,");
|
|
620
|
-
this.dedent();
|
|
621
|
-
this.emit("});");
|
|
622
|
-
} else {
|
|
623
|
-
this.emit(`${v}.addComponent("element", {`);
|
|
624
|
-
this.indent();
|
|
625
|
-
this.emit(`type: "text",`);
|
|
626
|
-
this.emit(`text: "${text}",`);
|
|
627
|
-
this.emit(`fontSize: ${fontSize},`);
|
|
628
|
-
this.emit(`color: ${this.toPlayCanvasColor(color)},`);
|
|
629
|
-
this.emit(`anchor: new pc.Vec4(0.5, 0.5, 0.5, 0.5),`);
|
|
630
|
-
this.dedent();
|
|
631
|
-
this.emit("});");
|
|
632
|
-
}
|
|
633
|
-
this.emit(`screenEntity.addChild(${v});`);
|
|
634
|
-
}
|
|
635
|
-
this.emit("");
|
|
636
|
-
}
|
|
637
|
-
// --- Effects ---
|
|
638
|
-
emitEffects(effects) {
|
|
639
|
-
for (const fx of effects.effects) {
|
|
640
|
-
const p = fx.properties;
|
|
641
|
-
switch (fx.effectType) {
|
|
642
|
-
case "bloom":
|
|
643
|
-
this.emit("// Post-processing: Bloom");
|
|
644
|
-
this.emit("this.app.scene.rendering.toneMapping = pc.TONEMAP_ACES;");
|
|
645
|
-
if (p.intensity !== void 0) this.emit(`// bloom intensity: ${p.intensity}`);
|
|
646
|
-
break;
|
|
647
|
-
case "ssao":
|
|
648
|
-
this.emit("// Post-processing: SSAO");
|
|
649
|
-
if (p.radius !== void 0) this.emit(`// ssao radius: ${p.radius}`);
|
|
650
|
-
break;
|
|
651
|
-
case "vignette":
|
|
652
|
-
this.emit("// Post-processing: Vignette");
|
|
653
|
-
if (p.weight !== void 0) this.emit(`// vignette weight: ${p.weight}`);
|
|
654
|
-
break;
|
|
655
|
-
case "tone_mapping":
|
|
656
|
-
this.emit("this.app.scene.rendering.toneMapping = pc.TONEMAP_ACES;");
|
|
657
|
-
break;
|
|
658
|
-
default:
|
|
659
|
-
this.emit(`// Effect "${fx.effectType}": ${JSON.stringify(p)}`);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
this.emit("");
|
|
663
|
-
}
|
|
664
|
-
// --- Transition ---
|
|
665
|
-
emitTransition(tr) {
|
|
666
|
-
let target, effect, duration;
|
|
667
|
-
for (const p of tr.properties) {
|
|
668
|
-
if (p.key === "target") target = String(p.value);
|
|
669
|
-
else if (p.key === "effect") effect = String(p.value);
|
|
670
|
-
else if (p.key === "duration") duration = p.value;
|
|
671
|
-
}
|
|
672
|
-
this.emit(
|
|
673
|
-
`// Transition "${this.escapeStringValue(tr.name, "TypeScript")}": navigate to "${target || "?"}" with ${effect || "fade"} over ${duration || 1}s`
|
|
674
|
-
);
|
|
675
|
-
}
|
|
676
|
-
// --- XR ---
|
|
677
|
-
emitXRSetup() {
|
|
678
|
-
this.emit("if (this.app.xr.supported) {");
|
|
679
|
-
this.indent();
|
|
680
|
-
this.emit(
|
|
681
|
-
'this.app.xr.start(this.app.root.findByName("camera")?.camera!, pc.XRTYPE_VR, pc.XRSPACE_LOCAL);'
|
|
682
|
-
);
|
|
683
|
-
this.dedent();
|
|
684
|
-
this.emit("}");
|
|
685
|
-
this.emit("");
|
|
686
|
-
}
|
|
687
|
-
// --- Start App ---
|
|
688
|
-
emitStartApp() {
|
|
689
|
-
this.emit("this.app.start();");
|
|
690
|
-
this.emit('window.addEventListener("resize", () => { this.app.resizeCanvas(); });');
|
|
691
|
-
}
|
|
692
|
-
// --- Value Conversion Helpers ---
|
|
693
|
-
toPlayCanvasColor(value) {
|
|
694
|
-
if (typeof value === "string" && value.startsWith("#")) {
|
|
695
|
-
const h = value.slice(1);
|
|
696
|
-
const r = parseInt(h.substring(0, 2), 16) / 255;
|
|
697
|
-
const g = parseInt(h.substring(2, 4), 16) / 255;
|
|
698
|
-
const b = parseInt(h.substring(4, 6), 16) / 255;
|
|
699
|
-
return `new pc.Color(${r.toFixed(3)}, ${g.toFixed(3)}, ${b.toFixed(3)})`;
|
|
700
|
-
}
|
|
701
|
-
if (typeof value === "object" && value !== null && "r" in value) {
|
|
702
|
-
const c = value;
|
|
703
|
-
const rVal = Number(c.r);
|
|
704
|
-
const gVal = Number(c.g);
|
|
705
|
-
const bVal = Number(c.b);
|
|
706
|
-
const r = rVal > 1 ? rVal / 255 : rVal;
|
|
707
|
-
const g = gVal > 1 ? gVal / 255 : gVal;
|
|
708
|
-
const b = bVal > 1 ? bVal / 255 : bVal;
|
|
709
|
-
return `new pc.Color(${r.toFixed(3)}, ${g.toFixed(3)}, ${b.toFixed(3)})`;
|
|
710
|
-
}
|
|
711
|
-
return "new pc.Color(1, 1, 1)";
|
|
712
|
-
}
|
|
713
|
-
mapShapeToPrimitive(type) {
|
|
714
|
-
return SHAPE_TO_PRIMITIVE[type] || "box";
|
|
715
|
-
}
|
|
716
|
-
mapLightType(type) {
|
|
717
|
-
switch (type) {
|
|
718
|
-
case "hemisphere":
|
|
719
|
-
case "ambient":
|
|
720
|
-
return "directional";
|
|
721
|
-
case "directional":
|
|
722
|
-
return "directional";
|
|
723
|
-
case "point":
|
|
724
|
-
return "point";
|
|
725
|
-
case "spot":
|
|
726
|
-
return "spot";
|
|
727
|
-
case "area":
|
|
728
|
-
return "point";
|
|
729
|
-
default:
|
|
730
|
-
return "directional";
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
directionToEuler(dir) {
|
|
734
|
-
const x = Number(dir[0]) || 0, y = Number(dir[1]) || 0, z = Number(dir[2]) || 0;
|
|
735
|
-
const pitch = Math.atan2(-y, Math.sqrt(x * x + z * z)) * (180 / Math.PI);
|
|
736
|
-
const yaw = Math.atan2(x, z) * (180 / Math.PI);
|
|
737
|
-
return `${pitch.toFixed(1)}, ${yaw.toFixed(1)}, 0`;
|
|
738
|
-
}
|
|
739
|
-
// --- Emit Helpers ---
|
|
740
|
-
emit(line) {
|
|
741
|
-
this.lines.push(this.options.indent.repeat(this.indentLevel) + line);
|
|
742
|
-
}
|
|
743
|
-
indent() {
|
|
744
|
-
this.indentLevel++;
|
|
745
|
-
}
|
|
746
|
-
dedent() {
|
|
747
|
-
this.indentLevel = Math.max(0, this.indentLevel - 1);
|
|
748
|
-
}
|
|
749
|
-
sanitizeName(name) {
|
|
750
|
-
return name.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
751
|
-
}
|
|
752
|
-
};
|
|
753
|
-
}
|
|
754
|
-
});
|
|
755
|
-
|
|
756
|
-
exports.PlayCanvasCompiler_exports = PlayCanvasCompiler_exports;
|
|
757
|
-
exports.init_PlayCanvasCompiler = init_PlayCanvasCompiler;
|
|
758
|
-
//# sourceMappingURL=chunk-UOL6Y5TD.cjs.map
|
|
759
|
-
//# sourceMappingURL=chunk-UOL6Y5TD.cjs.map
|