@holoscript/core 6.0.4 → 6.1.2
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/LICENSE +21 -0
- package/README.md +3 -3
- package/bin/holoscript.cjs +3 -0
- package/dist/GLTFPipeline-SFIORFJU.js +16 -0
- package/dist/GLTFPipeline-VNNDPONV.cjs +37 -0
- package/dist/{HoloScriptPlusParser-BN6KVRCM.js → HoloScriptPlusParser-7FBIFUFC.js} +6 -5
- package/dist/{HoloScriptPlusParser-NC5FE6AL.cjs → HoloScriptPlusParser-A2W7OCN2.cjs} +17 -16
- package/dist/HoloScriptPlusParser-F2Z56FJR.js +10 -0
- package/dist/HoloScriptPlusParser-WKHRIH6T.cjs +27 -0
- package/dist/{USDZExporter-UWGWNMMD.cjs → USDZExporter-3FWJ25JI.cjs} +344 -16
- package/dist/{USDZExporter-NTMBNTDB.js → USDZExporter-D2HQLQYK.js} +344 -16
- package/dist/agents/index.cjs +19 -0
- package/dist/agents/index.d.ts +100 -0
- package/dist/agents/index.js +17 -0
- package/dist/chunk-22W6NGYN.js +725 -0
- package/dist/{chunk-5OEOHAAW.cjs → chunk-27MPVJVZ.cjs} +64 -28
- package/dist/{chunk-RVYPEYPX.js → chunk-2A7FURVO.js} +44 -8
- package/dist/{chunk-XCWFGZAA.js → chunk-2B7WVIDZ.js} +11 -8
- package/dist/{chunk-NDQNIJEH.js → chunk-2BSMSUCE.js} +250 -24
- package/dist/chunk-2HLIGOKU.cjs +5546 -0
- package/dist/{chunk-EONILVMF.js → chunk-2M2DPHKB.js} +4 -4
- package/dist/{chunk-G7CT3EMP.cjs → chunk-2YSNA2F2.cjs} +319 -47
- package/dist/{chunk-IWI6J7FX.js → chunk-33XCOVE3.js} +5 -5
- package/dist/chunk-3FOKASKO.cjs +348 -0
- package/dist/{chunk-DXJQDCFL.js → chunk-4C57PR42.js} +3 -3
- package/dist/{chunk-MPXBVFHQ.js → chunk-4N4SXXWF.js} +4 -3
- package/dist/chunk-4PDEPEQW.cjs +41 -0
- package/dist/chunk-4R6HPSHJ.js +2176 -0
- package/dist/chunk-4R6SBXDB.js +45 -0
- package/dist/chunk-4SY77NA4.cjs +413 -0
- package/dist/{chunk-YCXFCXDS.js → chunk-4UUKPCY4.js} +668 -110
- package/dist/{chunk-LGGRPKTV.cjs → chunk-52ULD552.cjs} +114 -35
- package/dist/{chunk-L4G4RLXX.js → chunk-5CKA5SXU.js} +438 -22
- package/dist/chunk-5FSKKMR7.cjs +2092 -0
- package/dist/{chunk-FF3Q7ADR.js → chunk-5JEU52DW.js} +5 -3
- package/dist/chunk-5N54COB6.cjs +327 -0
- package/dist/chunk-5S7RKFGR.cjs +446 -0
- package/dist/{chunk-KED34ILP.js → chunk-6ASWLXXN.js} +21 -9
- package/dist/chunk-6CTRH7HT.cjs +1985 -0
- package/dist/{chunk-CAUCGUEA.cjs → chunk-6EX3I5P4.cjs} +6 -6
- package/dist/chunk-6FGQNDR4.js +5731 -0
- package/dist/{chunk-72EQECGT.cjs → chunk-6KMK2UXT.cjs} +122 -46
- package/dist/{chunk-G4VZTCIB.js → chunk-6L4VE27M.js} +33 -23
- package/dist/{chunk-ATSKSYVE.cjs → chunk-6S6TKNEA.cjs} +6478 -1738
- package/dist/chunk-77V4GTCA.js +596 -0
- package/dist/{chunk-ZP4D3CSX.cjs → chunk-7AD52FRS.cjs} +16 -16
- package/dist/chunk-A6KINLZJ.js +236 -0
- package/dist/chunk-AIA52I7T.cjs +543 -0
- package/dist/chunk-AIX25INK.cjs +602 -0
- package/dist/{chunk-B5TCIAPQ.cjs → chunk-AO4I2Z7M.cjs} +17 -18
- package/dist/{chunk-Q5SJOGHQ.cjs → chunk-BPICAGBV.cjs} +324 -199
- package/dist/chunk-BRQJKJGT.cjs +20 -0
- package/dist/{chunk-3FXV5S25.cjs → chunk-C37BHB7N.cjs} +6 -3
- package/dist/{chunk-XUTX5CBW.js → chunk-CBJY23VL.js} +3 -3
- package/dist/chunk-CIWWXYHZ.cjs +50 -0
- package/dist/{chunk-XXINBTZK.cjs → chunk-DIL6DDDN.cjs} +101 -45
- package/dist/chunk-DMXC24WV.js +404 -0
- package/dist/{chunk-PMGODDJA.cjs → chunk-DTGBOSEM.cjs} +12 -12
- package/dist/chunk-E7JP3BS3.cjs +61 -0
- package/dist/{chunk-HJJLD366.js → chunk-EKBKLK7P.js} +3 -3
- package/dist/chunk-EKYL4PE3.cjs +404 -0
- package/dist/{chunk-UPJBDCVF.js → chunk-EMMC5CSQ.js} +12 -8
- package/dist/{chunk-GGHSW2NN.js → chunk-EOBB6A4B.js} +6389 -1718
- package/dist/chunk-EOFNVCM6.js +325 -0
- package/dist/{chunk-FHQVYCH2.js → chunk-ER4GATIU.js} +7 -7
- package/dist/{chunk-N5FTS757.cjs → chunk-EXKSFGSX.cjs} +7 -148
- package/dist/{chunk-LK5IAVH6.cjs → chunk-EXUP2BUM.cjs} +27 -27
- package/dist/chunk-FDSGHPAK.js +130 -0
- package/dist/chunk-FEWUHQNM.cjs +144 -0
- package/dist/{chunk-5TOFIR6L.js → chunk-FGGJQRLZ.js} +5 -142
- package/dist/chunk-FHP6LXJS.js +415 -0
- package/dist/{chunk-7LCYLPW2.cjs → chunk-FJPADH77.cjs} +7 -4
- package/dist/{chunk-T36DDXSF.js → chunk-FXKTYFYA.js} +150 -25
- package/dist/chunk-G2LS3RFO.js +623 -0
- package/dist/chunk-GCMWDSBZ.cjs +729 -0
- package/dist/chunk-GJNCFRJU.cjs +125 -0
- package/dist/{chunk-Q4QX3AET.cjs → chunk-GMP623FG.cjs} +16 -13
- package/dist/{chunk-XD6IYDUX.js → chunk-GN3KDX4W.js} +119 -43
- package/dist/{chunk-QLEAOI3Q.cjs → chunk-GQYKQSTC.cjs} +10 -10
- package/dist/chunk-GTU2Z2WW.cjs +262 -0
- package/dist/chunk-GZG4KA4E.js +529 -0
- package/dist/{chunk-BND3ST2K.cjs → chunk-H3MGK7TX.cjs} +42 -32
- package/dist/{chunk-XRKWN5PL.cjs → chunk-H5DZIHJP.cjs} +14 -18
- package/dist/{chunk-Z34RLXRA.cjs → chunk-HANL7K2Q.cjs} +65 -50
- package/dist/{chunk-3SAK5KFL.cjs → chunk-HCCQLAA4.cjs} +2 -11
- package/dist/{chunk-LXJ4667L.cjs → chunk-HGVXZDSK.cjs} +108 -20
- package/dist/{chunk-3FJCK5XA.js → chunk-HRODTEEO.js} +30 -10
- package/dist/{chunk-HQUEA5R6.cjs → chunk-HZCQO4JM.cjs} +6 -6
- package/dist/{chunk-S565K7NK.js → chunk-I2O7TW6B.js} +12 -8
- package/dist/chunk-IHESJZSW.js +4490 -0
- package/dist/{chunk-FSF7EQVA.cjs → chunk-IRWWS72C.cjs} +63 -22
- package/dist/{chunk-5O6TQC6M.cjs → chunk-IVIA7K75.cjs} +689 -127
- package/dist/chunk-IVY74O6C.js +247 -0
- package/dist/chunk-J32ZJZJH.js +554 -0
- package/dist/chunk-J56PTA46.cjs +639 -0
- package/dist/chunk-JD7CIZ33.js +1949 -0
- package/dist/{chunk-T7LEXZUZ.cjs → chunk-JIYN45TV.cjs} +14 -15
- package/dist/{chunk-FFKU7BTK.cjs → chunk-KHPCJRI3.cjs} +24 -21
- package/dist/chunk-KKFZ3B6J.cjs +557 -0
- package/dist/chunk-KPJL34Y7.cjs +186 -0
- package/dist/{chunk-HE7ULERA.cjs → chunk-KQTPCYTG.cjs} +128 -44
- package/dist/{chunk-OFKWH2IP.js → chunk-KX76JUQY.js} +3 -3
- package/dist/{chunk-33LSUQDD.cjs → chunk-L63H3SQ4.cjs} +43 -31
- package/dist/{chunk-K6EKD26I.js → chunk-LAOCQJ2M.js} +64 -8
- package/dist/chunk-LM2VU56C.cjs +37 -0
- package/dist/chunk-M56JSP4A.js +400 -0
- package/dist/chunk-MBOOR7X4.js +18 -0
- package/dist/{chunk-XWPNTWDN.cjs → chunk-MJVIRCUV.cjs} +31 -27
- package/dist/{chunk-SDAMZIRE.js → chunk-MSMIFMBL.js} +135 -18
- package/dist/{chunk-56IF4NTA.js → chunk-MXFUTKCO.js} +18 -18
- package/dist/{chunk-6UEHYZ7V.cjs → chunk-MXJ5SS53.cjs} +447 -31
- package/dist/chunk-MYY4PMWX.cjs +264 -0
- package/dist/chunk-N75IH2HY.js +258 -0
- package/dist/{chunk-GVUR45UF.cjs → chunk-NG77ATEW.cjs} +7 -6
- package/dist/chunk-NW5G5FBQ.js +215 -0
- package/dist/{chunk-E3FWRT3Z.js → chunk-OEFY723R.js} +28 -13
- package/dist/chunk-OEV5RMZO.cjs +3042 -0
- package/dist/{chunk-X4ZF6CNE.cjs → chunk-OIQYIIO3.cjs} +7 -7
- package/dist/{chunk-2CWOLHTE.js → chunk-OL46QLBJ.js} +3 -11
- package/dist/chunk-OPZ7XDDI.js +487 -0
- package/dist/chunk-OSYNRVOV.cjs +243 -0
- package/dist/{chunk-TEWCN33Y.js → chunk-P7YIA5LN.js} +91 -7
- package/dist/chunk-PGANYCAG.cjs +220 -0
- package/dist/{chunk-CS2EMTGF.js → chunk-QAVXL2IH.js} +62 -21
- package/dist/{chunk-T4NKMBDL.js → chunk-QCCBXSCE.js} +1666 -756
- package/dist/{chunk-F4IULT7N.js → chunk-QPOQ7VPI.js} +16 -13
- package/dist/{chunk-6XSERL6L.js → chunk-QTPMJRGS.js} +3108 -2827
- package/dist/{chunk-F3HH56EB.cjs → chunk-QWNQ523V.cjs} +1730 -823
- package/dist/{chunk-R7MA7QWV.js → chunk-R3IVNY6P.js} +102 -23
- package/dist/chunk-R75BSDH7.cjs +50 -0
- package/dist/chunk-RAXUF5DF.cjs +2196 -0
- package/dist/{chunk-BF2235SI.cjs → chunk-RMHC2VG7.cjs} +2876 -2592
- package/dist/chunk-RUXGBKPS.cjs +4517 -0
- package/dist/{chunk-UERJ3YJV.js → chunk-S5IFXW6E.js} +113 -9
- package/dist/{chunk-27LWW5FU.cjs → chunk-S6YWHCKV.cjs} +5 -5
- package/dist/{chunk-WB4Z63GG.js → chunk-SIEXCILW.js} +3 -3
- package/dist/{chunk-CLYEIWA5.cjs → chunk-SLU6UPJI.cjs} +5 -3
- package/dist/{chunk-LZ266PCM.cjs → chunk-T5J7ZKP3.cjs} +446 -60
- package/dist/chunk-TDCNJHWO.js +341 -0
- package/dist/{chunk-IHOUYQIA.js → chunk-TG7O4WBC.js} +5 -5
- package/dist/chunk-THCK6ECW.js +2085 -0
- package/dist/chunk-TJHVSBP2.js +439 -0
- package/dist/chunk-TK74TR4H.js +5541 -0
- package/dist/{chunk-CDPGV4DN.js → chunk-U4NBQJBY.js} +14 -15
- package/dist/{chunk-NOZZ46QU.js → chunk-UD3DSHZM.js} +10 -14
- package/dist/chunk-UDMYRFDZ.js +3038 -0
- package/dist/{chunk-WDW67DZB.cjs → chunk-UOIGFQXC.cjs} +90 -68
- package/dist/{chunk-BU7VWW2K.js → chunk-URG2SJLK.js} +14 -15
- package/dist/{chunk-EQV4R3EV.cjs → chunk-V73NPPTM.cjs} +152 -35
- package/dist/chunk-VECQYRXL.js +474 -0
- package/dist/chunk-VEXPG4WN.js +1989 -0
- package/dist/{chunk-LDP5OK6G.js → chunk-VMLKSV26.js} +5 -5
- package/dist/{chunk-5BGSECRJ.cjs → chunk-VSK7W3O5.cjs} +47 -27
- package/dist/chunk-VVKVQZI6.js +55 -0
- package/dist/{chunk-YQK5JNFK.js → chunk-W55Z7QIX.js} +103 -15
- package/dist/{chunk-KSGXLT74.cjs → chunk-W6P2GBHH.cjs} +3 -3
- package/dist/{chunk-IBDG74G2.cjs → chunk-W6RW64BB.cjs} +7 -7
- package/dist/chunk-WDT3JTGM.cjs +483 -0
- package/dist/{chunk-HPS76H7Q.js → chunk-WKX5AMOY.js} +3 -3
- package/dist/chunk-WNNE3PO3.js +34 -0
- package/dist/{chunk-XG23EUQX.cjs → chunk-WRLUBRKS.cjs} +538 -312
- package/dist/{chunk-IFNQFCTM.js → chunk-WRNEH5MO.js} +79 -8
- package/dist/{chunk-54FHG2MX.js → chunk-WRWEX5ZF.js} +7 -4
- package/dist/{chunk-KCQ5NDYC.cjs → chunk-X3GJPRVK.cjs} +154 -80
- package/dist/{chunk-7AGYRWKW.cjs → chunk-XFXGA5IW.cjs} +126 -22
- package/dist/{chunk-TQSZUOW5.cjs → chunk-XHIV6326.cjs} +4 -4
- package/dist/chunk-XJAN7CZG.cjs +432 -0
- package/dist/chunk-XL6INWKT.js +121 -0
- package/dist/{chunk-E3UALNFA.js → chunk-XMWZG36H.js} +4 -4
- package/dist/{chunk-BKIGPPVM.js → chunk-XSFNHP2E.js} +6 -3
- package/dist/{chunk-H5Z7NASB.js → chunk-XT6JY5W5.js} +25 -3
- package/dist/chunk-XXZJEFKW.cjs +490 -0
- package/dist/chunk-Y3MWXQSB.cjs +5737 -0
- package/dist/chunk-YF2I3MV3.js +46 -0
- package/dist/{chunk-V3NN3HPP.js → chunk-YIMN575O.js} +437 -52
- package/dist/chunk-YIVFJNYV.js +176 -0
- package/dist/{chunk-MD6KDHVE.cjs → chunk-YKGPCZEE.cjs} +10 -10
- package/dist/chunk-YQELFNJV.js +39 -0
- package/dist/chunk-Z5XMPRNC.cjs +5390 -0
- package/dist/{chunk-3FYZOR7S.cjs → chunk-ZDSYWBIE.cjs} +18 -18
- package/dist/{chunk-6TZPZCOJ.cjs → chunk-ZKSS47EV.cjs} +24 -19
- package/dist/chunk-ZUL5AVTX.cjs +1993 -0
- package/dist/chunk-ZXBZVXDW.js +5386 -0
- package/dist/{chunk-DMG7C4H2.js → chunk-ZZ7RO2UQ.js} +312 -44
- package/dist/cli/holoscript-runner.cjs +200 -204
- package/dist/cli/holoscript-runner.js +144 -148
- package/dist/codebase/index.cjs +1 -1
- package/dist/codebase/index.js +1 -1
- package/dist/compiler/agent-inference.cjs +10 -7
- package/dist/compiler/agent-inference.js +6 -3
- package/dist/compiler/android-xr.cjs +12 -7
- package/dist/compiler/android-xr.js +10 -5
- package/dist/compiler/android.cjs +12 -8
- package/dist/compiler/android.js +10 -6
- package/dist/compiler/ar.cjs +9 -6
- package/dist/compiler/ar.js +7 -4
- package/dist/compiler/babylon.cjs +12 -8
- package/dist/compiler/babylon.js +11 -7
- package/dist/compiler/business-quest.cjs +43 -0
- package/dist/compiler/business-quest.js +4 -0
- package/dist/compiler/coco.cjs +1 -1
- package/dist/compiler/coco.js +1 -1
- package/dist/compiler/context.cjs +25 -0
- package/dist/compiler/context.d.ts +28 -0
- package/dist/compiler/context.js +8 -0
- package/dist/compiler/domain-block-utils.cjs +155 -152
- package/dist/compiler/domain-block-utils.js +7 -4
- package/dist/compiler/dtdl.cjs +10 -7
- package/dist/compiler/dtdl.js +7 -4
- package/dist/compiler/gltf-pipeline.cjs +9 -9
- package/dist/compiler/gltf-pipeline.js +2 -2
- package/dist/compiler/godot.cjs +9 -6
- package/dist/compiler/godot.js +8 -5
- package/dist/compiler/incremental.cjs +12 -7
- package/dist/compiler/incremental.js +7 -2
- package/dist/compiler/index.cjs +3550 -268
- package/dist/compiler/index.d.ts +404 -21
- package/dist/compiler/index.js +3280 -138
- package/dist/compiler/ios.cjs +11 -8
- package/dist/compiler/ios.js +9 -6
- package/dist/compiler/llm-provider-capabilities.cjs +25 -0
- package/dist/compiler/llm-provider-capabilities.d.ts +43 -0
- package/dist/compiler/llm-provider-capabilities.js +8 -0
- package/dist/compiler/multi-layer.cjs +14 -10
- package/dist/compiler/multi-layer.js +13 -9
- package/dist/compiler/nodetoy.cjs +5 -5
- package/dist/compiler/nodetoy.js +2 -2
- package/dist/compiler/openxr.cjs +10 -6
- package/dist/compiler/openxr.js +9 -5
- package/dist/compiler/playcanvas.cjs +10 -7
- package/dist/compiler/playcanvas.js +9 -6
- package/dist/compiler/r3f.cjs +17 -13
- package/dist/compiler/r3f.d.ts +22 -0
- package/dist/compiler/r3f.js +12 -8
- 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 +10 -7
- package/dist/compiler/sdf.js +8 -5
- package/dist/compiler/semantic-scene.cjs +1 -1
- package/dist/compiler/semantic-scene.js +1 -1
- package/dist/compiler/state.cjs +9 -5
- package/dist/compiler/state.js +7 -3
- package/dist/compiler/trait-composition.cjs +11 -7
- package/dist/compiler/trait-composition.js +7 -3
- package/dist/compiler/unity.cjs +10 -6
- package/dist/compiler/unity.js +9 -5
- package/dist/compiler/unreal.cjs +11 -7
- package/dist/compiler/unreal.js +9 -5
- package/dist/compiler/urdf.cjs +20 -13
- package/dist/compiler/urdf.js +8 -5
- package/dist/compiler/usd-physics.cjs +10 -7
- package/dist/compiler/usd-physics.js +7 -4
- package/dist/compiler/visionos.cjs +10 -6
- package/dist/compiler/visionos.js +9 -5
- package/dist/compiler/vrchat.cjs +10 -7
- package/dist/compiler/vrchat.js +8 -5
- package/dist/compiler/vrr.cjs +10 -7
- package/dist/compiler/vrr.js +8 -5
- package/dist/compiler/wasm.cjs +13 -10
- package/dist/compiler/wasm.js +8 -5
- package/dist/compiler/webgpu.cjs +9 -6
- package/dist/compiler/webgpu.js +8 -5
- package/dist/constants.d.ts +3 -2
- package/dist/coordinators/index.cjs +1266 -0
- package/dist/coordinators/index.d.ts +260 -0
- package/dist/coordinators/index.js +1259 -0
- package/dist/debugger.cjs +9 -7
- package/dist/debugger.js +7 -5
- package/dist/entries/interop.cjs +23 -21
- package/dist/entries/interop.js +5 -3
- package/dist/entries/scripting.cjs +18 -18
- package/dist/entries/scripting.js +8 -8
- package/dist/hololand/index.cjs +146 -0
- package/dist/hololand/index.d.ts +70 -0
- package/dist/hololand/index.js +5 -0
- package/dist/index.cjs +20332 -18121
- package/dist/index.d.ts +1477 -40
- package/dist/index.js +19451 -17638
- package/dist/math/tropical-spmv.cjs +45 -0
- package/dist/math/tropical-spmv.js +4 -0
- package/dist/math/vec3.cjs +14 -14
- package/dist/math/vec3.js +2 -2
- package/dist/{ml-dsa-PHCWUBPX.cjs → ml-dsa-FSKBTE3W.cjs} +177 -90
- package/dist/{ml-dsa-WYLJHJO6.js → ml-dsa-Z7JDKW4L.js} +158 -71
- package/dist/paper-0c-spike/index.cjs +150 -0
- package/dist/paper-0c-spike/index.d.ts +29 -0
- package/dist/paper-0c-spike/index.js +141 -0
- package/dist/parser.cjs +45 -11
- package/dist/parser.d.ts +11 -0
- package/dist/parser.js +10 -8
- package/dist/{playwright-RL6GY4F7.cjs → playwright-3AT3AKTV.cjs} +1985 -1985
- package/dist/{playwright-5OSAPTNH.js → playwright-VZPDVUEQ.js} +3 -3
- package/dist/reconstruction/index.cjs +153 -0
- package/dist/reconstruction/index.d.ts +105 -0
- package/dist/reconstruction/index.js +8 -0
- package/dist/runtime.cjs +7 -5
- package/dist/runtime.js +6 -4
- package/dist/self-improvement/index.cjs +563 -0
- package/dist/self-improvement/index.js +545 -0
- package/dist/storage/index.cjs +10 -9
- package/dist/storage/index.js +3 -2
- package/dist/testing.cjs +25 -0
- package/dist/testing.d.ts +70 -0
- package/dist/testing.js +4 -0
- package/dist/tools/index.d.ts +22 -1
- package/dist/traitDocs/traitDocs.cjs +33 -0
- package/dist/traitDocs/traitDocs.d.ts +69 -0
- package/dist/traitDocs/traitDocs.js +7 -0
- package/dist/traits/botanical-lotus.cjs +41 -0
- package/dist/traits/botanical-lotus.d.ts +172 -0
- package/dist/traits/botanical-lotus.js +4 -0
- package/dist/traits/engines/index.cjs +520 -0
- package/dist/traits/engines/index.js +380 -0
- package/dist/traits/index.cjs +17630 -7881
- package/dist/traits/index.d.ts +197 -0
- package/dist/traits/index.js +16573 -7193
- package/dist/traits/simulation-solver-factory.cjs +13 -0
- package/dist/traits/simulation-solver-factory.d.ts +23 -0
- package/dist/traits/simulation-solver-factory.js +4 -0
- package/dist/traits/webcam-gaze.cjs +35 -0
- package/dist/traits/webcam-gaze.d.ts +17 -0
- package/dist/traits/webcam-gaze.js +4 -0
- package/dist/type-checker.cjs +6 -5
- package/dist/type-checker.js +4 -3
- package/dist/world/index.cjs +947 -0
- package/dist/world/index.d.ts +147 -0
- package/dist/world/index.js +939 -0
- package/dist/world-model/index.cjs +1446 -0
- package/dist/world-model/index.d.ts +119 -0
- package/dist/world-model/index.js +1414 -0
- package/dist/wot/index.cjs +29 -0
- package/dist/wot/index.js +4 -0
- package/package.json +153 -61
- package/dist/GLTFPipeline-DEN36VNK.js +0 -12
- package/dist/GLTFPipeline-YPCAK236.cjs +0 -33
- package/dist/chunk-4XSNJCLC.cjs +0 -1859
- package/dist/chunk-A7PIMZGU.js +0 -263
- package/dist/chunk-BWFJEM5A.js +0 -5419
- package/dist/chunk-CBJSLA2E.cjs +0 -5423
- package/dist/chunk-K3JDKWGI.cjs +0 -270
- package/dist/chunk-LSW7P7ML.js +0 -3675
- package/dist/chunk-MEASWI2Y.js +0 -126
- package/dist/chunk-NCUKG4SK.cjs +0 -3075
- package/dist/chunk-Q5JT3YML.cjs +0 -129
- package/dist/chunk-QGKNANZ3.js +0 -3071
- package/dist/chunk-S2N5TNMA.js +0 -1855
- package/dist/chunk-TSH3MSQU.cjs +0 -129
- package/dist/chunk-WGMEAYBG.js +0 -126
- package/dist/chunk-X6SEAXAX.cjs +0 -3681
|
@@ -0,0 +1,2092 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkHCCQLAA4_cjs = require('./chunk-HCCQLAA4.cjs');
|
|
4
|
+
|
|
5
|
+
// src/traitDocs/traitDocs.ts
|
|
6
|
+
function getTraitDoc(name) {
|
|
7
|
+
const normalized = name.toLowerCase().replace(/^@/, "").replace(/trait$/i, "").replace(/_/g, "");
|
|
8
|
+
if (exports.TRAIT_DOCS[normalized]) {
|
|
9
|
+
return exports.TRAIT_DOCS[normalized];
|
|
10
|
+
}
|
|
11
|
+
for (const [_key, doc] of Object.entries(exports.TRAIT_DOCS)) {
|
|
12
|
+
const annotation = doc.annotation.replace("@", "").toLowerCase();
|
|
13
|
+
const className = doc.name.toLowerCase();
|
|
14
|
+
if (annotation === normalized || className.includes(normalized)) {
|
|
15
|
+
return doc;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
function getAllTraitNames() {
|
|
21
|
+
return Object.values(exports.TRAIT_DOCS).map((doc) => doc.annotation);
|
|
22
|
+
}
|
|
23
|
+
function getTraitsByCategory(category) {
|
|
24
|
+
return Object.values(exports.TRAIT_DOCS).filter((doc) => doc.category === category);
|
|
25
|
+
}
|
|
26
|
+
function formatTraitDocAsMarkdown(doc) {
|
|
27
|
+
const lines = [];
|
|
28
|
+
lines.push(`## ${doc.annotation}`);
|
|
29
|
+
lines.push("");
|
|
30
|
+
lines.push(doc.description);
|
|
31
|
+
lines.push("");
|
|
32
|
+
lines.push(`**Category:** \`${doc.category}\``);
|
|
33
|
+
if (doc.since) {
|
|
34
|
+
lines.push(`**Since:** v${doc.since}`);
|
|
35
|
+
}
|
|
36
|
+
if (doc.deprecated) {
|
|
37
|
+
lines.push(`\u0393\xDC\xE1\u2229\u2555\xC5 **Deprecated:** ${doc.deprecationMessage || "This trait is deprecated."}`);
|
|
38
|
+
}
|
|
39
|
+
lines.push("");
|
|
40
|
+
if (doc.properties.length > 0) {
|
|
41
|
+
lines.push("### Properties");
|
|
42
|
+
lines.push("");
|
|
43
|
+
lines.push("| Property | Type | Default | Description |");
|
|
44
|
+
lines.push("|----------|------|---------|-------------|");
|
|
45
|
+
for (const prop of doc.properties) {
|
|
46
|
+
const required = prop.required ? " *(required)*" : "";
|
|
47
|
+
const defaultVal = prop.default ?? "-";
|
|
48
|
+
lines.push(
|
|
49
|
+
`| \`${prop.name}\` | \`${prop.type}\` | \`${defaultVal}\` | ${prop.description}${required} |`
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
lines.push("");
|
|
53
|
+
}
|
|
54
|
+
if (doc.methods.length > 0) {
|
|
55
|
+
lines.push("### Methods");
|
|
56
|
+
lines.push("");
|
|
57
|
+
for (const method of doc.methods) {
|
|
58
|
+
lines.push(`#### \`${method.signature}\``);
|
|
59
|
+
lines.push(method.description);
|
|
60
|
+
if (method.parameters.length > 0) {
|
|
61
|
+
lines.push("");
|
|
62
|
+
for (const param of method.parameters) {
|
|
63
|
+
const opt = param.optional ? " *(optional)*" : "";
|
|
64
|
+
lines.push(`- \`${param.name}: ${param.type}\` - ${param.description}${opt}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
if (method.returns) {
|
|
68
|
+
lines.push(`- **Returns:** \`${method.returns}\``);
|
|
69
|
+
}
|
|
70
|
+
lines.push("");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (doc.events.length > 0) {
|
|
74
|
+
lines.push("### Events");
|
|
75
|
+
lines.push("");
|
|
76
|
+
for (const event of doc.events) {
|
|
77
|
+
lines.push(`- **\`${event.name}\`** - ${event.description}`);
|
|
78
|
+
if (event.payload) {
|
|
79
|
+
lines.push(` - Payload: \`${event.payload}\``);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
lines.push("");
|
|
83
|
+
}
|
|
84
|
+
lines.push("### Example");
|
|
85
|
+
lines.push("");
|
|
86
|
+
lines.push("```holoscript");
|
|
87
|
+
lines.push(doc.example);
|
|
88
|
+
lines.push("```");
|
|
89
|
+
return lines.join("\n");
|
|
90
|
+
}
|
|
91
|
+
function formatTraitDocCompact(doc) {
|
|
92
|
+
const lines = [];
|
|
93
|
+
lines.push(`**${doc.annotation}** - ${doc.name}`);
|
|
94
|
+
lines.push("");
|
|
95
|
+
lines.push(doc.description);
|
|
96
|
+
lines.push("");
|
|
97
|
+
if (doc.properties.length > 0) {
|
|
98
|
+
lines.push("**Properties:**");
|
|
99
|
+
const props = doc.properties.slice(0, 5);
|
|
100
|
+
for (const prop of props) {
|
|
101
|
+
lines.push(`- \`${prop.name}: ${prop.type}\` - ${prop.description.split(".")[0]}`);
|
|
102
|
+
}
|
|
103
|
+
if (doc.properties.length > 5) {
|
|
104
|
+
lines.push(`- *...and ${doc.properties.length - 5} more*`);
|
|
105
|
+
}
|
|
106
|
+
lines.push("");
|
|
107
|
+
}
|
|
108
|
+
lines.push("```holoscript");
|
|
109
|
+
const exampleLines = doc.example.split("\n");
|
|
110
|
+
if (exampleLines.length > 10) {
|
|
111
|
+
lines.push(...exampleLines.slice(0, 8));
|
|
112
|
+
lines.push(" // ...");
|
|
113
|
+
} else {
|
|
114
|
+
lines.push(doc.example);
|
|
115
|
+
}
|
|
116
|
+
lines.push("```");
|
|
117
|
+
return lines.join("\n");
|
|
118
|
+
}
|
|
119
|
+
exports.TRAIT_DOCS = void 0;
|
|
120
|
+
var init_traitDocs = chunkHCCQLAA4_cjs.__esm({
|
|
121
|
+
"src/traitDocs/traitDocs.ts"() {
|
|
122
|
+
exports.TRAIT_DOCS = {
|
|
123
|
+
// ============================================================================
|
|
124
|
+
// Physics Traits
|
|
125
|
+
// ============================================================================
|
|
126
|
+
rigidbody: {
|
|
127
|
+
name: "RigidbodyTrait",
|
|
128
|
+
annotation: "@rigidbody",
|
|
129
|
+
description: "Enables physics simulation on an object. Supports dynamic, static, and kinematic body types with configurable mass, friction, and collision detection.",
|
|
130
|
+
category: "physics",
|
|
131
|
+
properties: [
|
|
132
|
+
{
|
|
133
|
+
name: "type",
|
|
134
|
+
type: '"dynamic" | "static" | "kinematic"',
|
|
135
|
+
description: "Body type. Dynamic bodies are affected by forces, static never move, kinematic are script-controlled.",
|
|
136
|
+
default: '"dynamic"'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "mass",
|
|
140
|
+
type: "number",
|
|
141
|
+
description: "Mass of the body in kg. Only affects dynamic bodies.",
|
|
142
|
+
default: "1.0"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "friction",
|
|
146
|
+
type: "number",
|
|
147
|
+
description: "Surface friction coefficient (0-1).",
|
|
148
|
+
default: "0.5"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "restitution",
|
|
152
|
+
type: "number",
|
|
153
|
+
description: "Bounciness coefficient (0-1).",
|
|
154
|
+
default: "0.0"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "linearDamping",
|
|
158
|
+
type: "number",
|
|
159
|
+
description: "Air resistance for linear motion.",
|
|
160
|
+
default: "0.0"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
name: "angularDamping",
|
|
164
|
+
type: "number",
|
|
165
|
+
description: "Air resistance for rotational motion.",
|
|
166
|
+
default: "0.05"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: "gravityScale",
|
|
170
|
+
type: "number",
|
|
171
|
+
description: "Multiplier for gravity. Set to 0 for floating objects.",
|
|
172
|
+
default: "1.0"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: "collisionGroup",
|
|
176
|
+
type: "number",
|
|
177
|
+
description: "Collision filtering group.",
|
|
178
|
+
default: "1"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "collisionMask",
|
|
182
|
+
type: "number",
|
|
183
|
+
description: "Bit mask for collision filtering.",
|
|
184
|
+
default: "-1"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
methods: [
|
|
188
|
+
{
|
|
189
|
+
name: "applyForce",
|
|
190
|
+
signature: "applyForce(force: Vec3): void",
|
|
191
|
+
description: "Apply a force to the center of mass.",
|
|
192
|
+
parameters: [{ name: "force", type: "Vec3", description: "Force vector in world space" }]
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: "applyImpulse",
|
|
196
|
+
signature: "applyImpulse(impulse: Vec3, point?: Vec3): void",
|
|
197
|
+
description: "Apply an instant impulse.",
|
|
198
|
+
parameters: [
|
|
199
|
+
{ name: "impulse", type: "Vec3", description: "Impulse vector" },
|
|
200
|
+
{
|
|
201
|
+
name: "point",
|
|
202
|
+
type: "Vec3",
|
|
203
|
+
description: "Application point (optional)",
|
|
204
|
+
optional: true
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
name: "applyTorque",
|
|
210
|
+
signature: "applyTorque(torque: Vec3): void",
|
|
211
|
+
description: "Apply rotational force.",
|
|
212
|
+
parameters: [{ name: "torque", type: "Vec3", description: "Torque vector" }]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: "setVelocity",
|
|
216
|
+
signature: "setVelocity(velocity: Vec3): void",
|
|
217
|
+
description: "Set linear velocity directly.",
|
|
218
|
+
parameters: [{ name: "velocity", type: "Vec3", description: "Velocity vector" }]
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: "getVelocity",
|
|
222
|
+
signature: "getVelocity(): Vec3",
|
|
223
|
+
description: "Get current linear velocity.",
|
|
224
|
+
parameters: [],
|
|
225
|
+
returns: "Vec3"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
events: [
|
|
229
|
+
{
|
|
230
|
+
name: "onCollisionStart",
|
|
231
|
+
description: "Fired when collision begins.",
|
|
232
|
+
payload: "{ other: Entity, point: Vec3, normal: Vec3 }"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "onCollisionEnd",
|
|
236
|
+
description: "Fired when collision ends.",
|
|
237
|
+
payload: "{ other: Entity }"
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
example: `@rigidbody({ type: "dynamic", mass: 2.0, friction: 0.3 })
|
|
241
|
+
orb physics_cube {
|
|
242
|
+
position: [0, 5, 0]
|
|
243
|
+
on_collision: {
|
|
244
|
+
play_sound: "impact.mp3"
|
|
245
|
+
}
|
|
246
|
+
}`,
|
|
247
|
+
since: "1.0.0"
|
|
248
|
+
},
|
|
249
|
+
trigger: {
|
|
250
|
+
name: "TriggerTrait",
|
|
251
|
+
annotation: "@trigger",
|
|
252
|
+
description: "Creates a trigger volume that detects when objects enter or exit. Does not cause physical collisions.",
|
|
253
|
+
category: "physics",
|
|
254
|
+
properties: [
|
|
255
|
+
{
|
|
256
|
+
name: "shape",
|
|
257
|
+
type: '"box" | "sphere" | "capsule"',
|
|
258
|
+
description: "Trigger volume shape.",
|
|
259
|
+
default: '"box"'
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
name: "size",
|
|
263
|
+
type: "Vec3",
|
|
264
|
+
description: "Size of the trigger volume.",
|
|
265
|
+
default: "[1, 1, 1]"
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
name: "radius",
|
|
269
|
+
type: "number",
|
|
270
|
+
description: "Radius for sphere/capsule triggers.",
|
|
271
|
+
default: "0.5"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
name: "height",
|
|
275
|
+
type: "number",
|
|
276
|
+
description: "Height for capsule triggers.",
|
|
277
|
+
default: "2.0"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: "layer",
|
|
281
|
+
type: "string",
|
|
282
|
+
description: "Collision layer for filtering.",
|
|
283
|
+
default: '"default"'
|
|
284
|
+
},
|
|
285
|
+
{ name: "once", type: "boolean", description: "Trigger only fires once.", default: "false" }
|
|
286
|
+
],
|
|
287
|
+
methods: [
|
|
288
|
+
{
|
|
289
|
+
name: "enable",
|
|
290
|
+
signature: "enable(): void",
|
|
291
|
+
description: "Enable the trigger.",
|
|
292
|
+
parameters: []
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
name: "disable",
|
|
296
|
+
signature: "disable(): void",
|
|
297
|
+
description: "Disable the trigger.",
|
|
298
|
+
parameters: []
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
name: "reset",
|
|
302
|
+
signature: "reset(): void",
|
|
303
|
+
description: "Reset a once-fire trigger.",
|
|
304
|
+
parameters: []
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
name: "getOverlapping",
|
|
308
|
+
signature: "getOverlapping(): Entity[]",
|
|
309
|
+
description: "Get all entities currently inside.",
|
|
310
|
+
parameters: [],
|
|
311
|
+
returns: "Entity[]"
|
|
312
|
+
}
|
|
313
|
+
],
|
|
314
|
+
events: [
|
|
315
|
+
{
|
|
316
|
+
name: "onTriggerEnter",
|
|
317
|
+
description: "Fired when an object enters the trigger.",
|
|
318
|
+
payload: "{ entity: Entity }"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: "onTriggerExit",
|
|
322
|
+
description: "Fired when an object exits the trigger.",
|
|
323
|
+
payload: "{ entity: Entity }"
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
name: "onTriggerStay",
|
|
327
|
+
description: "Fired each frame an object is inside (use cautiously).",
|
|
328
|
+
payload: "{ entity: Entity }"
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
example: `@trigger({ shape: "sphere", radius: 3.0, layer: "player" })
|
|
332
|
+
orb checkpoint {
|
|
333
|
+
position: [10, 0, 0]
|
|
334
|
+
on_trigger_enter: {
|
|
335
|
+
save_progress: true
|
|
336
|
+
play_sound: "checkpoint.mp3"
|
|
337
|
+
}
|
|
338
|
+
}`,
|
|
339
|
+
since: "1.0.0"
|
|
340
|
+
},
|
|
341
|
+
joint: {
|
|
342
|
+
name: "JointTrait",
|
|
343
|
+
annotation: "@joint",
|
|
344
|
+
description: "Creates a physics joint connecting two rigidbodies. Supports various joint types for complex mechanical systems.",
|
|
345
|
+
category: "physics",
|
|
346
|
+
properties: [
|
|
347
|
+
{
|
|
348
|
+
name: "type",
|
|
349
|
+
type: '"fixed" | "hinge" | "ball" | "slider" | "spring" | "distance"',
|
|
350
|
+
description: "Type of joint.",
|
|
351
|
+
required: true
|
|
352
|
+
},
|
|
353
|
+
{ name: "target", type: "string", description: "Entity ID to connect to.", required: true },
|
|
354
|
+
{ name: "anchor", type: "Vec3", description: "Local anchor point.", default: "[0, 0, 0]" },
|
|
355
|
+
{
|
|
356
|
+
name: "targetAnchor",
|
|
357
|
+
type: "Vec3",
|
|
358
|
+
description: "Anchor point on target.",
|
|
359
|
+
default: "[0, 0, 0]"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: "axis",
|
|
363
|
+
type: "Vec3",
|
|
364
|
+
description: "Axis for hinge/slider joints.",
|
|
365
|
+
default: "[0, 1, 0]"
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: "minLimit",
|
|
369
|
+
type: "number",
|
|
370
|
+
description: "Minimum angle/distance limit.",
|
|
371
|
+
default: "-Infinity"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
name: "maxLimit",
|
|
375
|
+
type: "number",
|
|
376
|
+
description: "Maximum angle/distance limit.",
|
|
377
|
+
default: "Infinity"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
name: "breakForce",
|
|
381
|
+
type: "number",
|
|
382
|
+
description: "Force required to break joint.",
|
|
383
|
+
default: "Infinity"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "spring",
|
|
387
|
+
type: "number",
|
|
388
|
+
description: "Spring stiffness for spring joints.",
|
|
389
|
+
default: "0"
|
|
390
|
+
},
|
|
391
|
+
{ name: "damper", type: "number", description: "Damping for spring joints.", default: "0" }
|
|
392
|
+
],
|
|
393
|
+
methods: [
|
|
394
|
+
{
|
|
395
|
+
name: "break",
|
|
396
|
+
signature: "break(): void",
|
|
397
|
+
description: "Manually break the joint.",
|
|
398
|
+
parameters: []
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
name: "setMotor",
|
|
402
|
+
signature: "setMotor(speed: number, maxForce: number): void",
|
|
403
|
+
description: "Set motor parameters for hinge/slider.",
|
|
404
|
+
parameters: [
|
|
405
|
+
{ name: "speed", type: "number", description: "Target speed" },
|
|
406
|
+
{ name: "maxForce", type: "number", description: "Maximum motor force" }
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
events: [
|
|
411
|
+
{
|
|
412
|
+
name: "onJointBreak",
|
|
413
|
+
description: "Fired when joint breaks.",
|
|
414
|
+
payload: "{ force: number }"
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
example: `@joint({ type: "hinge", target: "door_frame", axis: [0, 1, 0], minLimit: 0, maxLimit: 90 })
|
|
418
|
+
orb door {
|
|
419
|
+
position: [0, 1, 0]
|
|
420
|
+
}`,
|
|
421
|
+
since: "1.2.0"
|
|
422
|
+
},
|
|
423
|
+
// ============================================================================
|
|
424
|
+
// Animation Traits
|
|
425
|
+
// ============================================================================
|
|
426
|
+
ik: {
|
|
427
|
+
name: "IKTrait",
|
|
428
|
+
annotation: "@ik",
|
|
429
|
+
description: "Inverse Kinematics for skeletal animation. Supports FABRIK, CCD, Two-Bone, and Full-Body solvers for realistic limb positioning.",
|
|
430
|
+
category: "animation",
|
|
431
|
+
properties: [
|
|
432
|
+
{
|
|
433
|
+
name: "solver",
|
|
434
|
+
type: '"fabrik" | "ccd" | "two-bone" | "full-body"',
|
|
435
|
+
description: "IK solver algorithm to use.",
|
|
436
|
+
default: '"fabrik"'
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
name: "iterations",
|
|
440
|
+
type: "number",
|
|
441
|
+
description: "Solver iterations per frame.",
|
|
442
|
+
default: "10"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
name: "tolerance",
|
|
446
|
+
type: "number",
|
|
447
|
+
description: "Position tolerance for convergence.",
|
|
448
|
+
default: "0.001"
|
|
449
|
+
},
|
|
450
|
+
{ name: "chains", type: "IKChain[]", description: "IK chain definitions.", required: true },
|
|
451
|
+
{
|
|
452
|
+
name: "constraints",
|
|
453
|
+
type: "JointConstraint[]",
|
|
454
|
+
description: "Joint rotation constraints."
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
methods: [
|
|
458
|
+
{
|
|
459
|
+
name: "solve",
|
|
460
|
+
signature: "solve(target: Vec3): boolean",
|
|
461
|
+
description: "Solve IK for a target position.",
|
|
462
|
+
parameters: [
|
|
463
|
+
{ name: "target", type: "Vec3", description: "Target position in world space" }
|
|
464
|
+
],
|
|
465
|
+
returns: "boolean"
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
name: "addChain",
|
|
469
|
+
signature: "addChain(chain: IKChain): void",
|
|
470
|
+
description: "Add an IK chain.",
|
|
471
|
+
parameters: [{ name: "chain", type: "IKChain", description: "Chain configuration" }]
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
name: "removeChain",
|
|
475
|
+
signature: "removeChain(name: string): void",
|
|
476
|
+
description: "Remove an IK chain.",
|
|
477
|
+
parameters: [{ name: "name", type: "string", description: "Chain name" }]
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
name: "setTarget",
|
|
481
|
+
signature: "setTarget(chainName: string, target: Vec3): void",
|
|
482
|
+
description: "Set target for a specific chain.",
|
|
483
|
+
parameters: [
|
|
484
|
+
{ name: "chainName", type: "string", description: "Chain to target" },
|
|
485
|
+
{ name: "target", type: "Vec3", description: "Target position" }
|
|
486
|
+
]
|
|
487
|
+
}
|
|
488
|
+
],
|
|
489
|
+
events: [
|
|
490
|
+
{
|
|
491
|
+
name: "onIKSolved",
|
|
492
|
+
description: "Fired when IK solution is found.",
|
|
493
|
+
payload: "{ chain: string, iterations: number }"
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: "onIKFailed",
|
|
497
|
+
description: "Fired when IK cannot reach target.",
|
|
498
|
+
payload: "{ chain: string, distance: number }"
|
|
499
|
+
}
|
|
500
|
+
],
|
|
501
|
+
example: `@ik({ solver: "fabrik", iterations: 20 })
|
|
502
|
+
@skeleton({ armature: "humanoid" })
|
|
503
|
+
orb character {
|
|
504
|
+
chains: [
|
|
505
|
+
{ name: "left_arm", bones: ["shoulder_l", "elbow_l", "wrist_l"], target: "left_hand_target" },
|
|
506
|
+
{ name: "right_arm", bones: ["shoulder_r", "elbow_r", "wrist_r"], target: "right_hand_target" }
|
|
507
|
+
]
|
|
508
|
+
}`,
|
|
509
|
+
since: "1.3.0"
|
|
510
|
+
},
|
|
511
|
+
skeleton: {
|
|
512
|
+
name: "SkeletonTrait",
|
|
513
|
+
annotation: "@skeleton",
|
|
514
|
+
description: "Skeletal animation system for rigged models. Supports blend trees, animation layers, and procedural bone control.",
|
|
515
|
+
category: "animation",
|
|
516
|
+
properties: [
|
|
517
|
+
{
|
|
518
|
+
name: "armature",
|
|
519
|
+
type: "string",
|
|
520
|
+
description: "Armature/skeleton asset reference.",
|
|
521
|
+
required: true
|
|
522
|
+
},
|
|
523
|
+
{ name: "animations", type: "AnimationClip[]", description: "Available animation clips." },
|
|
524
|
+
{ name: "defaultAnimation", type: "string", description: "Animation to play on start." },
|
|
525
|
+
{
|
|
526
|
+
name: "blendMode",
|
|
527
|
+
type: '"override" | "additive"',
|
|
528
|
+
description: "How animations combine.",
|
|
529
|
+
default: '"override"'
|
|
530
|
+
}
|
|
531
|
+
],
|
|
532
|
+
methods: [
|
|
533
|
+
{
|
|
534
|
+
name: "play",
|
|
535
|
+
signature: "play(name: string, options?: PlayOptions): void",
|
|
536
|
+
description: "Play an animation.",
|
|
537
|
+
parameters: [
|
|
538
|
+
{ name: "name", type: "string", description: "Animation name" },
|
|
539
|
+
{ name: "options", type: "PlayOptions", description: "Playback options", optional: true }
|
|
540
|
+
]
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
name: "stop",
|
|
544
|
+
signature: "stop(name?: string): void",
|
|
545
|
+
description: "Stop animation(s).",
|
|
546
|
+
parameters: [
|
|
547
|
+
{
|
|
548
|
+
name: "name",
|
|
549
|
+
type: "string",
|
|
550
|
+
description: "Specific animation or all",
|
|
551
|
+
optional: true
|
|
552
|
+
}
|
|
553
|
+
]
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
name: "crossFade",
|
|
557
|
+
signature: "crossFade(name: string, duration: number): void",
|
|
558
|
+
description: "Smoothly transition to animation.",
|
|
559
|
+
parameters: [
|
|
560
|
+
{ name: "name", type: "string", description: "Target animation" },
|
|
561
|
+
{ name: "duration", type: "number", description: "Transition duration in seconds" }
|
|
562
|
+
]
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: "getBone",
|
|
566
|
+
signature: "getBone(name: string): Bone",
|
|
567
|
+
description: "Get bone for manual manipulation.",
|
|
568
|
+
parameters: [{ name: "name", type: "string", description: "Bone name" }],
|
|
569
|
+
returns: "Bone"
|
|
570
|
+
},
|
|
571
|
+
{
|
|
572
|
+
name: "setLayerWeight",
|
|
573
|
+
signature: "setLayerWeight(layer: number, weight: number): void",
|
|
574
|
+
description: "Set animation layer blend weight.",
|
|
575
|
+
parameters: [
|
|
576
|
+
{ name: "layer", type: "number", description: "Layer index" },
|
|
577
|
+
{ name: "weight", type: "number", description: "Blend weight (0-1)" }
|
|
578
|
+
]
|
|
579
|
+
}
|
|
580
|
+
],
|
|
581
|
+
events: [
|
|
582
|
+
{
|
|
583
|
+
name: "onAnimationStart",
|
|
584
|
+
description: "Fired when animation starts.",
|
|
585
|
+
payload: "{ name: string }"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
name: "onAnimationEnd",
|
|
589
|
+
description: "Fired when animation completes.",
|
|
590
|
+
payload: "{ name: string }"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
name: "onAnimationLoop",
|
|
594
|
+
description: "Fired when animation loops.",
|
|
595
|
+
payload: "{ name: string, loopCount: number }"
|
|
596
|
+
}
|
|
597
|
+
],
|
|
598
|
+
example: `@skeleton({ armature: "humanoid_rig" })
|
|
599
|
+
orb character {
|
|
600
|
+
model: "character.glb"
|
|
601
|
+
animations: ["idle", "walk", "run", "jump"]
|
|
602
|
+
defaultAnimation: "idle"
|
|
603
|
+
}`,
|
|
604
|
+
since: "1.0.0"
|
|
605
|
+
},
|
|
606
|
+
morph: {
|
|
607
|
+
name: "MorphTrait",
|
|
608
|
+
annotation: "@morph",
|
|
609
|
+
description: "Morph target (blend shape) animation for facial expressions and mesh deformation.",
|
|
610
|
+
category: "animation",
|
|
611
|
+
properties: [
|
|
612
|
+
{ name: "targets", type: "string[]", description: "Available morph target names." },
|
|
613
|
+
{ name: "weights", type: "Record<string, number>", description: "Initial morph weights." }
|
|
614
|
+
],
|
|
615
|
+
methods: [
|
|
616
|
+
{
|
|
617
|
+
name: "setWeight",
|
|
618
|
+
signature: "setWeight(target: string, weight: number): void",
|
|
619
|
+
description: "Set morph target weight.",
|
|
620
|
+
parameters: [
|
|
621
|
+
{ name: "target", type: "string", description: "Target name" },
|
|
622
|
+
{ name: "weight", type: "number", description: "Weight (0-1)" }
|
|
623
|
+
]
|
|
624
|
+
},
|
|
625
|
+
{
|
|
626
|
+
name: "getWeight",
|
|
627
|
+
signature: "getWeight(target: string): number",
|
|
628
|
+
description: "Get current weight.",
|
|
629
|
+
parameters: [{ name: "target", type: "string", description: "Target name" }],
|
|
630
|
+
returns: "number"
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
name: "animate",
|
|
634
|
+
signature: "animate(target: string, from: number, to: number, duration: number): Promise<void>",
|
|
635
|
+
description: "Animate morph weight.",
|
|
636
|
+
parameters: [
|
|
637
|
+
{ name: "target", type: "string", description: "Target name" },
|
|
638
|
+
{ name: "from", type: "number", description: "Start weight" },
|
|
639
|
+
{ name: "to", type: "number", description: "End weight" },
|
|
640
|
+
{ name: "duration", type: "number", description: "Duration in seconds" }
|
|
641
|
+
]
|
|
642
|
+
}
|
|
643
|
+
],
|
|
644
|
+
events: [],
|
|
645
|
+
example: `@morph({ targets: ["smile", "frown", "blink_l", "blink_r"] })
|
|
646
|
+
orb face {
|
|
647
|
+
model: "head.glb"
|
|
648
|
+
weights: { smile: 0.5 }
|
|
649
|
+
}`,
|
|
650
|
+
since: "1.4.0"
|
|
651
|
+
},
|
|
652
|
+
// ============================================================================
|
|
653
|
+
// Rendering Traits
|
|
654
|
+
// ============================================================================
|
|
655
|
+
material: {
|
|
656
|
+
name: "MaterialTrait",
|
|
657
|
+
annotation: "@material",
|
|
658
|
+
description: "Custom material properties for advanced rendering. Supports PBR, custom shaders, and dynamic material updates.",
|
|
659
|
+
category: "rendering",
|
|
660
|
+
properties: [
|
|
661
|
+
{
|
|
662
|
+
name: "type",
|
|
663
|
+
type: '"standard" | "unlit" | "custom"',
|
|
664
|
+
description: "Material type.",
|
|
665
|
+
default: '"standard"'
|
|
666
|
+
},
|
|
667
|
+
{ name: "color", type: "Color", description: "Base color.", default: "[1, 1, 1]" },
|
|
668
|
+
{ name: "metalness", type: "number", description: "Metallic factor (0-1).", default: "0.0" },
|
|
669
|
+
{ name: "roughness", type: "number", description: "Roughness factor (0-1).", default: "1.0" },
|
|
670
|
+
{ name: "emissive", type: "Color", description: "Emissive color." },
|
|
671
|
+
{
|
|
672
|
+
name: "emissiveIntensity",
|
|
673
|
+
type: "number",
|
|
674
|
+
description: "Emission intensity.",
|
|
675
|
+
default: "1.0"
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: "transparent",
|
|
679
|
+
type: "boolean",
|
|
680
|
+
description: "Enable transparency.",
|
|
681
|
+
default: "false"
|
|
682
|
+
},
|
|
683
|
+
{ name: "opacity", type: "number", description: "Opacity (0-1).", default: "1.0" },
|
|
684
|
+
{ name: "doubleSided", type: "boolean", description: "Render both sides.", default: "false" },
|
|
685
|
+
{ name: "map", type: "string", description: "Diffuse texture path." },
|
|
686
|
+
{ name: "normalMap", type: "string", description: "Normal map path." },
|
|
687
|
+
{ name: "roughnessMap", type: "string", description: "Roughness texture path." },
|
|
688
|
+
{ name: "metalnessMap", type: "string", description: "Metalness texture path." },
|
|
689
|
+
{ name: "emissiveMap", type: "string", description: "Emission texture path." },
|
|
690
|
+
{ name: "aoMap", type: "string", description: "Ambient occlusion texture path." }
|
|
691
|
+
],
|
|
692
|
+
methods: [
|
|
693
|
+
{
|
|
694
|
+
name: "setColor",
|
|
695
|
+
signature: "setColor(color: Color): void",
|
|
696
|
+
description: "Set base color.",
|
|
697
|
+
parameters: [{ name: "color", type: "Color", description: "RGB color" }]
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
name: "setTexture",
|
|
701
|
+
signature: "setTexture(slot: string, path: string): void",
|
|
702
|
+
description: "Set a texture.",
|
|
703
|
+
parameters: [
|
|
704
|
+
{ name: "slot", type: "string", description: "Texture slot name" },
|
|
705
|
+
{ name: "path", type: "string", description: "Asset path" }
|
|
706
|
+
]
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
name: "setUniform",
|
|
710
|
+
signature: "setUniform(name: string, value: any): void",
|
|
711
|
+
description: "Set custom shader uniform.",
|
|
712
|
+
parameters: [
|
|
713
|
+
{ name: "name", type: "string", description: "Uniform name" },
|
|
714
|
+
{ name: "value", type: "any", description: "Uniform value" }
|
|
715
|
+
]
|
|
716
|
+
}
|
|
717
|
+
],
|
|
718
|
+
events: [],
|
|
719
|
+
example: `@material({
|
|
720
|
+
type: "standard",
|
|
721
|
+
color: [0.8, 0.2, 0.2],
|
|
722
|
+
metalness: 0.9,
|
|
723
|
+
roughness: 0.1,
|
|
724
|
+
emissive: [1, 0, 0],
|
|
725
|
+
emissiveIntensity: 0.5
|
|
726
|
+
})
|
|
727
|
+
orb glowing_metal_sphere {
|
|
728
|
+
model: "sphere"
|
|
729
|
+
}`,
|
|
730
|
+
since: "1.0.0"
|
|
731
|
+
},
|
|
732
|
+
shader: {
|
|
733
|
+
name: "ShaderTrait",
|
|
734
|
+
annotation: "@shader",
|
|
735
|
+
description: "Custom shader support for advanced visual effects. Write GLSL or use shader graphs.",
|
|
736
|
+
category: "rendering",
|
|
737
|
+
properties: [
|
|
738
|
+
{ name: "vertex", type: "string", description: "Vertex shader source/path." },
|
|
739
|
+
{ name: "fragment", type: "string", description: "Fragment shader source/path." },
|
|
740
|
+
{
|
|
741
|
+
name: "uniforms",
|
|
742
|
+
type: "Record<string, UniformDef>",
|
|
743
|
+
description: "Shader uniform definitions."
|
|
744
|
+
},
|
|
745
|
+
{ name: "defines", type: "Record<string, string>", description: "Preprocessor defines." }
|
|
746
|
+
],
|
|
747
|
+
methods: [
|
|
748
|
+
{
|
|
749
|
+
name: "setUniform",
|
|
750
|
+
signature: "setUniform(name: string, value: any): void",
|
|
751
|
+
description: "Set uniform value.",
|
|
752
|
+
parameters: [
|
|
753
|
+
{ name: "name", type: "string", description: "Uniform name" },
|
|
754
|
+
{ name: "value", type: "any", description: "Value" }
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
name: "recompile",
|
|
759
|
+
signature: "recompile(): void",
|
|
760
|
+
description: "Recompile shaders.",
|
|
761
|
+
parameters: []
|
|
762
|
+
}
|
|
763
|
+
],
|
|
764
|
+
events: [
|
|
765
|
+
{
|
|
766
|
+
name: "onShaderError",
|
|
767
|
+
description: "Fired on compilation error.",
|
|
768
|
+
payload: "{ error: string, line: number }"
|
|
769
|
+
}
|
|
770
|
+
],
|
|
771
|
+
example: `@shader({
|
|
772
|
+
fragment: "shaders/hologram.frag",
|
|
773
|
+
uniforms: {
|
|
774
|
+
time: { type: "float", value: 0 },
|
|
775
|
+
scanlineSpeed: { type: "float", value: 2.0 }
|
|
776
|
+
}
|
|
777
|
+
})
|
|
778
|
+
orb hologram {
|
|
779
|
+
on_update: {
|
|
780
|
+
shader.time = Time.elapsed
|
|
781
|
+
}
|
|
782
|
+
}`,
|
|
783
|
+
since: "1.1.0"
|
|
784
|
+
},
|
|
785
|
+
lighting: {
|
|
786
|
+
name: "LightingTrait",
|
|
787
|
+
annotation: "@lighting",
|
|
788
|
+
description: "Light source configuration. Create point lights, spot lights, and directional lights.",
|
|
789
|
+
category: "rendering",
|
|
790
|
+
properties: [
|
|
791
|
+
{
|
|
792
|
+
name: "type",
|
|
793
|
+
type: '"point" | "spot" | "directional" | "area"',
|
|
794
|
+
description: "Light type.",
|
|
795
|
+
required: true
|
|
796
|
+
},
|
|
797
|
+
{ name: "color", type: "Color", description: "Light color.", default: "[1, 1, 1]" },
|
|
798
|
+
{ name: "intensity", type: "number", description: "Light intensity.", default: "1.0" },
|
|
799
|
+
{ name: "range", type: "number", description: "Light range for point/spot." },
|
|
800
|
+
{
|
|
801
|
+
name: "angle",
|
|
802
|
+
type: "number",
|
|
803
|
+
description: "Cone angle for spot lights (degrees).",
|
|
804
|
+
default: "45"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
name: "penumbra",
|
|
808
|
+
type: "number",
|
|
809
|
+
description: "Soft edge percentage for spots.",
|
|
810
|
+
default: "0.1"
|
|
811
|
+
},
|
|
812
|
+
{
|
|
813
|
+
name: "castShadow",
|
|
814
|
+
type: "boolean",
|
|
815
|
+
description: "Enable shadow casting.",
|
|
816
|
+
default: "false"
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
name: "shadowMapSize",
|
|
820
|
+
type: "number",
|
|
821
|
+
description: "Shadow map resolution.",
|
|
822
|
+
default: "512"
|
|
823
|
+
},
|
|
824
|
+
{
|
|
825
|
+
name: "shadowBias",
|
|
826
|
+
type: "number",
|
|
827
|
+
description: "Shadow bias to prevent artifacts.",
|
|
828
|
+
default: "0.0001"
|
|
829
|
+
}
|
|
830
|
+
],
|
|
831
|
+
methods: [
|
|
832
|
+
{
|
|
833
|
+
name: "setIntensity",
|
|
834
|
+
signature: "setIntensity(intensity: number): void",
|
|
835
|
+
description: "Set light intensity.",
|
|
836
|
+
parameters: [{ name: "intensity", type: "number", description: "New intensity" }]
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
name: "setColor",
|
|
840
|
+
signature: "setColor(color: Color): void",
|
|
841
|
+
description: "Set light color.",
|
|
842
|
+
parameters: [{ name: "color", type: "Color", description: "RGB color" }]
|
|
843
|
+
}
|
|
844
|
+
],
|
|
845
|
+
events: [],
|
|
846
|
+
example: `@lighting({ type: "spot", color: [1, 0.9, 0.8], intensity: 2.0, angle: 30, castShadow: true })
|
|
847
|
+
orb spotlight {
|
|
848
|
+
position: [0, 5, 0]
|
|
849
|
+
rotation: [90, 0, 0]
|
|
850
|
+
}`,
|
|
851
|
+
since: "1.0.0"
|
|
852
|
+
},
|
|
853
|
+
rendering: {
|
|
854
|
+
name: "RenderingTrait",
|
|
855
|
+
annotation: "@rendering",
|
|
856
|
+
description: "Advanced rendering options for objects. Control visibility, render order, and special effects.",
|
|
857
|
+
category: "rendering",
|
|
858
|
+
properties: [
|
|
859
|
+
{ name: "visible", type: "boolean", description: "Object visibility.", default: "true" },
|
|
860
|
+
{
|
|
861
|
+
name: "castShadow",
|
|
862
|
+
type: "boolean",
|
|
863
|
+
description: "Object casts shadows.",
|
|
864
|
+
default: "true"
|
|
865
|
+
},
|
|
866
|
+
{
|
|
867
|
+
name: "receiveShadow",
|
|
868
|
+
type: "boolean",
|
|
869
|
+
description: "Object receives shadows.",
|
|
870
|
+
default: "true"
|
|
871
|
+
},
|
|
872
|
+
{ name: "renderOrder", type: "number", description: "Manual render order.", default: "0" },
|
|
873
|
+
{
|
|
874
|
+
name: "frustumCulled",
|
|
875
|
+
type: "boolean",
|
|
876
|
+
description: "Enable frustum culling.",
|
|
877
|
+
default: "true"
|
|
878
|
+
},
|
|
879
|
+
{ name: "layers", type: "number", description: "Visibility layer mask.", default: "1" }
|
|
880
|
+
],
|
|
881
|
+
methods: [
|
|
882
|
+
{
|
|
883
|
+
name: "show",
|
|
884
|
+
signature: "show(): void",
|
|
885
|
+
description: "Make object visible.",
|
|
886
|
+
parameters: []
|
|
887
|
+
},
|
|
888
|
+
{ name: "hide", signature: "hide(): void", description: "Hide object.", parameters: [] },
|
|
889
|
+
{
|
|
890
|
+
name: "setLayer",
|
|
891
|
+
signature: "setLayer(layer: number): void",
|
|
892
|
+
description: "Set visibility layer.",
|
|
893
|
+
parameters: [{ name: "layer", type: "number", description: "Layer index" }]
|
|
894
|
+
}
|
|
895
|
+
],
|
|
896
|
+
events: [
|
|
897
|
+
{ name: "onBecameVisible", description: "Fired when object enters camera view." },
|
|
898
|
+
{ name: "onBecameInvisible", description: "Fired when object leaves camera view." }
|
|
899
|
+
],
|
|
900
|
+
example: `@rendering({ castShadow: true, receiveShadow: false, renderOrder: 100 })
|
|
901
|
+
orb ui_element {
|
|
902
|
+
// Renders on top due to high renderOrder
|
|
903
|
+
}`,
|
|
904
|
+
since: "1.0.0"
|
|
905
|
+
},
|
|
906
|
+
// ============================================================================
|
|
907
|
+
// Networking Traits
|
|
908
|
+
// ============================================================================
|
|
909
|
+
networked: {
|
|
910
|
+
name: "NetworkedTrait",
|
|
911
|
+
annotation: "@networked",
|
|
912
|
+
description: "Enable multiplayer synchronization for an object. Automatically syncs position, rotation, and custom state across clients.",
|
|
913
|
+
category: "networking",
|
|
914
|
+
properties: [
|
|
915
|
+
{
|
|
916
|
+
name: "owner",
|
|
917
|
+
type: '"server" | "client" | "shared"',
|
|
918
|
+
description: "Ownership model.",
|
|
919
|
+
default: '"server"'
|
|
920
|
+
},
|
|
921
|
+
{ name: "syncRate", type: "number", description: "Sync updates per second.", default: "20" },
|
|
922
|
+
{
|
|
923
|
+
name: "interpolate",
|
|
924
|
+
type: "boolean",
|
|
925
|
+
description: "Smooth position updates.",
|
|
926
|
+
default: "true"
|
|
927
|
+
},
|
|
928
|
+
{ name: "syncPosition", type: "boolean", description: "Sync position.", default: "true" },
|
|
929
|
+
{ name: "syncRotation", type: "boolean", description: "Sync rotation.", default: "true" },
|
|
930
|
+
{ name: "syncScale", type: "boolean", description: "Sync scale.", default: "false" },
|
|
931
|
+
{ name: "syncProperties", type: "string[]", description: "Custom properties to sync." },
|
|
932
|
+
{
|
|
933
|
+
name: "priority",
|
|
934
|
+
type: '"low" | "medium" | "high"',
|
|
935
|
+
description: "Network priority.",
|
|
936
|
+
default: '"medium"'
|
|
937
|
+
}
|
|
938
|
+
],
|
|
939
|
+
methods: [
|
|
940
|
+
{
|
|
941
|
+
name: "requestOwnership",
|
|
942
|
+
signature: "requestOwnership(): Promise<boolean>",
|
|
943
|
+
description: "Request ownership of this object.",
|
|
944
|
+
parameters: [],
|
|
945
|
+
returns: "Promise<boolean>"
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
name: "releaseOwnership",
|
|
949
|
+
signature: "releaseOwnership(): void",
|
|
950
|
+
description: "Release ownership.",
|
|
951
|
+
parameters: []
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
name: "rpc",
|
|
955
|
+
signature: "rpc(method: string, ...args: any[]): void",
|
|
956
|
+
description: "Call a method on all clients.",
|
|
957
|
+
parameters: [
|
|
958
|
+
{ name: "method", type: "string", description: "Method name" },
|
|
959
|
+
{ name: "args", type: "any[]", description: "Arguments" }
|
|
960
|
+
]
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
name: "rpcTo",
|
|
964
|
+
signature: "rpcTo(clientId: string, method: string, ...args: any[]): void",
|
|
965
|
+
description: "Call method on specific client.",
|
|
966
|
+
parameters: [
|
|
967
|
+
{ name: "clientId", type: "string", description: "Target client" },
|
|
968
|
+
{ name: "method", type: "string", description: "Method name" },
|
|
969
|
+
{ name: "args", type: "any[]", description: "Arguments" }
|
|
970
|
+
]
|
|
971
|
+
}
|
|
972
|
+
],
|
|
973
|
+
events: [
|
|
974
|
+
{
|
|
975
|
+
name: "onOwnershipChanged",
|
|
976
|
+
description: "Fired when owner changes.",
|
|
977
|
+
payload: "{ oldOwner: string, newOwner: string }"
|
|
978
|
+
},
|
|
979
|
+
{
|
|
980
|
+
name: "onSyncReceived",
|
|
981
|
+
description: "Fired when sync update received.",
|
|
982
|
+
payload: "{ delta: number }"
|
|
983
|
+
}
|
|
984
|
+
],
|
|
985
|
+
example: `@networked({ owner: "client", syncRate: 30, syncProperties: ["health", "score"] })
|
|
986
|
+
orb player {
|
|
987
|
+
state: {
|
|
988
|
+
health: 100
|
|
989
|
+
score: 0
|
|
990
|
+
}
|
|
991
|
+
}`,
|
|
992
|
+
since: "1.0.0"
|
|
993
|
+
},
|
|
994
|
+
lobby: {
|
|
995
|
+
name: "LobbyTrait",
|
|
996
|
+
annotation: "@lobby",
|
|
997
|
+
description: "Multiplayer lobby management. Handle room creation, matchmaking, and player management.",
|
|
998
|
+
category: "networking",
|
|
999
|
+
properties: [
|
|
1000
|
+
{
|
|
1001
|
+
name: "maxPlayers",
|
|
1002
|
+
type: "number",
|
|
1003
|
+
description: "Maximum players in lobby.",
|
|
1004
|
+
default: "8"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
name: "isPublic",
|
|
1008
|
+
type: "boolean",
|
|
1009
|
+
description: "Lobby is publicly visible.",
|
|
1010
|
+
default: "true"
|
|
1011
|
+
},
|
|
1012
|
+
{ name: "gameMode", type: "string", description: "Game mode identifier." },
|
|
1013
|
+
{ name: "region", type: "string", description: "Preferred server region." },
|
|
1014
|
+
{ name: "metadata", type: "Record<string, any>", description: "Custom lobby metadata." }
|
|
1015
|
+
],
|
|
1016
|
+
methods: [
|
|
1017
|
+
{
|
|
1018
|
+
name: "create",
|
|
1019
|
+
signature: "create(options?: LobbyOptions): Promise<string>",
|
|
1020
|
+
description: "Create a new lobby.",
|
|
1021
|
+
parameters: [
|
|
1022
|
+
{ name: "options", type: "LobbyOptions", description: "Lobby options", optional: true }
|
|
1023
|
+
],
|
|
1024
|
+
returns: "Promise<string>"
|
|
1025
|
+
},
|
|
1026
|
+
{
|
|
1027
|
+
name: "join",
|
|
1028
|
+
signature: "join(lobbyId: string): Promise<boolean>",
|
|
1029
|
+
description: "Join an existing lobby.",
|
|
1030
|
+
parameters: [{ name: "lobbyId", type: "string", description: "Lobby ID" }],
|
|
1031
|
+
returns: "Promise<boolean>"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
name: "leave",
|
|
1035
|
+
signature: "leave(): void",
|
|
1036
|
+
description: "Leave current lobby.",
|
|
1037
|
+
parameters: []
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
name: "kick",
|
|
1041
|
+
signature: "kick(playerId: string, reason?: string): void",
|
|
1042
|
+
description: "Kick a player (host only).",
|
|
1043
|
+
parameters: [
|
|
1044
|
+
{ name: "playerId", type: "string", description: "Player to kick" },
|
|
1045
|
+
{ name: "reason", type: "string", description: "Kick reason", optional: true }
|
|
1046
|
+
]
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
name: "startGame",
|
|
1050
|
+
signature: "startGame(): void",
|
|
1051
|
+
description: "Start the game (host only).",
|
|
1052
|
+
parameters: []
|
|
1053
|
+
}
|
|
1054
|
+
],
|
|
1055
|
+
events: [
|
|
1056
|
+
{
|
|
1057
|
+
name: "onPlayerJoined",
|
|
1058
|
+
description: "Fired when player joins.",
|
|
1059
|
+
payload: "{ player: PlayerInfo }"
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
name: "onPlayerLeft",
|
|
1063
|
+
description: "Fired when player leaves.",
|
|
1064
|
+
payload: "{ player: PlayerInfo, reason: string }"
|
|
1065
|
+
},
|
|
1066
|
+
{ name: "onGameStarted", description: "Fired when game starts." },
|
|
1067
|
+
{
|
|
1068
|
+
name: "onLobbyUpdated",
|
|
1069
|
+
description: "Fired when lobby settings change.",
|
|
1070
|
+
payload: "{ changes: Record<string, any> }"
|
|
1071
|
+
}
|
|
1072
|
+
],
|
|
1073
|
+
example: `@lobby({ maxPlayers: 4, isPublic: true, gameMode: "deathmatch" })
|
|
1074
|
+
world arena_lobby {
|
|
1075
|
+
on_player_joined: {
|
|
1076
|
+
spawn_player: { at: "spawn_point" }
|
|
1077
|
+
}
|
|
1078
|
+
}`,
|
|
1079
|
+
since: "1.2.0"
|
|
1080
|
+
},
|
|
1081
|
+
// ============================================================================
|
|
1082
|
+
// Input Traits
|
|
1083
|
+
// ============================================================================
|
|
1084
|
+
voice_input: {
|
|
1085
|
+
name: "VoiceInputTrait",
|
|
1086
|
+
annotation: "@voice_input",
|
|
1087
|
+
description: "Voice recognition for hands-free interaction. Supports custom commands, continuous listening, and multiple languages.",
|
|
1088
|
+
category: "input",
|
|
1089
|
+
properties: [
|
|
1090
|
+
{ name: "commands", type: "VoiceCommand[]", description: "Recognized voice commands." },
|
|
1091
|
+
{
|
|
1092
|
+
name: "language",
|
|
1093
|
+
type: "string",
|
|
1094
|
+
description: "Recognition language.",
|
|
1095
|
+
default: '"en-US"'
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
name: "continuous",
|
|
1099
|
+
type: "boolean",
|
|
1100
|
+
description: "Listen continuously.",
|
|
1101
|
+
default: "false"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
name: "interimResults",
|
|
1105
|
+
type: "boolean",
|
|
1106
|
+
description: "Report partial results.",
|
|
1107
|
+
default: "false"
|
|
1108
|
+
},
|
|
1109
|
+
{
|
|
1110
|
+
name: "confidenceThreshold",
|
|
1111
|
+
type: "number",
|
|
1112
|
+
description: "Minimum confidence (0-1).",
|
|
1113
|
+
default: "0.7"
|
|
1114
|
+
}
|
|
1115
|
+
],
|
|
1116
|
+
methods: [
|
|
1117
|
+
{
|
|
1118
|
+
name: "start",
|
|
1119
|
+
signature: "start(): void",
|
|
1120
|
+
description: "Start listening.",
|
|
1121
|
+
parameters: []
|
|
1122
|
+
},
|
|
1123
|
+
{ name: "stop", signature: "stop(): void", description: "Stop listening.", parameters: [] },
|
|
1124
|
+
{
|
|
1125
|
+
name: "addCommand",
|
|
1126
|
+
signature: "addCommand(phrase: string, handler: Function): void",
|
|
1127
|
+
description: "Add a voice command.",
|
|
1128
|
+
parameters: [
|
|
1129
|
+
{ name: "phrase", type: "string", description: "Trigger phrase" },
|
|
1130
|
+
{ name: "handler", type: "Function", description: "Handler function" }
|
|
1131
|
+
]
|
|
1132
|
+
}
|
|
1133
|
+
],
|
|
1134
|
+
events: [
|
|
1135
|
+
{
|
|
1136
|
+
name: "onCommand",
|
|
1137
|
+
description: "Fired when command recognized.",
|
|
1138
|
+
payload: "{ command: string, confidence: number }"
|
|
1139
|
+
},
|
|
1140
|
+
{ name: "onSpeechStart", description: "Fired when speech detected." },
|
|
1141
|
+
{ name: "onSpeechEnd", description: "Fired when speech ends." },
|
|
1142
|
+
{ name: "onError", description: "Fired on recognition error.", payload: "{ error: string }" }
|
|
1143
|
+
],
|
|
1144
|
+
example: `@voice_input({ language: "en-US", continuous: true })
|
|
1145
|
+
orb voice_controller {
|
|
1146
|
+
commands: [
|
|
1147
|
+
"jump": { action: player.jump },
|
|
1148
|
+
"attack": { action: player.attack },
|
|
1149
|
+
"open inventory": { action: ui.openInventory }
|
|
1150
|
+
]
|
|
1151
|
+
}`,
|
|
1152
|
+
since: "1.3.0"
|
|
1153
|
+
},
|
|
1154
|
+
// ============================================================================
|
|
1155
|
+
// AI Traits
|
|
1156
|
+
// ============================================================================
|
|
1157
|
+
ai_driver: {
|
|
1158
|
+
name: "AIDriverTrait",
|
|
1159
|
+
annotation: "@ai_driver",
|
|
1160
|
+
description: "AI-powered NPC behavior using LLM integration. Create intelligent, conversational characters.",
|
|
1161
|
+
category: "ai",
|
|
1162
|
+
properties: [
|
|
1163
|
+
{ name: "model", type: "string", description: "LLM model to use.", default: '"gpt-4"' },
|
|
1164
|
+
{ name: "systemPrompt", type: "string", description: "System prompt defining character." },
|
|
1165
|
+
{
|
|
1166
|
+
name: "memory",
|
|
1167
|
+
type: "boolean",
|
|
1168
|
+
description: "Remember conversation history.",
|
|
1169
|
+
default: "true"
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
name: "memoryLimit",
|
|
1173
|
+
type: "number",
|
|
1174
|
+
description: "Max conversation turns to remember.",
|
|
1175
|
+
default: "20"
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
name: "temperature",
|
|
1179
|
+
type: "number",
|
|
1180
|
+
description: "Response creativity (0-1).",
|
|
1181
|
+
default: "0.7"
|
|
1182
|
+
},
|
|
1183
|
+
{ name: "maxTokens", type: "number", description: "Max response length.", default: "150" }
|
|
1184
|
+
],
|
|
1185
|
+
methods: [
|
|
1186
|
+
{
|
|
1187
|
+
name: "chat",
|
|
1188
|
+
signature: "chat(message: string): Promise<string>",
|
|
1189
|
+
description: "Send message and get response.",
|
|
1190
|
+
parameters: [{ name: "message", type: "string", description: "User message" }],
|
|
1191
|
+
returns: "Promise<string>"
|
|
1192
|
+
},
|
|
1193
|
+
{
|
|
1194
|
+
name: "setPersonality",
|
|
1195
|
+
signature: "setPersonality(prompt: string): void",
|
|
1196
|
+
description: "Update system prompt.",
|
|
1197
|
+
parameters: [{ name: "prompt", type: "string", description: "New system prompt" }]
|
|
1198
|
+
},
|
|
1199
|
+
{
|
|
1200
|
+
name: "clearMemory",
|
|
1201
|
+
signature: "clearMemory(): void",
|
|
1202
|
+
description: "Clear conversation history.",
|
|
1203
|
+
parameters: []
|
|
1204
|
+
},
|
|
1205
|
+
{
|
|
1206
|
+
name: "getEmotion",
|
|
1207
|
+
signature: "getEmotion(): string",
|
|
1208
|
+
description: "Get current emotional state.",
|
|
1209
|
+
parameters: [],
|
|
1210
|
+
returns: "string"
|
|
1211
|
+
}
|
|
1212
|
+
],
|
|
1213
|
+
events: [
|
|
1214
|
+
{
|
|
1215
|
+
name: "onResponse",
|
|
1216
|
+
description: "Fired when AI responds.",
|
|
1217
|
+
payload: "{ response: string, emotion: string }"
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
name: "onEmotionChange",
|
|
1221
|
+
description: "Fired when emotion changes.",
|
|
1222
|
+
payload: "{ from: string, to: string }"
|
|
1223
|
+
}
|
|
1224
|
+
],
|
|
1225
|
+
example: `@ai_driver({
|
|
1226
|
+
model: "gpt-4",
|
|
1227
|
+
systemPrompt: "You are a wise old wizard named Gandalf. Speak in riddles and offer cryptic advice.",
|
|
1228
|
+
temperature: 0.8
|
|
1229
|
+
})
|
|
1230
|
+
orb wizard_npc {
|
|
1231
|
+
traits: ["talkable"]
|
|
1232
|
+
on_player_approach: {
|
|
1233
|
+
say: "Ah, a traveler! What wisdom do you seek?"
|
|
1234
|
+
}
|
|
1235
|
+
}`,
|
|
1236
|
+
since: "2.0.0"
|
|
1237
|
+
},
|
|
1238
|
+
dialog: {
|
|
1239
|
+
name: "DialogTrait",
|
|
1240
|
+
annotation: "@dialog",
|
|
1241
|
+
description: "Dialog tree system for structured NPC conversations. Supports branching paths, conditions, and effects.",
|
|
1242
|
+
category: "ai",
|
|
1243
|
+
properties: [
|
|
1244
|
+
{ name: "tree", type: "DialogNode[]", description: "Dialog tree structure." },
|
|
1245
|
+
{ name: "startNode", type: "string", description: "Initial dialog node ID." },
|
|
1246
|
+
{
|
|
1247
|
+
name: "autoAdvance",
|
|
1248
|
+
type: "boolean",
|
|
1249
|
+
description: "Auto-advance on single option.",
|
|
1250
|
+
default: "false"
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
name: "typewriterSpeed",
|
|
1254
|
+
type: "number",
|
|
1255
|
+
description: "Text reveal speed (chars/sec).",
|
|
1256
|
+
default: "30"
|
|
1257
|
+
}
|
|
1258
|
+
],
|
|
1259
|
+
methods: [
|
|
1260
|
+
{
|
|
1261
|
+
name: "start",
|
|
1262
|
+
signature: "start(nodeId?: string): void",
|
|
1263
|
+
description: "Start dialog.",
|
|
1264
|
+
parameters: [
|
|
1265
|
+
{ name: "nodeId", type: "string", description: "Starting node", optional: true }
|
|
1266
|
+
]
|
|
1267
|
+
},
|
|
1268
|
+
{
|
|
1269
|
+
name: "choose",
|
|
1270
|
+
signature: "choose(optionIndex: number): void",
|
|
1271
|
+
description: "Select dialog option.",
|
|
1272
|
+
parameters: [{ name: "optionIndex", type: "number", description: "Option index" }]
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
name: "skip",
|
|
1276
|
+
signature: "skip(): void",
|
|
1277
|
+
description: "Skip current text animation.",
|
|
1278
|
+
parameters: []
|
|
1279
|
+
},
|
|
1280
|
+
{ name: "end", signature: "end(): void", description: "End dialog tree.", parameters: [] }
|
|
1281
|
+
],
|
|
1282
|
+
events: [
|
|
1283
|
+
{
|
|
1284
|
+
name: "onNodeEnter",
|
|
1285
|
+
description: "Fired when entering a node.",
|
|
1286
|
+
payload: "{ nodeId: string, text: string }"
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
name: "onDialogEnd",
|
|
1290
|
+
description: "Fired when dialog ends.",
|
|
1291
|
+
payload: "{ endNode: string }"
|
|
1292
|
+
},
|
|
1293
|
+
{
|
|
1294
|
+
name: "onEffectTriggered",
|
|
1295
|
+
description: "Fired when node effect runs.",
|
|
1296
|
+
payload: "{ effect: string }"
|
|
1297
|
+
}
|
|
1298
|
+
],
|
|
1299
|
+
example: `@dialog({ startNode: "greeting" })
|
|
1300
|
+
orb shopkeeper {
|
|
1301
|
+
tree: [
|
|
1302
|
+
{ id: "greeting", text: "Welcome! What can I help you with?", options: [
|
|
1303
|
+
{ text: "Show me your wares", next: "shop" },
|
|
1304
|
+
{ text: "Tell me about the town", next: "lore" },
|
|
1305
|
+
{ text: "Goodbye", next: "farewell" }
|
|
1306
|
+
]},
|
|
1307
|
+
{ id: "farewell", text: "Safe travels!", end: true }
|
|
1308
|
+
]
|
|
1309
|
+
}`,
|
|
1310
|
+
since: "1.4.0"
|
|
1311
|
+
},
|
|
1312
|
+
character: {
|
|
1313
|
+
name: "CharacterTrait",
|
|
1314
|
+
annotation: "@character",
|
|
1315
|
+
description: "Character controller for player or NPC movement. Handles walking, jumping, and ground detection.",
|
|
1316
|
+
category: "utility",
|
|
1317
|
+
properties: [
|
|
1318
|
+
{ name: "moveSpeed", type: "number", description: "Movement speed.", default: "5.0" },
|
|
1319
|
+
{ name: "runSpeed", type: "number", description: "Running speed.", default: "10.0" },
|
|
1320
|
+
{ name: "jumpForce", type: "number", description: "Jump force.", default: "5.0" },
|
|
1321
|
+
{ name: "gravity", type: "number", description: "Custom gravity.", default: "-20" },
|
|
1322
|
+
{
|
|
1323
|
+
name: "groundLayer",
|
|
1324
|
+
type: "string",
|
|
1325
|
+
description: "Ground collision layer.",
|
|
1326
|
+
default: '"ground"'
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
name: "slopeLimit",
|
|
1330
|
+
type: "number",
|
|
1331
|
+
description: "Max walkable slope (degrees).",
|
|
1332
|
+
default: "45"
|
|
1333
|
+
},
|
|
1334
|
+
{ name: "stepOffset", type: "number", description: "Max step height.", default: "0.3" }
|
|
1335
|
+
],
|
|
1336
|
+
methods: [
|
|
1337
|
+
{
|
|
1338
|
+
name: "move",
|
|
1339
|
+
signature: "move(direction: Vec3): void",
|
|
1340
|
+
description: "Move in direction.",
|
|
1341
|
+
parameters: [{ name: "direction", type: "Vec3", description: "Movement direction" }]
|
|
1342
|
+
},
|
|
1343
|
+
{
|
|
1344
|
+
name: "jump",
|
|
1345
|
+
signature: "jump(): void",
|
|
1346
|
+
description: "Make character jump.",
|
|
1347
|
+
parameters: []
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
name: "teleport",
|
|
1351
|
+
signature: "teleport(position: Vec3): void",
|
|
1352
|
+
description: "Teleport to position.",
|
|
1353
|
+
parameters: [{ name: "position", type: "Vec3", description: "Target position" }]
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
name: "isGrounded",
|
|
1357
|
+
signature: "isGrounded(): boolean",
|
|
1358
|
+
description: "Check if on ground.",
|
|
1359
|
+
parameters: [],
|
|
1360
|
+
returns: "boolean"
|
|
1361
|
+
}
|
|
1362
|
+
],
|
|
1363
|
+
events: [
|
|
1364
|
+
{ name: "onLand", description: "Fired when landing.", payload: "{ velocity: number }" },
|
|
1365
|
+
{ name: "onJump", description: "Fired when jumping." }
|
|
1366
|
+
],
|
|
1367
|
+
example: `@character({ moveSpeed: 6.0, jumpForce: 8.0 })
|
|
1368
|
+
@rigidbody({ type: "kinematic" })
|
|
1369
|
+
orb player {
|
|
1370
|
+
on_input: {
|
|
1371
|
+
move: input.direction * this.moveSpeed
|
|
1372
|
+
}
|
|
1373
|
+
on_jump_pressed: {
|
|
1374
|
+
if (this.isGrounded()) { this.jump() }
|
|
1375
|
+
}
|
|
1376
|
+
}`,
|
|
1377
|
+
since: "1.0.0"
|
|
1378
|
+
},
|
|
1379
|
+
animation: {
|
|
1380
|
+
name: "AnimationTrait",
|
|
1381
|
+
annotation: "@animation",
|
|
1382
|
+
description: "Simple keyframe animation for objects. Supports looping, easing, and property animation.",
|
|
1383
|
+
category: "animation",
|
|
1384
|
+
properties: [
|
|
1385
|
+
{
|
|
1386
|
+
name: "autoplay",
|
|
1387
|
+
type: "boolean",
|
|
1388
|
+
description: "Start animation automatically.",
|
|
1389
|
+
default: "false"
|
|
1390
|
+
},
|
|
1391
|
+
{ name: "loop", type: "boolean", description: "Loop animation.", default: "false" },
|
|
1392
|
+
{ name: "duration", type: "number", description: "Animation duration in seconds." },
|
|
1393
|
+
{
|
|
1394
|
+
name: "easing",
|
|
1395
|
+
type: '"linear" | "easeIn" | "easeOut" | "easeInOut"',
|
|
1396
|
+
description: "Easing function.",
|
|
1397
|
+
default: '"linear"'
|
|
1398
|
+
},
|
|
1399
|
+
{ name: "keyframes", type: "Keyframe[]", description: "Animation keyframes." }
|
|
1400
|
+
],
|
|
1401
|
+
methods: [
|
|
1402
|
+
{ name: "play", signature: "play(): void", description: "Start animation.", parameters: [] },
|
|
1403
|
+
{
|
|
1404
|
+
name: "pause",
|
|
1405
|
+
signature: "pause(): void",
|
|
1406
|
+
description: "Pause animation.",
|
|
1407
|
+
parameters: []
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
name: "stop",
|
|
1411
|
+
signature: "stop(): void",
|
|
1412
|
+
description: "Stop and reset animation.",
|
|
1413
|
+
parameters: []
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
name: "seek",
|
|
1417
|
+
signature: "seek(time: number): void",
|
|
1418
|
+
description: "Jump to time.",
|
|
1419
|
+
parameters: [{ name: "time", type: "number", description: "Time in seconds" }]
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
name: "reverse",
|
|
1423
|
+
signature: "reverse(): void",
|
|
1424
|
+
description: "Reverse playback direction.",
|
|
1425
|
+
parameters: []
|
|
1426
|
+
}
|
|
1427
|
+
],
|
|
1428
|
+
events: [
|
|
1429
|
+
{ name: "onComplete", description: "Fired when animation completes." },
|
|
1430
|
+
{ name: "onLoop", description: "Fired on each loop.", payload: "{ count: number }" }
|
|
1431
|
+
],
|
|
1432
|
+
example: `@animation({
|
|
1433
|
+
duration: 2.0,
|
|
1434
|
+
loop: true,
|
|
1435
|
+
easing: "easeInOut",
|
|
1436
|
+
autoplay: true
|
|
1437
|
+
})
|
|
1438
|
+
orb rotating_coin {
|
|
1439
|
+
keyframes: [
|
|
1440
|
+
{ time: 0, rotation: [0, 0, 0] },
|
|
1441
|
+
{ time: 1, rotation: [0, 180, 0] },
|
|
1442
|
+
{ time: 2, rotation: [0, 360, 0] }
|
|
1443
|
+
]
|
|
1444
|
+
}`,
|
|
1445
|
+
since: "1.0.0"
|
|
1446
|
+
},
|
|
1447
|
+
voice_output: {
|
|
1448
|
+
name: "VoiceOutputTrait",
|
|
1449
|
+
annotation: "@voice_output",
|
|
1450
|
+
description: "Text-to-speech for NPC dialog and narration. Supports multiple voices and real-time speech.",
|
|
1451
|
+
category: "input",
|
|
1452
|
+
properties: [
|
|
1453
|
+
{ name: "voice", type: "string", description: "Voice identifier." },
|
|
1454
|
+
{ name: "pitch", type: "number", description: "Voice pitch (0.5-2.0).", default: "1.0" },
|
|
1455
|
+
{ name: "rate", type: "number", description: "Speech rate (0.5-2.0).", default: "1.0" },
|
|
1456
|
+
{ name: "volume", type: "number", description: "Volume (0-1).", default: "1.0" }
|
|
1457
|
+
],
|
|
1458
|
+
methods: [
|
|
1459
|
+
{
|
|
1460
|
+
name: "speak",
|
|
1461
|
+
signature: "speak(text: string): Promise<void>",
|
|
1462
|
+
description: "Speak text.",
|
|
1463
|
+
parameters: [{ name: "text", type: "string", description: "Text to speak" }]
|
|
1464
|
+
},
|
|
1465
|
+
{ name: "stop", signature: "stop(): void", description: "Stop speaking.", parameters: [] },
|
|
1466
|
+
{ name: "pause", signature: "pause(): void", description: "Pause speech.", parameters: [] },
|
|
1467
|
+
{
|
|
1468
|
+
name: "resume",
|
|
1469
|
+
signature: "resume(): void",
|
|
1470
|
+
description: "Resume speech.",
|
|
1471
|
+
parameters: []
|
|
1472
|
+
}
|
|
1473
|
+
],
|
|
1474
|
+
events: [
|
|
1475
|
+
{ name: "onSpeechStart", description: "Fired when speech starts." },
|
|
1476
|
+
{ name: "onSpeechEnd", description: "Fired when speech ends." },
|
|
1477
|
+
{
|
|
1478
|
+
name: "onWordBoundary",
|
|
1479
|
+
description: "Fired at each word.",
|
|
1480
|
+
payload: "{ word: string, index: number }"
|
|
1481
|
+
}
|
|
1482
|
+
],
|
|
1483
|
+
example: `@voice_output({ voice: "en-US-GuyNeural", pitch: 1.2, rate: 0.9 })
|
|
1484
|
+
orb narrator {
|
|
1485
|
+
on_scene_start: {
|
|
1486
|
+
this.speak("Welcome to the enchanted forest...")
|
|
1487
|
+
}
|
|
1488
|
+
}`,
|
|
1489
|
+
since: "1.3.0"
|
|
1490
|
+
},
|
|
1491
|
+
// ============================================================================
|
|
1492
|
+
// Hololand Traits
|
|
1493
|
+
// ============================================================================
|
|
1494
|
+
manifest: {
|
|
1495
|
+
name: "ManifestTrait",
|
|
1496
|
+
annotation: "@manifest",
|
|
1497
|
+
description: "Defines an asset manifest for organizing game assets with metadata, dependencies, and platform-specific variants.",
|
|
1498
|
+
category: "hololand",
|
|
1499
|
+
properties: [
|
|
1500
|
+
{ name: "id", type: "string", description: "Unique manifest identifier.", required: true },
|
|
1501
|
+
{
|
|
1502
|
+
name: "assets",
|
|
1503
|
+
type: "AssetEntry[]",
|
|
1504
|
+
description: "Array of asset definitions with id, path, type, and tags."
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
name: "dependencies",
|
|
1508
|
+
type: "Dependency[]",
|
|
1509
|
+
description: "Asset dependency relationships for load ordering."
|
|
1510
|
+
},
|
|
1511
|
+
{
|
|
1512
|
+
name: "variants",
|
|
1513
|
+
type: "Record<string, Record<string, string>>",
|
|
1514
|
+
description: "Platform-specific asset path overrides."
|
|
1515
|
+
}
|
|
1516
|
+
],
|
|
1517
|
+
methods: [
|
|
1518
|
+
{
|
|
1519
|
+
name: "preload_all",
|
|
1520
|
+
signature: "preload_all(id: string, callback?: (progress: number) => void): Promise<void>",
|
|
1521
|
+
description: "Preload all assets with progress callback.",
|
|
1522
|
+
parameters: [
|
|
1523
|
+
{ name: "id", type: "string", description: "Manifest ID" },
|
|
1524
|
+
{
|
|
1525
|
+
name: "callback",
|
|
1526
|
+
type: "function",
|
|
1527
|
+
description: "Progress callback (0-1)",
|
|
1528
|
+
optional: true
|
|
1529
|
+
}
|
|
1530
|
+
]
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
name: "get_assets",
|
|
1534
|
+
signature: "get_assets(id: string): Asset[]",
|
|
1535
|
+
description: "Get all assets from a manifest.",
|
|
1536
|
+
parameters: [{ name: "id", type: "string", description: "Manifest ID" }],
|
|
1537
|
+
returns: "Asset[]"
|
|
1538
|
+
}
|
|
1539
|
+
],
|
|
1540
|
+
events: [
|
|
1541
|
+
{
|
|
1542
|
+
name: "onAssetLoaded",
|
|
1543
|
+
description: "Fired when an asset finishes loading.",
|
|
1544
|
+
payload: "{ id: string, asset: Asset }"
|
|
1545
|
+
},
|
|
1546
|
+
{
|
|
1547
|
+
name: "onLoadError",
|
|
1548
|
+
description: "Fired when an asset fails to load.",
|
|
1549
|
+
payload: "{ id: string, error: Error }"
|
|
1550
|
+
}
|
|
1551
|
+
],
|
|
1552
|
+
example: `@manifest("game-assets") {
|
|
1553
|
+
assets: [
|
|
1554
|
+
{ id: "hero", path: "models/hero.glb", type: "model", tags: ["character"] },
|
|
1555
|
+
{ id: "hero-tex", path: "textures/hero.png", type: "texture", tags: ["character"] }
|
|
1556
|
+
]
|
|
1557
|
+
dependencies: [
|
|
1558
|
+
{ parent: "hero", children: ["hero-tex"] }
|
|
1559
|
+
]
|
|
1560
|
+
}`,
|
|
1561
|
+
since: "2.0.0"
|
|
1562
|
+
},
|
|
1563
|
+
world_metadata: {
|
|
1564
|
+
name: "WorldMetadataTrait",
|
|
1565
|
+
annotation: "@world_metadata",
|
|
1566
|
+
description: "Defines metadata for a Hololand world including identification, platforms, and discovery tags.",
|
|
1567
|
+
category: "hololand",
|
|
1568
|
+
properties: [
|
|
1569
|
+
{ name: "id", type: "string", description: "Unique world identifier.", required: true },
|
|
1570
|
+
{ name: "name", type: "string", description: "World name.", required: true },
|
|
1571
|
+
{ name: "display_name", type: "string", description: "Display name for UI." },
|
|
1572
|
+
{ name: "description", type: "string", description: "World description." },
|
|
1573
|
+
{ name: "version", type: "string", description: "Semantic version.", default: '"1.0.0"' },
|
|
1574
|
+
{ name: "author", type: "string", description: "Creator name." },
|
|
1575
|
+
{ name: "tags", type: "string[]", description: "Discovery tags." },
|
|
1576
|
+
{
|
|
1577
|
+
name: "platforms",
|
|
1578
|
+
type: '("web" | "quest" | "visionos" | "steamvr" | "desktop")[]',
|
|
1579
|
+
description: "Supported platforms.",
|
|
1580
|
+
default: '["web"]'
|
|
1581
|
+
},
|
|
1582
|
+
{
|
|
1583
|
+
name: "age_rating",
|
|
1584
|
+
type: '"everyone" | "teen" | "mature"',
|
|
1585
|
+
description: "Content age rating.",
|
|
1586
|
+
default: '"everyone"'
|
|
1587
|
+
},
|
|
1588
|
+
{
|
|
1589
|
+
name: "category",
|
|
1590
|
+
type: "string",
|
|
1591
|
+
description: "World category (game, social, art, etc.)."
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
name: "max_users",
|
|
1595
|
+
type: "number",
|
|
1596
|
+
description: "Maximum concurrent users.",
|
|
1597
|
+
default: "50"
|
|
1598
|
+
}
|
|
1599
|
+
],
|
|
1600
|
+
methods: [],
|
|
1601
|
+
events: [],
|
|
1602
|
+
example: `@world_metadata {
|
|
1603
|
+
id: "my-world"
|
|
1604
|
+
name: "My VR World"
|
|
1605
|
+
platforms: ["web", "quest", "steamvr"]
|
|
1606
|
+
category: "game"
|
|
1607
|
+
max_users: 16
|
|
1608
|
+
}`,
|
|
1609
|
+
since: "2.0.0"
|
|
1610
|
+
},
|
|
1611
|
+
world_config: {
|
|
1612
|
+
name: "WorldConfigTrait",
|
|
1613
|
+
annotation: "@world_config",
|
|
1614
|
+
description: "Configures Hololand world settings including physics, rendering, networking, and audio.",
|
|
1615
|
+
category: "hololand",
|
|
1616
|
+
properties: [
|
|
1617
|
+
{
|
|
1618
|
+
name: "physics",
|
|
1619
|
+
type: "PhysicsConfig",
|
|
1620
|
+
description: "Physics engine settings (engine, gravity, tick_rate)."
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
name: "rendering",
|
|
1624
|
+
type: "RenderingConfig",
|
|
1625
|
+
description: "Rendering settings (target_fps, shadows, quality)."
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
name: "networking",
|
|
1629
|
+
type: "NetworkingConfig",
|
|
1630
|
+
description: "Network settings (tick_rate, protocol, compression)."
|
|
1631
|
+
},
|
|
1632
|
+
{
|
|
1633
|
+
name: "audio",
|
|
1634
|
+
type: "AudioConfig",
|
|
1635
|
+
description: "Audio settings (spatial_audio, reverb, max_sources)."
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
name: "performance",
|
|
1639
|
+
type: "PerformanceConfig",
|
|
1640
|
+
description: "Performance budgets (max_draw_calls, max_triangles)."
|
|
1641
|
+
},
|
|
1642
|
+
{
|
|
1643
|
+
name: "accessibility",
|
|
1644
|
+
type: "AccessibilityConfig",
|
|
1645
|
+
description: "Accessibility options (subtitles, screen_reader)."
|
|
1646
|
+
}
|
|
1647
|
+
],
|
|
1648
|
+
methods: [],
|
|
1649
|
+
events: [],
|
|
1650
|
+
example: `@world_config {
|
|
1651
|
+
physics: { engine: "rapier", gravity: [0, -9.81, 0] }
|
|
1652
|
+
rendering: { target_fps: 72, shadows: true, shadow_quality: "high" }
|
|
1653
|
+
networking: { tick_rate: 20, protocol: "websocket" }
|
|
1654
|
+
audio: { spatial_audio: true }
|
|
1655
|
+
}`,
|
|
1656
|
+
since: "2.0.0"
|
|
1657
|
+
},
|
|
1658
|
+
zones: {
|
|
1659
|
+
name: "ZonesTrait",
|
|
1660
|
+
annotation: "@zones",
|
|
1661
|
+
description: "Defines spatial zones within a world with custom behaviors, triggers, and environment overrides.",
|
|
1662
|
+
category: "hololand",
|
|
1663
|
+
properties: [
|
|
1664
|
+
{
|
|
1665
|
+
name: "zone",
|
|
1666
|
+
type: "ZoneDefinition",
|
|
1667
|
+
description: "Individual zone definition with id, name, bounds, triggers."
|
|
1668
|
+
}
|
|
1669
|
+
],
|
|
1670
|
+
methods: [],
|
|
1671
|
+
events: [
|
|
1672
|
+
{
|
|
1673
|
+
name: "onZoneEnter",
|
|
1674
|
+
description: "Fired when player enters a zone.",
|
|
1675
|
+
payload: "{ zone_id: string, player: Entity }"
|
|
1676
|
+
},
|
|
1677
|
+
{
|
|
1678
|
+
name: "onZoneExit",
|
|
1679
|
+
description: "Fired when player exits a zone.",
|
|
1680
|
+
payload: "{ zone_id: string, player: Entity }"
|
|
1681
|
+
}
|
|
1682
|
+
],
|
|
1683
|
+
example: `@zones {
|
|
1684
|
+
zone "safe-zone" {
|
|
1685
|
+
name: "Spawn Safe Zone"
|
|
1686
|
+
bounds: { type: "sphere", center: [0, 0, 0], radius: 15 }
|
|
1687
|
+
priority: 10
|
|
1688
|
+
triggers: [
|
|
1689
|
+
{ type: "enter", action: "disable_pvp", filter: "player" }
|
|
1690
|
+
]
|
|
1691
|
+
}
|
|
1692
|
+
}`,
|
|
1693
|
+
since: "2.0.0"
|
|
1694
|
+
},
|
|
1695
|
+
spawn_points: {
|
|
1696
|
+
name: "SpawnPointsTrait",
|
|
1697
|
+
annotation: "@spawn_points",
|
|
1698
|
+
description: "Defines player spawn locations with team assignments, capacity, and conditions.",
|
|
1699
|
+
category: "hololand",
|
|
1700
|
+
properties: [
|
|
1701
|
+
{
|
|
1702
|
+
name: "spawn",
|
|
1703
|
+
type: "SpawnDefinition",
|
|
1704
|
+
description: "Individual spawn point with id, position, rotation, type, capacity."
|
|
1705
|
+
}
|
|
1706
|
+
],
|
|
1707
|
+
methods: [
|
|
1708
|
+
{
|
|
1709
|
+
name: "getAvailableSpawn",
|
|
1710
|
+
signature: "getAvailableSpawn(tags?: string[]): SpawnPoint",
|
|
1711
|
+
description: "Get an available spawn point by tags.",
|
|
1712
|
+
parameters: [
|
|
1713
|
+
{ name: "tags", type: "string[]", description: "Filter tags", optional: true }
|
|
1714
|
+
],
|
|
1715
|
+
returns: "SpawnPoint"
|
|
1716
|
+
}
|
|
1717
|
+
],
|
|
1718
|
+
events: [],
|
|
1719
|
+
example: `@spawn_points {
|
|
1720
|
+
spawn "team-a-spawn" {
|
|
1721
|
+
name: "Team A Spawn"
|
|
1722
|
+
position: [-40, 1, 0]
|
|
1723
|
+
rotation: [0, 90, 0]
|
|
1724
|
+
type: "default"
|
|
1725
|
+
capacity: 4
|
|
1726
|
+
tags: ["team-a"]
|
|
1727
|
+
}
|
|
1728
|
+
}`,
|
|
1729
|
+
since: "2.0.0"
|
|
1730
|
+
},
|
|
1731
|
+
semantic: {
|
|
1732
|
+
name: "SemanticTrait",
|
|
1733
|
+
annotation: "@semantic",
|
|
1734
|
+
description: "Adds semantic annotations to entities for AI understanding, data binding, and capability discovery.",
|
|
1735
|
+
category: "hololand",
|
|
1736
|
+
properties: [
|
|
1737
|
+
{
|
|
1738
|
+
name: "category",
|
|
1739
|
+
type: "string",
|
|
1740
|
+
description: "Semantic category (character, item, environment).",
|
|
1741
|
+
required: true
|
|
1742
|
+
},
|
|
1743
|
+
{ name: "type", type: "string", description: "Entity type within category.", required: true },
|
|
1744
|
+
{
|
|
1745
|
+
name: "properties",
|
|
1746
|
+
type: "Record<string, PropertyAnnotation>",
|
|
1747
|
+
description: "Annotated properties with metadata."
|
|
1748
|
+
},
|
|
1749
|
+
{ name: "capabilities", type: "string[]", description: "List of entity capabilities." }
|
|
1750
|
+
],
|
|
1751
|
+
methods: [],
|
|
1752
|
+
events: [],
|
|
1753
|
+
example: `@semantic("player-character") {
|
|
1754
|
+
category: "character"
|
|
1755
|
+
type: "player"
|
|
1756
|
+
properties: {
|
|
1757
|
+
position: @annotate("position", { networked: true }),
|
|
1758
|
+
health: @annotate("health", { min: 0, max: 100 })
|
|
1759
|
+
}
|
|
1760
|
+
capabilities: ["movement", "jumping", "combat"]
|
|
1761
|
+
}`,
|
|
1762
|
+
since: "2.0.0"
|
|
1763
|
+
},
|
|
1764
|
+
bindings: {
|
|
1765
|
+
name: "BindingsTrait",
|
|
1766
|
+
annotation: "@bindings",
|
|
1767
|
+
description: "Creates reactive data bindings between state and UI elements.",
|
|
1768
|
+
category: "hololand",
|
|
1769
|
+
properties: [
|
|
1770
|
+
{
|
|
1771
|
+
name: "bind",
|
|
1772
|
+
type: "BindingExpression",
|
|
1773
|
+
description: "Binding expression: bind(source) -> target"
|
|
1774
|
+
}
|
|
1775
|
+
],
|
|
1776
|
+
methods: [],
|
|
1777
|
+
events: [
|
|
1778
|
+
{
|
|
1779
|
+
name: "onBindingUpdate",
|
|
1780
|
+
description: "Fired when a binding updates.",
|
|
1781
|
+
payload: "{ source: string, target: string, value: any }"
|
|
1782
|
+
}
|
|
1783
|
+
],
|
|
1784
|
+
example: `@bindings {
|
|
1785
|
+
bind(@state.player_health / @state.max_health) -> HealthBar.fill_amount
|
|
1786
|
+
bind(@state.player_health > 0) -> HealthBar.visible
|
|
1787
|
+
bind(health_to_color(@state.health)) -> HealthBar.color
|
|
1788
|
+
}`,
|
|
1789
|
+
since: "2.0.0"
|
|
1790
|
+
},
|
|
1791
|
+
annotate: {
|
|
1792
|
+
name: "AnnotateTrait",
|
|
1793
|
+
annotation: "@annotate",
|
|
1794
|
+
description: "Creates property-level annotations with metadata for networking, validation, and binding.",
|
|
1795
|
+
category: "hololand",
|
|
1796
|
+
properties: [
|
|
1797
|
+
{
|
|
1798
|
+
name: "type",
|
|
1799
|
+
type: "string",
|
|
1800
|
+
description: "Property type (position, rotation, health, etc.).",
|
|
1801
|
+
required: true
|
|
1802
|
+
},
|
|
1803
|
+
{
|
|
1804
|
+
name: "networked",
|
|
1805
|
+
type: "boolean",
|
|
1806
|
+
description: "Whether property syncs across network.",
|
|
1807
|
+
default: "false"
|
|
1808
|
+
},
|
|
1809
|
+
{
|
|
1810
|
+
name: "interpolated",
|
|
1811
|
+
type: "boolean",
|
|
1812
|
+
description: "Whether to interpolate network updates.",
|
|
1813
|
+
default: "false"
|
|
1814
|
+
},
|
|
1815
|
+
{ name: "min", type: "number", description: "Minimum value constraint." },
|
|
1816
|
+
{ name: "max", type: "number", description: "Maximum value constraint." },
|
|
1817
|
+
{
|
|
1818
|
+
name: "ui_binding",
|
|
1819
|
+
type: "string",
|
|
1820
|
+
description: "Target UI element for automatic binding."
|
|
1821
|
+
}
|
|
1822
|
+
],
|
|
1823
|
+
methods: [],
|
|
1824
|
+
events: [],
|
|
1825
|
+
example: `health: @annotate("health", {
|
|
1826
|
+
min: 0,
|
|
1827
|
+
max: @state.player_max_health,
|
|
1828
|
+
networked: true,
|
|
1829
|
+
ui_binding: "health_bar"
|
|
1830
|
+
})`,
|
|
1831
|
+
since: "2.0.0"
|
|
1832
|
+
},
|
|
1833
|
+
semantic_ref: {
|
|
1834
|
+
name: "SemanticRefTrait",
|
|
1835
|
+
annotation: "@semantic_ref",
|
|
1836
|
+
description: "References a semantic annotation defined elsewhere, applying it to an entity.",
|
|
1837
|
+
category: "hololand",
|
|
1838
|
+
properties: [
|
|
1839
|
+
{
|
|
1840
|
+
name: "ref",
|
|
1841
|
+
type: "string",
|
|
1842
|
+
description: "ID of the semantic annotation to reference.",
|
|
1843
|
+
required: true
|
|
1844
|
+
}
|
|
1845
|
+
],
|
|
1846
|
+
methods: [],
|
|
1847
|
+
events: [],
|
|
1848
|
+
example: `object "Player" {
|
|
1849
|
+
@semantic_ref("player-character")
|
|
1850
|
+
position: [0, 0, 0]
|
|
1851
|
+
model: "characters/hero.glb"
|
|
1852
|
+
}`,
|
|
1853
|
+
since: "2.0.0"
|
|
1854
|
+
},
|
|
1855
|
+
artwork_metadata: {
|
|
1856
|
+
name: "ArtworkMetadataTrait",
|
|
1857
|
+
annotation: "@artwork_metadata",
|
|
1858
|
+
description: "Defines metadata for artwork and collectible items in virtual galleries and museums.",
|
|
1859
|
+
category: "hololand",
|
|
1860
|
+
properties: [
|
|
1861
|
+
{ name: "title", type: "string", description: "Artwork title.", required: true },
|
|
1862
|
+
{ name: "artist", type: "string", description: "Artist name.", required: true },
|
|
1863
|
+
{ name: "year", type: "number", description: "Year of creation." },
|
|
1864
|
+
{ name: "description", type: "string", description: "Artwork description." },
|
|
1865
|
+
{ name: "audio_guide_id", type: "string", description: "ID of audio guide content." },
|
|
1866
|
+
{
|
|
1867
|
+
name: "interaction_type",
|
|
1868
|
+
type: '"view" | "inspect" | "interact"',
|
|
1869
|
+
description: "Type of interaction allowed.",
|
|
1870
|
+
default: '"view"'
|
|
1871
|
+
}
|
|
1872
|
+
],
|
|
1873
|
+
methods: [],
|
|
1874
|
+
events: [
|
|
1875
|
+
{
|
|
1876
|
+
name: "onInspect",
|
|
1877
|
+
description: "Fired when user inspects the artwork.",
|
|
1878
|
+
payload: "{ artwork_id: string }"
|
|
1879
|
+
}
|
|
1880
|
+
],
|
|
1881
|
+
example: `@artwork_metadata {
|
|
1882
|
+
title: "The Starry Night"
|
|
1883
|
+
artist: "Vincent van Gogh"
|
|
1884
|
+
year: 1889
|
|
1885
|
+
description: "One of the most recognized paintings in Western art"
|
|
1886
|
+
interaction_type: "inspect"
|
|
1887
|
+
}`,
|
|
1888
|
+
since: "2.0.0"
|
|
1889
|
+
},
|
|
1890
|
+
npc_behavior: {
|
|
1891
|
+
name: "NPCBehaviorTrait",
|
|
1892
|
+
annotation: "@npc_behavior",
|
|
1893
|
+
description: "Defines AI-driven NPC behaviors including patrol paths, interactions, and dialog.",
|
|
1894
|
+
category: "hololand",
|
|
1895
|
+
properties: [
|
|
1896
|
+
{ name: "patrol_points", type: "Vec3[]", description: "Waypoints for patrol behavior." },
|
|
1897
|
+
{
|
|
1898
|
+
name: "interaction_radius",
|
|
1899
|
+
type: "number",
|
|
1900
|
+
description: "Distance at which NPC can interact.",
|
|
1901
|
+
default: "3"
|
|
1902
|
+
},
|
|
1903
|
+
{ name: "greeting", type: "string", description: "Greeting message for players." },
|
|
1904
|
+
{ name: "dialog_tree", type: "DialogNode[]", description: "Conversation dialog tree." },
|
|
1905
|
+
{
|
|
1906
|
+
name: "idle_animation",
|
|
1907
|
+
type: "string",
|
|
1908
|
+
description: "Animation to play when idle.",
|
|
1909
|
+
default: '"idle"'
|
|
1910
|
+
},
|
|
1911
|
+
{ name: "walk_speed", type: "number", description: "Walking speed.", default: "1.5" }
|
|
1912
|
+
],
|
|
1913
|
+
methods: [
|
|
1914
|
+
{
|
|
1915
|
+
name: "startPatrol",
|
|
1916
|
+
signature: "startPatrol(): void",
|
|
1917
|
+
description: "Begin patrol behavior.",
|
|
1918
|
+
parameters: []
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
name: "stopPatrol",
|
|
1922
|
+
signature: "stopPatrol(): void",
|
|
1923
|
+
description: "Stop patrol behavior.",
|
|
1924
|
+
parameters: []
|
|
1925
|
+
},
|
|
1926
|
+
{
|
|
1927
|
+
name: "say",
|
|
1928
|
+
signature: "say(text: string): void",
|
|
1929
|
+
description: "Make NPC speak.",
|
|
1930
|
+
parameters: [{ name: "text", type: "string", description: "Text to say" }]
|
|
1931
|
+
},
|
|
1932
|
+
{
|
|
1933
|
+
name: "moveTo",
|
|
1934
|
+
signature: "moveTo(position: Vec3): Promise<void>",
|
|
1935
|
+
description: "Move NPC to position.",
|
|
1936
|
+
parameters: [{ name: "position", type: "Vec3", description: "Target position" }]
|
|
1937
|
+
}
|
|
1938
|
+
],
|
|
1939
|
+
events: [
|
|
1940
|
+
{
|
|
1941
|
+
name: "onPlayerApproach",
|
|
1942
|
+
description: "Fired when player enters interaction radius.",
|
|
1943
|
+
payload: "{ player: Entity }"
|
|
1944
|
+
},
|
|
1945
|
+
{
|
|
1946
|
+
name: "onDialogStart",
|
|
1947
|
+
description: "Fired when dialog begins.",
|
|
1948
|
+
payload: "{ player: Entity }"
|
|
1949
|
+
},
|
|
1950
|
+
{
|
|
1951
|
+
name: "onDialogEnd",
|
|
1952
|
+
description: "Fired when dialog ends.",
|
|
1953
|
+
payload: "{ player: Entity }"
|
|
1954
|
+
}
|
|
1955
|
+
],
|
|
1956
|
+
example: `@npc_behavior {
|
|
1957
|
+
patrol_points: [[0, 0, -5], [10, 0, 0], [0, 0, 5]]
|
|
1958
|
+
interaction_radius: 3
|
|
1959
|
+
greeting: "Welcome! Would you like a tour?"
|
|
1960
|
+
idle_animation: "idle_look_around"
|
|
1961
|
+
}`,
|
|
1962
|
+
since: "2.0.0"
|
|
1963
|
+
},
|
|
1964
|
+
lod: {
|
|
1965
|
+
name: "LODTrait",
|
|
1966
|
+
annotation: "@lod",
|
|
1967
|
+
description: "Configures level-of-detail settings for automatic quality scaling based on distance.",
|
|
1968
|
+
category: "hololand",
|
|
1969
|
+
properties: [
|
|
1970
|
+
{
|
|
1971
|
+
name: "distances",
|
|
1972
|
+
type: "number[]",
|
|
1973
|
+
description: "Distance thresholds for LOD transitions.",
|
|
1974
|
+
required: true
|
|
1975
|
+
},
|
|
1976
|
+
{ name: "models", type: "string[]", description: "Model paths for each LOD level." },
|
|
1977
|
+
{
|
|
1978
|
+
name: "fade_duration",
|
|
1979
|
+
type: "number",
|
|
1980
|
+
description: "Crossfade duration between LODs.",
|
|
1981
|
+
default: "0.5"
|
|
1982
|
+
}
|
|
1983
|
+
],
|
|
1984
|
+
methods: [
|
|
1985
|
+
{
|
|
1986
|
+
name: "setForcedLOD",
|
|
1987
|
+
signature: "setForcedLOD(level: number): void",
|
|
1988
|
+
description: "Force a specific LOD level.",
|
|
1989
|
+
parameters: [{ name: "level", type: "number", description: "LOD level to force" }]
|
|
1990
|
+
},
|
|
1991
|
+
{
|
|
1992
|
+
name: "clearForcedLOD",
|
|
1993
|
+
signature: "clearForcedLOD(): void",
|
|
1994
|
+
description: "Return to automatic LOD selection.",
|
|
1995
|
+
parameters: []
|
|
1996
|
+
}
|
|
1997
|
+
],
|
|
1998
|
+
events: [
|
|
1999
|
+
{
|
|
2000
|
+
name: "onLODChange",
|
|
2001
|
+
description: "Fired when LOD level changes.",
|
|
2002
|
+
payload: "{ from: number, to: number }"
|
|
2003
|
+
}
|
|
2004
|
+
],
|
|
2005
|
+
example: `@lod {
|
|
2006
|
+
distances: [25, 50, 100, 200]
|
|
2007
|
+
models: [
|
|
2008
|
+
"model_lod0.glb",
|
|
2009
|
+
"model_lod1.glb",
|
|
2010
|
+
"model_lod2.glb",
|
|
2011
|
+
"model_lod3.glb"
|
|
2012
|
+
]
|
|
2013
|
+
}`,
|
|
2014
|
+
since: "2.0.0"
|
|
2015
|
+
},
|
|
2016
|
+
hololand: {
|
|
2017
|
+
name: "HololandTrait",
|
|
2018
|
+
annotation: "@hololand",
|
|
2019
|
+
description: "Provides Hololand runtime integration for connections, events, and player management.",
|
|
2020
|
+
category: "hololand",
|
|
2021
|
+
properties: [],
|
|
2022
|
+
methods: [
|
|
2023
|
+
{
|
|
2024
|
+
name: "connect",
|
|
2025
|
+
signature: "connect(config: ConnectionConfig): Promise<void>",
|
|
2026
|
+
description: "Connect to Hololand server.",
|
|
2027
|
+
parameters: [
|
|
2028
|
+
{ name: "config", type: "ConnectionConfig", description: "Connection configuration" }
|
|
2029
|
+
]
|
|
2030
|
+
},
|
|
2031
|
+
{
|
|
2032
|
+
name: "disconnect",
|
|
2033
|
+
signature: "disconnect(): void",
|
|
2034
|
+
description: "Disconnect from server.",
|
|
2035
|
+
parameters: []
|
|
2036
|
+
},
|
|
2037
|
+
{
|
|
2038
|
+
name: "get_local_player",
|
|
2039
|
+
signature: "get_local_player(): Player",
|
|
2040
|
+
description: "Get the local player entity.",
|
|
2041
|
+
parameters: [],
|
|
2042
|
+
returns: "Player"
|
|
2043
|
+
}
|
|
2044
|
+
],
|
|
2045
|
+
events: [
|
|
2046
|
+
{
|
|
2047
|
+
name: "on connection",
|
|
2048
|
+
description: "Fired on connection state change.",
|
|
2049
|
+
payload: '"connected" | "disconnected" | "error"'
|
|
2050
|
+
},
|
|
2051
|
+
{
|
|
2052
|
+
name: "on player_joined",
|
|
2053
|
+
description: "Fired when a player joins.",
|
|
2054
|
+
payload: "{ player: Player }"
|
|
2055
|
+
},
|
|
2056
|
+
{
|
|
2057
|
+
name: "on player_left",
|
|
2058
|
+
description: "Fired when a player leaves.",
|
|
2059
|
+
payload: "{ player: Player }"
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
name: "on world_joined",
|
|
2063
|
+
description: "Fired when joining a world.",
|
|
2064
|
+
payload: "{ world_id: string }"
|
|
2065
|
+
},
|
|
2066
|
+
{
|
|
2067
|
+
name: "on stream_message",
|
|
2068
|
+
description: "Fired on streaming protocol message.",
|
|
2069
|
+
payload: "{ channel: string, data: any }"
|
|
2070
|
+
}
|
|
2071
|
+
],
|
|
2072
|
+
example: `on @hololand.connection("connected") {
|
|
2073
|
+
notify("Connected to Hololand server")
|
|
2074
|
+
}
|
|
2075
|
+
|
|
2076
|
+
on @hololand.player_joined(player) {
|
|
2077
|
+
spawn_particles("welcome", player.position)
|
|
2078
|
+
}`,
|
|
2079
|
+
since: "2.0.0"
|
|
2080
|
+
}
|
|
2081
|
+
};
|
|
2082
|
+
}
|
|
2083
|
+
});
|
|
2084
|
+
|
|
2085
|
+
exports.formatTraitDocAsMarkdown = formatTraitDocAsMarkdown;
|
|
2086
|
+
exports.formatTraitDocCompact = formatTraitDocCompact;
|
|
2087
|
+
exports.getAllTraitNames = getAllTraitNames;
|
|
2088
|
+
exports.getTraitDoc = getTraitDoc;
|
|
2089
|
+
exports.getTraitsByCategory = getTraitsByCategory;
|
|
2090
|
+
exports.init_traitDocs = init_traitDocs;
|
|
2091
|
+
//# sourceMappingURL=chunk-5FSKKMR7.cjs.map
|
|
2092
|
+
//# sourceMappingURL=chunk-5FSKKMR7.cjs.map
|