@carbonenginejs/runtime 0.1.0-alpha.0 → 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -125
- package/dist/audio/index.js +8 -1
- package/dist/audio/index.js.map +1 -1
- package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js +84 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionLogCB.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js +14 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecord.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js +26 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordExecuteActionOnPlayingID.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js +27 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordPostEvent.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js +27 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetRTPC.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js +25 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetState.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js +26 -0
- package/dist/audio/trinity/audio/AudActionLog/AudActionRecordSetSwitch.js.map +1 -0
- package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js +58 -0
- package/dist/audio/trinity/audio/AudActionLog/IAudActionLog.js.map +1 -0
- package/dist/audio/trinity/audio/AudManager.js +1 -1
- package/dist/audio/trinity/audio/AudManager.js.map +1 -1
- package/dist/audio/trinity/audio/{AudObstructionOcclusion.js → AudObstructionOcclusion/AudObstructionOcclusion.js} +8 -52
- package/dist/audio/trinity/audio/AudObstructionOcclusion/AudObstructionOcclusion.js.map +1 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js +17 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/EmitterState.js.map +1 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js +46 -0
- package/dist/audio/trinity/audio/AudObstructionOcclusion/FadingValue.js.map +1 -0
- package/dist/audio/trinity/index.js +8 -1
- package/dist/audio/trinity/index.js.map +1 -1
- package/dist/character/CjsCharacterAppearanceConstruction.js +5 -0
- package/dist/character/CjsCharacterAppearanceConstruction.js.map +1 -1
- package/dist/character/CjsCharacterAppearanceManager.js +14 -0
- package/dist/character/CjsCharacterAppearanceManager.js.map +1 -1
- package/dist/character/CjsCharacterFoundationConstruction.js +5 -0
- package/dist/character/CjsCharacterFoundationConstruction.js.map +1 -1
- package/dist/character/CjsCharacterTexturePolicy.js +5 -0
- package/dist/character/CjsCharacterTexturePolicy.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesAppearanceAL.js +17 -0
- package/dist/character/gles/CjsCharacterGlesAppearanceAL.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js +2 -0
- package/dist/character/gles/CjsCharacterGlesAtlasRenderer.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js +5 -0
- package/dist/character/gles/CjsCharacterGlesFoundationTranslator.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js +5 -0
- package/dist/character/gles/CjsCharacterGlesLegacyConstructionTranslator.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesMorphDeformation.js +2 -0
- package/dist/character/gles/CjsCharacterGlesMorphDeformation.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js +5 -0
- package/dist/character/gles/CjsCharacterGlesPaletteCompatibility.js.map +1 -1
- package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js +5 -0
- package/dist/character/gles/CjsCharacterGlesTriangleCoverage.js.map +1 -1
- package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js +9 -0
- package/dist/character/webgl2/CjsCharacterWebgl2EffectRouter.js.map +1 -1
- package/dist/global/blue/CjsScriptCallback.js +142 -0
- package/dist/global/blue/CjsScriptCallback.js.map +1 -0
- package/dist/global/blue/index.js +2 -0
- package/dist/global/blue/index.js.map +1 -0
- package/dist/global/consts/renderContext/formats.js +51 -1
- package/dist/global/consts/renderContext/formats.js.map +1 -1
- package/dist/global/consts/renderContext/index.js +2 -2
- package/dist/global/consts/renderContext/renderStates.js +16 -1
- package/dist/global/consts/renderContext/renderStates.js.map +1 -1
- package/dist/global/contracts/index.js +0 -1
- package/dist/global/contracts/index.js.map +1 -1
- package/dist/global/index.js +4 -3
- package/dist/global/index.js.map +1 -1
- package/dist/global/math/index.js +2 -0
- package/dist/global/math/index.js.map +1 -1
- package/dist/global/math/mesh.js +70 -16
- package/dist/global/math/mesh.js.map +1 -1
- package/dist/global/math/noise.js +47 -68
- package/dist/global/math/noise.js.map +1 -1
- package/dist/global/math/pool.js +18 -3
- package/dist/global/math/pool.js.map +1 -1
- package/dist/global/math/random.js +52 -0
- package/dist/global/math/random.js.map +1 -0
- package/dist/global/math/tri3.js +18 -4
- package/dist/global/math/tri3.js.map +1 -1
- package/dist/global/utils/bytes.js +22 -4
- package/dist/global/utils/bytes.js.map +1 -1
- package/dist/global/utils/checksum.js +80 -0
- package/dist/global/utils/checksum.js.map +1 -0
- package/dist/global/utils/errors/CjsCancellationError.js +36 -0
- package/dist/global/utils/errors/CjsCancellationError.js.map +1 -0
- package/dist/global/utils/errors/CjsError.js +21 -52
- package/dist/global/utils/errors/CjsError.js.map +1 -1
- package/dist/global/utils/errors/abort.js +1 -1
- package/dist/global/utils/errors/abort.js.map +1 -1
- package/dist/global/utils/errors/index.js +2 -1
- package/dist/global/utils/errors/index.js.map +1 -1
- package/dist/global/utils/index.js +4 -2
- package/dist/global/utils/index.js.map +1 -1
- package/dist/index.js +95 -35
- package/dist/index.js.map +1 -1
- package/dist/input/Tr2MainWindow.js +7 -9
- package/dist/input/Tr2MainWindow.js.map +1 -1
- package/dist/resource/CjsResMan.js +33 -39
- package/dist/resource/CjsResMan.js.map +1 -1
- package/dist/resource/CjsResource.js +19 -5
- package/dist/resource/CjsResource.js.map +1 -1
- package/dist/resource/audio/AudioGeometryResData.js +22 -27
- package/dist/resource/audio/AudioGeometryResData.js.map +1 -1
- package/dist/resource/audio/CjsAudioRes.js +4 -5
- package/dist/resource/audio/CjsAudioRes.js.map +1 -1
- package/dist/resource/format/CjsBitReader.js +263 -0
- package/dist/resource/format/CjsBitReader.js.map +1 -0
- package/dist/resource/format/CjsByteReader.js +130 -125
- package/dist/resource/format/CjsByteReader.js.map +1 -1
- package/dist/resource/format/CjsFormat.js +11 -4
- package/dist/resource/format/CjsFormat.js.map +1 -1
- package/dist/resource/format/CjsFormatError.js +37 -1
- package/dist/resource/format/CjsFormatError.js.map +1 -1
- package/dist/resource/format/CjsResourceProbe.js +41 -37
- package/dist/resource/format/CjsResourceProbe.js.map +1 -1
- package/dist/resource/format/carbonRecordGuard.js +33 -0
- package/dist/resource/format/carbonRecordGuard.js.map +1 -0
- package/dist/resource/format/imageSignatures.js +202 -0
- package/dist/resource/format/imageSignatures.js.map +1 -0
- package/dist/resource/format/index.js +2 -1
- package/dist/resource/format/index.js.map +1 -1
- package/dist/resource/format/jsonPolicies.js +180 -0
- package/dist/resource/format/jsonPolicies.js.map +1 -0
- package/dist/resource/formats/black/core/helpers.js +18 -29
- package/dist/resource/formats/black/core/helpers.js.map +1 -1
- package/dist/resource/formats/bnk/CjsBnkFormat.js +4 -3
- package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
- package/dist/resource/formats/bnk/core/WwiseCursor.js +218 -0
- package/dist/resource/formats/bnk/core/WwiseCursor.js.map +1 -0
- package/dist/resource/formats/bnk/core/busNodes.js +2 -1
- package/dist/resource/formats/bnk/core/busNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/effectNodes.js +2 -1
- package/dist/resource/formats/bnk/core/effectNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/eventAction.js +15 -93
- package/dist/resource/formats/bnk/core/eventAction.js.map +1 -1
- package/dist/resource/formats/bnk/core/globalSettings.js +19 -94
- package/dist/resource/formats/bnk/core/globalSettings.js.map +1 -1
- package/dist/resource/formats/bnk/core/helpers.js +2 -48
- package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
- package/dist/resource/formats/bnk/core/musicNodes.js +42 -134
- package/dist/resource/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/resource/formats/bnk/core/nodeBase.js +20 -111
- package/dist/resource/formats/bnk/core/nodeBase.js.map +1 -1
- package/dist/resource/formats/bnk/core/sfxNodes.js +2 -1
- package/dist/resource/formats/bnk/core/sfxNodes.js.map +1 -1
- package/dist/resource/formats/cmf/CjsCmfFormat.js +242 -228
- package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
- package/dist/resource/formats/cmf/core/binary.js +54 -60
- package/dist/resource/formats/cmf/core/binary.js.map +1 -1
- package/dist/resource/formats/dds/CjsDdsFormat.js +5 -3
- package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
- package/dist/resource/formats/dds/core/bc6h.js +16 -18
- package/dist/resource/formats/dds/core/bc6h.js.map +1 -1
- package/dist/resource/formats/dds/core/bc7.js +28 -24
- package/dist/resource/formats/dds/core/bc7.js.map +1 -1
- package/dist/resource/formats/dds/core/helpers.js +7 -133
- package/dist/resource/formats/dds/core/helpers.js.map +1 -1
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js +3 -2
- package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
- package/dist/resource/formats/dxbc/core/helpers.js +4 -32
- package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
- package/dist/resource/formats/fbx/CjsFbxFormat.js +11 -0
- package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
- package/dist/resource/formats/fbx/core/helpers.js +18 -12
- package/dist/resource/formats/fbx/core/helpers.js.map +1 -1
- package/dist/resource/formats/flac/CjsFlacFormat.js +4 -9
- package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/resource/formats/flac/core/helpers.js +1 -62
- package/dist/resource/formats/flac/core/helpers.js.map +1 -1
- package/dist/resource/formats/gif/CjsGifFormat.js +4 -9
- package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/resource/formats/gif/core/helpers.js +1 -63
- package/dist/resource/formats/gif/core/helpers.js.map +1 -1
- package/dist/resource/formats/gltf/CjsGltfFormat.js +4 -3
- package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
- package/dist/resource/formats/gltf/core/helpers.js +3 -19
- package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/CjsGr2Format.js +105 -92
- package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
- package/dist/resource/formats/gr2/core/container.js +1 -10
- package/dist/resource/formats/gr2/core/container.js.map +1 -1
- package/dist/resource/formats/gr2/core/helpers.js +24 -35
- package/dist/resource/formats/gr2/core/helpers.js.map +1 -1
- package/dist/resource/formats/gr2/core/shared.js +193 -189
- package/dist/resource/formats/gr2/core/shared.js.map +1 -1
- package/dist/resource/formats/hlsl/CjsHlslFormat.js +4 -3
- package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
- package/dist/resource/formats/hlsl/core/helpers.js +1 -30
- package/dist/resource/formats/hlsl/core/helpers.js.map +1 -1
- package/dist/resource/formats/jpeg/CjsJpegFormat.js +5 -3
- package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
- package/dist/resource/formats/jpeg/core/helpers.js +7 -134
- package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp3/CjsMp3Format.js +4 -9
- package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
- package/dist/resource/formats/mp3/core/helpers.js +1 -64
- package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
- package/dist/resource/formats/mp4/CjsMp4Format.js +4 -9
- package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
- package/dist/resource/formats/mp4/core/helpers.js +1 -73
- package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
- package/dist/resource/formats/obj/CjsObjFormat.js +4 -3
- package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
- package/dist/resource/formats/obj/core/helpers.js +93 -115
- package/dist/resource/formats/obj/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/CjsOggFormat.js +4 -3
- package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/resource/formats/ogg/core/helpers.js +1 -15
- package/dist/resource/formats/ogg/core/helpers.js.map +1 -1
- package/dist/resource/formats/ogg/core/vorbis.js +138 -144
- package/dist/resource/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/resource/formats/pickle/CjsPickleFormat.js +83 -114
- package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
- package/dist/resource/formats/png/CjsPngFormat.js +5 -3
- package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
- package/dist/resource/formats/png/core/helpers.js +13 -152
- package/dist/resource/formats/png/core/helpers.js.map +1 -1
- package/dist/resource/formats/png/core/writer.js +3 -27
- package/dist/resource/formats/png/core/writer.js.map +1 -1
- package/dist/resource/formats/red/core/helpers.js +19 -29
- package/dist/resource/formats/red/core/helpers.js.map +1 -1
- package/dist/resource/formats/stl/CjsStlFormat.js +158 -147
- package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
- package/dist/resource/formats/stl/core/helpers.js +44 -66
- package/dist/resource/formats/stl/core/helpers.js.map +1 -1
- package/dist/resource/formats/tga/CjsTgaFormat.js +5 -3
- package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
- package/dist/resource/formats/tga/core/helpers.js +7 -153
- package/dist/resource/formats/tga/core/helpers.js.map +1 -1
- package/dist/resource/formats/vta/CjsVtaFormat.js +4 -3
- package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
- package/dist/resource/formats/vta/core/helpers.js +1 -17
- package/dist/resource/formats/vta/core/helpers.js.map +1 -1
- package/dist/resource/formats/wav/CjsWavFormat.js +4 -3
- package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
- package/dist/resource/formats/wav/core/helpers.js +1 -15
- package/dist/resource/formats/wav/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgl/CjsWebglFormat.js +4 -3
- package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +52 -4
- package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
- package/dist/resource/formats/webgl/core/helpers.js +39 -68
- package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +4 -3
- package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
- package/dist/resource/formats/webgpu/core/helpers.js +4 -30
- package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
- package/dist/resource/formats/webm/CjsWebmFormat.js +4 -9
- package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
- package/dist/resource/formats/webm/core/helpers.js +1 -73
- package/dist/resource/formats/webm/core/helpers.js.map +1 -1
- package/dist/resource/formats/webp/CjsWebpFormat.js +4 -9
- package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/resource/formats/webp/core/helpers.js +1 -62
- package/dist/resource/formats/webp/core/helpers.js.map +1 -1
- package/dist/resource/formats/wem/CjsWemFormat.js +4 -3
- package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/resource/formats/wem/core/bitStream.js +83 -106
- package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
- package/dist/resource/formats/wem/core/codebookLibrary.js +52 -52
- package/dist/resource/formats/wem/core/codebookLibrary.js.map +1 -1
- package/dist/resource/formats/wem/core/helpers.js +1 -15
- package/dist/resource/formats/wem/core/helpers.js.map +1 -1
- package/dist/resource/formats/wem/core/wemToOgg.js +67 -67
- package/dist/resource/formats/wem/core/wemToOgg.js.map +1 -1
- package/dist/resource/geometry/MeshDecalData.js +23 -25
- package/dist/resource/geometry/MeshDecalData.js.map +1 -1
- package/dist/resource/geometry/MeshDecalLodData.js +14 -23
- package/dist/resource/geometry/MeshDecalLodData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryRes.js +299 -284
- package/dist/resource/geometry/TriGeometryRes.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResAreaData.js +30 -31
- package/dist/resource/geometry/TriGeometryResAreaData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResJointData.js +16 -24
- package/dist/resource/geometry/TriGeometryResJointData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResLodData.js +50 -41
- package/dist/resource/geometry/TriGeometryResLodData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResMeshData.js +32 -32
- package/dist/resource/geometry/TriGeometryResMeshData.js.map +1 -1
- package/dist/resource/geometry/TriGeometryResSkeletonData.js +14 -23
- package/dist/resource/geometry/TriGeometryResSkeletonData.js.map +1 -1
- package/dist/resource/geometry/TriJointBinding.js +16 -24
- package/dist/resource/geometry/TriJointBinding.js.map +1 -1
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js +22 -27
- package/dist/resource/geometry/TriMorphTargetGeometryConstants.js.map +1 -1
- package/dist/resource/geometry/TriRtGeometryConstants.js +50 -41
- package/dist/resource/geometry/TriRtGeometryConstants.js.map +1 -1
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js +12 -22
- package/dist/resource/geometry/granny/GStateBindingCallbackData.js.map +1 -1
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js +30 -31
- package/dist/resource/geometry/granny/Tr2GrannyIntersectionResult.js.map +1 -1
- package/dist/resource/index.js +1 -1
- package/dist/resource/shader/reflection/Tr2EffectConstant.js +16 -17
- package/dist/resource/shader/reflection/Tr2EffectConstant.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectDescription.js +26 -28
- package/dist/resource/shader/reflection/Tr2EffectDescription.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js +24 -25
- package/dist/resource/shader/reflection/Tr2EffectLibrary.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js +21 -22
- package/dist/resource/shader/reflection/Tr2EffectParameterAnnotation.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectResource.js +25 -26
- package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js +69 -72
- package/dist/resource/shader/reflection/Tr2EffectStageInput.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js +17 -18
- package/dist/resource/shader/reflection/Tr2EffectTechnique.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2Pass.js +42 -43
- package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
- package/dist/resource/shader/reflection/Tr2RenderStateSetup.js +26 -5
- package/dist/resource/shader/reflection/Tr2RenderStateSetup.js.map +1 -1
- package/dist/resource/shader/reflection/carbonRecordFields.js +87 -90
- package/dist/resource/shader/reflection/carbonRecordFields.js.map +1 -1
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js +32 -34
- package/dist/resource/shader/sampler/Tr2SamplerSetup.js.map +1 -1
- package/dist/resource/texture/CjsTextureArrayRes.js +1 -6
- package/dist/resource/texture/CjsTextureArrayRes.js.map +1 -1
- package/dist/resource/texture/Tr2TextureLodManager.js +35 -27
- package/dist/resource/texture/Tr2TextureLodManager.js.map +1 -1
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js +16 -24
- package/dist/resource/texture/Tr2TextureLodUpdateRequest.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePackChannel.js +16 -24
- package/dist/resource/texture/Tr2TexturePackChannel.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipeline.js +24 -20
- package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineParams.js +14 -23
- package/dist/resource/texture/Tr2TexturePipelineParams.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +18 -25
- package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +11 -16
- package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +14 -23
- package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +12 -22
- package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js +38 -26
- package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
- package/dist/resource/worker/CjsResManMainThreadLoader.js +2 -5
- package/dist/resource/worker/CjsResManMainThreadLoader.js.map +1 -1
- package/dist/resource/worker/CjsResManWorkerLoader.js +6 -7
- package/dist/resource/worker/CjsResManWorkerLoader.js.map +1 -1
- package/dist/resource/worker/protocol.js +18 -1
- package/dist/resource/worker/protocol.js.map +1 -1
- package/dist/sof/EveSOF.js +2 -222
- package/dist/sof/EveSOF.js.map +1 -1
- package/dist/sof/SofDocumentBuilder.js +205 -0
- package/dist/sof/SofDocumentBuilder.js.map +1 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js +16 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeNotFound.js.map +1 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js +16 -0
- package/dist/sof/faction/ErrSOFFactionColorSetTypeUnknown.js.map +1 -0
- package/dist/sof/faction/EveSOFDataFactionColorSet.js +3 -27
- package/dist/sof/faction/EveSOFDataFactionColorSet.js.map +1 -1
- package/dist/sof/faction/index.js +3 -1
- package/dist/sof/faction/index.js.map +1 -1
- package/dist/sof/generic/ErrSOFAreaShaderNotFound.js +18 -0
- package/dist/sof/generic/ErrSOFAreaShaderNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFDecalShaderNotFound.js +18 -0
- package/dist/sof/generic/ErrSOFDecalShaderNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js +21 -0
- package/dist/sof/generic/ErrSOFMaterialPrefixNotFound.js.map +1 -0
- package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js +21 -0
- package/dist/sof/generic/ErrSOFPatternMaterialPrefixNotFound.js.map +1 -0
- package/dist/sof/generic/EveSOFDataGeneric.js +5 -69
- package/dist/sof/generic/EveSOFDataGeneric.js.map +1 -1
- package/dist/sof/generic/index.js +5 -1
- package/dist/sof/generic/index.js.map +1 -1
- package/dist/sof/index.js +23 -7
- package/dist/sof/index.js.map +1 -1
- package/dist/sof/pattern/ErrSOFProjectionNotFound.js +20 -0
- package/dist/sof/pattern/ErrSOFProjectionNotFound.js.map +1 -0
- package/dist/sof/pattern/EveSOFDataPattern.js +2 -17
- package/dist/sof/pattern/EveSOFDataPattern.js.map +1 -1
- package/dist/sof/pattern/index.js +2 -1
- package/dist/sof/pattern/index.js.map +1 -1
- package/dist/sof/shared/ErrSOFAreaTypeNotFound.js +16 -0
- package/dist/sof/shared/ErrSOFAreaTypeNotFound.js.map +1 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js +16 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeNotFound.js.map +1 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js +16 -0
- package/dist/sof/shared/ErrSOFLogoSetTypeUnknown.js.map +1 -0
- package/dist/sof/shared/EveSOFDataArea.js +2 -13
- package/dist/sof/shared/EveSOFDataArea.js.map +1 -1
- package/dist/sof/shared/EveSOFDataLogoSet.js +3 -27
- package/dist/sof/shared/EveSOFDataLogoSet.js.map +1 -1
- package/dist/sof/shared/EveSOFDataParameter.js +2 -146
- package/dist/sof/shared/EveSOFDataParameter.js.map +1 -1
- package/dist/sof/shared/EveSOFDataParameterBool.js +40 -0
- package/dist/sof/shared/EveSOFDataParameterBool.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterColor.js +36 -0
- package/dist/sof/shared/EveSOFDataParameterColor.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterFloat.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterFloat.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterInt.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterInt.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterVector2.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterVector2.js.map +1 -0
- package/dist/sof/shared/EveSOFDataParameterVector3.js +37 -0
- package/dist/sof/shared/EveSOFDataParameterVector3.js.map +1 -0
- package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js → EveSOFDataSpotLightAttachment.js} +1 -1
- package/dist/sof/shared/{EveSOFDataSpotlightAttachment.js.map → EveSOFDataSpotLightAttachment.js.map} +1 -1
- package/dist/sof/shared/index.js +13 -4
- package/dist/sof/shared/index.js.map +1 -1
- package/dist/sof/sofDocumentValues.js +33 -0
- package/dist/sof/sofDocumentValues.js.map +1 -0
- package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js +168 -0
- package/dist/trinity/controllers/ITr2Controller/ITr2ActionController.js.map +1 -0
- package/dist/trinity/controllers/{ITr2Controller.js → ITr2Controller/ITr2Controller.js} +2 -134
- package/dist/trinity/controllers/ITr2Controller/ITr2Controller.js.map +1 -0
- package/dist/trinity/controllers/Tr2Controller.js +2 -1
- package/dist/trinity/controllers/Tr2Controller.js.map +1 -1
- package/dist/trinity/controllers/Tr2ControllerReference.js +2 -1
- package/dist/trinity/controllers/Tr2ControllerReference.js.map +1 -1
- package/dist/trinity/controllers/action/ITr2ControllerAction.js +2 -1
- package/dist/trinity/controllers/action/ITr2ControllerAction.js.map +1 -1
- package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js +10 -9
- package/dist/trinity/controllers/action/Tr2ActionSpawnParticles.js.map +1 -1
- package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js +26 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionCompileError.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js +24 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionEvaluateError.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js +387 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionParser.js.map +1 -0
- package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js +4 -1011
- package/dist/trinity/controllers/expression/CjsControllerExpressionProgram.js.map +1 -1
- package/dist/trinity/controllers/expression/expressionRuntime.js +605 -0
- package/dist/trinity/controllers/expression/expressionRuntime.js.map +1 -0
- package/dist/trinity/controllers/index.js +5 -2
- package/dist/trinity/controllers/index.js.map +1 -1
- package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js +2 -1
- package/dist/trinity/controllers/state/ITr2StateMachineStateFinalizer.js.map +1 -1
- package/dist/trinity/controllers/timeline/Tr2TimelineController.js +2 -1
- package/dist/trinity/controllers/timeline/Tr2TimelineController.js.map +1 -1
- package/dist/trinity/core/ITr2Updateable.js +2 -1
- package/dist/trinity/core/ITr2Updateable.js.map +1 -1
- package/dist/trinity/core/Tr2Blitter.js +6 -3
- package/dist/trinity/core/Tr2Blitter.js.map +1 -1
- package/dist/trinity/core/Tr2Denoiser.js +256 -0
- package/dist/trinity/core/Tr2Denoiser.js.map +1 -0
- package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js +115 -0
- package/dist/trinity/core/Tr2GpuResourcePool/GpuResourceHandle.js.map +1 -0
- package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js +79 -0
- package/dist/trinity/core/Tr2GpuResourcePool/TextureSize2D.js.map +1 -0
- package/dist/trinity/core/{Tr2GpuResourcePool.js → Tr2GpuResourcePool/Tr2GpuResourcePool.js} +63 -151
- package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -0
- package/dist/trinity/core/{Tr2QuadRenderer.js → Tr2QuadRenderer/Tr2QuadRenderer.js} +8 -30
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRenderer.js.map +1 -0
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js +38 -0
- package/dist/trinity/core/Tr2QuadRenderer/Tr2QuadRendererEffectRecord.js.map +1 -0
- package/dist/trinity/core/Tr2RenderUtils.js +20 -3
- package/dist/trinity/core/Tr2RenderUtils.js.map +1 -1
- package/dist/trinity/core/Tr2Renderer.js +146 -1
- package/dist/trinity/core/Tr2Renderer.js.map +1 -1
- package/dist/trinity/core/Tr2ShadowMap.js +135 -14
- package/dist/trinity/core/Tr2ShadowMap.js.map +1 -1
- package/dist/trinity/core/{Tr2TextureArray.js → Tr2TextureArray/Tr2TextureArray.js} +3 -58
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -0
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js +61 -0
- package/dist/trinity/core/Tr2TextureArray/Tr2TextureArrayElement.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js +26 -0
- package/dist/trinity/core/batch/TriRenderBatch/DefaultKeyGenerator.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js +29 -0
- package/dist/trinity/core/batch/TriRenderBatch/EffectKeyGenerator.js.map +1 -0
- package/dist/trinity/core/batch/{ITriRenderBatchAccumulator.js → TriRenderBatch/ITriRenderBatchAccumulator.js} +30 -30
- package/dist/trinity/core/batch/TriRenderBatch/ITriRenderBatchAccumulator.js.map +1 -0
- package/dist/trinity/core/batch/{Tr2RenderBatch.js → TriRenderBatch/Tr2RenderBatch.js} +81 -154
- package/dist/trinity/core/batch/TriRenderBatch/Tr2RenderBatch.js.map +1 -0
- package/dist/trinity/core/batch/{TriRenderBatchAccumulator.js → TriRenderBatch/TriRenderBatchAccumulator.js} +7 -38
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAccumulator.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js +61 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlock.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js +40 -0
- package/dist/trinity/core/batch/TriRenderBatch/TriRenderBatchAreaBlocksWithSharedMaterial.js.map +1 -0
- package/dist/trinity/core/batch/TriRenderBatchMap.js +6 -1
- package/dist/trinity/core/batch/TriRenderBatchMap.js.map +1 -1
- package/dist/trinity/core/context/Tr2RenderContext.js +75 -57
- package/dist/trinity/core/context/Tr2RenderContext.js.map +1 -1
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js +67 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityEvent.js.map +1 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js +50 -0
- package/dist/trinity/core/context/Tr2VisibilityResults/Tr2VisibilityResults.js.map +1 -0
- package/dist/trinity/core/device/Tr2DepthStencil.js +186 -13
- package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
- package/dist/trinity/core/device/{Tr2RingBuffer.js → Tr2RingBuffer/Tr2RingBuffer.js} +27 -79
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js.map +1 -0
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js +114 -0
- package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBufferOffsets.js.map +1 -0
- package/dist/trinity/core/device/{Tr2SuballocatedBuffer.js → Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js} +5 -59
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBuffer.js.map +1 -0
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js +80 -0
- package/dist/trinity/core/device/Tr2SuballocatedBuffer/Tr2SuballocatedBufferAllocation.js.map +1 -0
- package/dist/trinity/core/index.js +42 -15
- package/dist/trinity/core/index.js.map +1 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js +6 -1
- package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
- package/dist/trinity/core/mesh/{ITr2ImpostorSource.js → ITr2ImpostorSource/ITr2ImpostorSource.js} +6 -28
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSource.js.map +1 -0
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js +32 -0
- package/dist/trinity/core/mesh/ITr2ImpostorSource/ITr2ImpostorSourceImpostorHash.js.map +1 -0
- package/dist/trinity/core/mesh/{ITr2InstanceData.js → ITr2InstanceData/ITr2InstanceData.js} +5 -29
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceData.js.map +1 -0
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js +33 -0
- package/dist/trinity/core/mesh/ITr2InstanceData/ITr2InstanceDataInstanceData.js.map +1 -0
- package/dist/trinity/core/mesh/Tr2DirectInstanceData.js +2 -1
- package/dist/trinity/core/mesh/Tr2DirectInstanceData.js.map +1 -1
- package/dist/trinity/core/mesh/Tr2MeshBase.js +7 -1
- package/dist/trinity/core/mesh/Tr2MeshBase.js.map +1 -1
- package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js +2 -1
- package/dist/trinity/core/mesh/Tr2RuntimeInstanceData.js.map +1 -1
- package/dist/trinity/core/mesh/TriGeometryResAllocations.js +6 -2
- package/dist/trinity/core/mesh/TriGeometryResAllocations.js.map +1 -1
- package/dist/trinity/core/rawData/CjsConstantLayout.js +196 -0
- package/dist/trinity/core/rawData/CjsConstantLayout.js.map +1 -0
- package/dist/trinity/core/rawData/CjsPerFrameLayouts.js +8 -3
- package/dist/trinity/core/rawData/CjsPerFrameLayouts.js.map +1 -1
- package/dist/trinity/core/rawData/CjsPerObjectLayouts.js +40 -732
- package/dist/trinity/core/rawData/CjsPerObjectLayouts.js.map +1 -1
- package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js +34 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBasicLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js +69 -0
- package/dist/trinity/core/rawData/layouts/CjsEveBoosterSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js +59 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBoosterSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js +37 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildBulletStormLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js +44 -0
- package/dist/trinity/core/rawData/layouts/CjsEveChildSpherePinLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js +31 -0
- package/dist/trinity/core/rawData/layouts/CjsEveLensflareLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js +29 -0
- package/dist/trinity/core/rawData/layouts/CjsEveMissileWarheadLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js +39 -0
- package/dist/trinity/core/rawData/layouts/CjsEvePerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js +30 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSceneStaticParticlesLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js +78 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectDecalLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js +169 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpaceObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js +107 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpacePerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js +44 -0
- package/dist/trinity/core/rawData/layouts/CjsEveSpherePinLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js +34 -0
- package/dist/trinity/core/rawData/layouts/CjsEveStretch2Layout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js +82 -0
- package/dist/trinity/core/rawData/layouts/CjsEveTurretSetLayout.js.map +1 -0
- package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js +42 -0
- package/dist/trinity/core/rawData/layouts/CjsTr2PerObjectLayout.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveBasicPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveBoosterSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBoosterSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildBulletStormPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveChildSpherePinPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveDecalPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveLensflarePerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveMissileWarheadPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveSceneStaticParticlesPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/EveSpherePinPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js +59 -0
- package/dist/trinity/core/rawData/perObjectData/EveTurretSetPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js +55 -0
- package/dist/trinity/core/rawData/perObjectData/StretchPerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/{Tr2PerObjectData.js → perObjectData/Tr2PerObjectData.js} +110 -62
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectData.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js +104 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataPSBuffer.js.map +1 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js +87 -0
- package/dist/trinity/core/rawData/perObjectData/Tr2PerObjectDataStandard.js.map +1 -0
- package/dist/trinity/core/variable/TriVariable.js +83 -83
- package/dist/trinity/core/variable/TriVariable.js.map +1 -1
- package/dist/trinity/core/vertex/{Tr2VertexDefinition.js → Tr2VertexDefinition/Tr2VertexDefinition.js} +4 -20
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinition.js.map +1 -0
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js +29 -0
- package/dist/trinity/core/vertex/Tr2VertexDefinition/Tr2VertexDefinitionItem.js.map +1 -0
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +116 -36
- package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
- package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js +50 -92
- package/dist/trinity/curves/curve/Tr2CurveRandomAxisRotation.js.map +1 -1
- package/dist/trinity/eve/EveModularObjectModifier.js +9 -5
- package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
- package/dist/trinity/eve/IEveInheritPropertiesOwner.js +2 -1
- package/dist/trinity/eve/IEveInheritPropertiesOwner.js.map +1 -1
- package/dist/trinity/eve/IEveSpaceObject2.js +2 -1
- package/dist/trinity/eve/IEveSpaceObject2.js.map +1 -1
- package/dist/trinity/eve/IEveTransform.js +2 -1
- package/dist/trinity/eve/IEveTransform.js.map +1 -1
- package/dist/trinity/eve/attachment/banner/EveBannerSet.js +2 -2
- package/dist/trinity/eve/attachment/banner/EveBannerSet.js.map +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js +109 -133
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2.js.map +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js +40 -0
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Item.js.map +1 -0
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js +1 -1
- package/dist/trinity/eve/attachment/booster/EveBoosterSet2Renderable.js.map +1 -1
- package/dist/trinity/eve/attachment/decal/DecalMeshCache.js +2 -14
- package/dist/trinity/eve/attachment/decal/DecalMeshCache.js.map +1 -1
- package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js +18 -0
- package/dist/trinity/eve/attachment/decal/DecalMeshCacheMeshBuffers.js.map +1 -0
- package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js +1 -1
- package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js.map +1 -1
- package/dist/trinity/eve/attachment/haze/EveHazeSet.js +1 -1
- package/dist/trinity/eve/attachment/haze/EveHazeSet.js.map +1 -1
- package/dist/trinity/eve/attachment/plane/EvePlaneSet.js +1 -1
- package/dist/trinity/eve/attachment/plane/EvePlaneSet.js.map +1 -1
- package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js +2 -2
- package/dist/trinity/eve/attachment/spotlight/EveSpotlightSet.js.map +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteLineSet.js.map +1 -1
- package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js +4 -2
- package/dist/trinity/eve/attachment/sprite/EveSpriteSet.js.map +1 -1
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +143 -139
- package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
- package/dist/trinity/eve/camera/EveCamera.js +1 -1
- package/dist/trinity/eve/camera/EveCamera.js.map +1 -1
- package/dist/trinity/eve/child/EveChildBoosterSet.js +12 -1
- package/dist/trinity/eve/child/EveChildBoosterSet.js.map +1 -1
- package/dist/trinity/eve/child/EveChildCloud2.js +178 -151
- package/dist/trinity/eve/child/EveChildCloud2.js.map +1 -1
- package/dist/trinity/eve/child/EveChildContainer.js +141 -141
- package/dist/trinity/eve/child/EveChildContainer.js.map +1 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +87 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js +46 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshArea.js.map +1 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js +35 -0
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshInstance.js.map +1 -0
- package/dist/trinity/eve/child/{EveChildInstancedMeshes.js → EveChildInstancedMeshes/EveChildInstancedMeshes.js} +42 -163
- package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -0
- package/dist/trinity/eve/child/EveChildMesh.js +218 -218
- package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js +53 -0
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartData.js.map +1 -0
- package/dist/trinity/eve/child/{EveChildPartData.js → EveChildPartData/EveChildPartDataPartData.js} +9 -45
- package/dist/trinity/eve/child/EveChildPartData/EveChildPartDataPartData.js.map +1 -0
- package/dist/trinity/eve/child/EveChildParticleSystem.js +30 -29
- package/dist/trinity/eve/child/EveChildParticleSystem.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTransform.js +5 -0
- package/dist/trinity/eve/child/EveChildTransform.js.map +1 -1
- package/dist/trinity/eve/child/EveChildTurret.js +7 -0
- package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
- package/dist/trinity/eve/index.js +10 -4
- package/dist/trinity/eve/index.js.map +1 -1
- package/dist/trinity/eve/lights/Tr2Light.js +5 -0
- package/dist/trinity/eve/lights/Tr2Light.js.map +1 -1
- package/dist/trinity/eve/overlays/overlayBatches.js +6 -1
- package/dist/trinity/eve/overlays/overlayBatches.js.map +1 -1
- package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js +4 -4
- package/dist/trinity/eve/particles/static/EveSceneStaticParticles.js.map +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch2.js +76 -71
- package/dist/trinity/eve/renderable/stretch/EveStretch2.js.map +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch3.js +1 -1
- package/dist/trinity/eve/renderable/stretch/EveStretch3.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveShip2.js +3 -3
- package/dist/trinity/eve/spaceObject/EveShip2.js.map +1 -1
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +408 -407
- package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
- package/dist/trinity/eve/ui/EveTacticalOverlay.js +1 -1
- package/dist/trinity/eve/ui/EveTacticalOverlay.js.map +1 -1
- package/dist/trinity/eve/ui/lines/EveCurveLineSet.js +9 -9
- package/dist/trinity/eve/ui/lines/EveCurveLineSet.js.map +1 -1
- package/dist/trinity/eve/ui/lines/EveLineSet.js +27 -25
- package/dist/trinity/eve/ui/lines/EveLineSet.js.map +1 -1
- package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js +3 -2
- package/dist/trinity/eve/ui/tacticalOverlay/EveTacticalTrails.js.map +1 -1
- package/dist/trinity/generated/index.js +0 -1
- package/dist/trinity/generated/index.js.map +1 -1
- package/dist/trinity/generated/trinityCore/index.js +0 -1
- package/dist/trinity/generated/trinityCore/index.js.map +1 -1
- package/dist/trinity/index.js +59 -23
- package/dist/trinity/index.js.map +1 -1
- package/dist/trinity/particle/{ITr2GenericEmitter.js → ITr2GenericEmitter/ITr2GenericEmitter.js} +4 -32
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitter.js.map +1 -0
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js +36 -0
- package/dist/trinity/particle/ITr2GenericEmitter/ITr2GenericEmitterUpdateArguments.js.map +1 -0
- package/dist/trinity/particle/Tr2ParticleSystem.js +4 -2
- package/dist/trinity/particle/Tr2ParticleSystem.js.map +1 -1
- package/dist/trinity/particle/element/Tr2ParticleElementData.js +15 -4
- package/dist/trinity/particle/element/Tr2ParticleElementData.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js +21 -20
- package/dist/trinity/particle/emitter/Tr2DynamicEmitter.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +23 -22
- package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
- package/dist/trinity/particle/emitter/Tr2StaticEmitter.js +14 -13
- package/dist/trinity/particle/emitter/Tr2StaticEmitter.js.map +1 -1
- package/dist/trinity/particle/index.js +2 -1
- package/dist/trinity/particle/index.js.map +1 -1
- package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js +7 -1
- package/dist/trinity/renderJob/step/TriStepPushRenderTarget.js.map +1 -1
- package/dist/trinity/shader/Tr2Effect.js +131 -58
- package/dist/trinity/shader/Tr2Effect.js.map +1 -1
- package/dist/trinity/shader/Tr2EffectStateManager.js +17 -5
- package/dist/trinity/shader/Tr2EffectStateManager.js.map +1 -1
- package/dist/trinity/shader/Tr2Material.js +21 -4
- package/dist/trinity/shader/Tr2Material.js.map +1 -1
- package/dist/trinity/shader/material/Tr2EffectPassParameters.js +4 -1
- package/dist/trinity/shader/material/Tr2EffectPassParameters.js.map +1 -1
- package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js +2 -2
- package/dist/trinity/shader/parameter/Tr2GeometryBufferParameter.js.map +1 -1
- package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js +79 -0
- package/dist/trinityal/Tr2BufferAL/Tr2BufferDescriptionAL.js.map +1 -0
- package/dist/trinityal/{Tr2DeviceResourceAL.js → Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js} +77 -79
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2BaseDeviceResourceAL.js.map +1 -0
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js +24 -0
- package/dist/trinityal/Tr2DeviceResourceAL/Tr2DeviceResourceAL.js.map +1 -0
- package/dist/trinityal/Tr2DrawUPHelper.js +2 -1
- package/dist/trinityal/Tr2DrawUPHelper.js.map +1 -1
- package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js +45 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2MsaaDesc.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js +154 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SamplerDescription.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js +48 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2SubresourceData.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js +75 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureCoordBox.js.map +1 -0
- package/dist/trinityal/{Tr2HalHelperStructures.js → Tr2HalHelperStructures/Tr2TextureSubresource.js} +11 -115
- package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js +51 -0
- package/dist/trinityal/Tr2HalHelperStructures/Tr2Viewport.js.map +1 -0
- package/dist/trinityal/{Tr2RenderPassAL.js → Tr2RenderPassAL/Tr2ColorAttachment.js} +5 -28
- package/dist/trinityal/Tr2RenderPassAL/Tr2ColorAttachment.js.map +1 -0
- package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js +38 -0
- package/dist/trinityal/Tr2RenderPassAL/Tr2DepthAttachment.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js +80 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2RegisterMapAL.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js +76 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetAL.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js +96 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetALStub.js.map +1 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js +196 -0
- package/dist/trinityal/Tr2ResourceSetAL/Tr2ResourceSetDescriptionAL.js.map +1 -0
- package/dist/trinityal/index.js +22 -9
- package/dist/trinityal/index.js.map +1 -1
- package/dist/trinityal/stub/Tr2BufferALStub.js +86 -141
- package/dist/trinityal/stub/Tr2BufferALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2CapsALStub.js +17 -0
- package/dist/trinityal/stub/Tr2CapsALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ConstantBufferALStub.js +57 -41
- package/dist/trinityal/stub/Tr2ConstantBufferALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2FenceALStub.js +18 -2
- package/dist/trinityal/stub/Tr2FenceALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2GpuTimerALStub.js +97 -0
- package/dist/trinityal/stub/Tr2GpuTimerALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js +124 -0
- package/dist/trinityal/stub/Tr2OcclusionQueryALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js +146 -0
- package/dist/trinityal/stub/Tr2PipelineStatsQueryALStub/Tr2PipelineStatsQueryALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js +28 -0
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2BindlessResourcesAL.js.map +1 -0
- package/dist/trinityal/stub/{Tr2RenderContextALStub.js → Tr2RenderContextALStub/Tr2RenderContextALStub.js} +70 -75
- package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -0
- package/dist/trinityal/stub/Tr2SamplerStateALStub.js +47 -31
- package/dist/trinityal/stub/Tr2SamplerStateALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ShaderALStub.js +61 -45
- package/dist/trinityal/stub/Tr2ShaderALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2ShaderProgramALStub.js +51 -33
- package/dist/trinityal/stub/Tr2ShaderProgramALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2SwapChainALStub.js +61 -45
- package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2TextureALStub.js +188 -171
- package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
- package/dist/trinityal/stub/Tr2VertexLayoutALStub.js +43 -27
- package/dist/trinityal/stub/Tr2VertexLayoutALStub.js.map +1 -1
- package/dist/trinityal/stub/{Tr2VideoAdapterInfoALStub.js → Tr2VideoAdapterInfoStub.js} +16 -1
- package/dist/trinityal/stub/Tr2VideoAdapterInfoStub.js.map +1 -0
- package/dist/trinityal/stub/index.js +8 -4
- package/dist/trinityal/stub/index.js.map +1 -1
- package/dist/trinityal/vertexLayoutMatch.js +2 -2
- package/dist/trinityal/vertexLayoutMatch.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js +105 -90
- package/dist/trinityal/webgpu/CjsWebgpuBufferAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js +17 -0
- package/dist/trinityal/webgpu/CjsWebgpuCapsAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js +15 -0
- package/dist/trinityal/webgpu/CjsWebgpuConstantBufferAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js +2 -2
- package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +900 -938
- package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js +56 -60
- package/dist/trinityal/webgpu/CjsWebgpuResourceSetAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js +16 -1
- package/dist/trinityal/webgpu/CjsWebgpuSamplerStateAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js +100 -379
- package/dist/trinityal/webgpu/CjsWebgpuShaderAL.js.map +1 -1
- package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js +330 -0
- package/dist/trinityal/webgpu/CjsWebgpuShaderProgramAL.js.map +1 -0
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +15 -0
- package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
- package/dist/trinityal/webgpu/core/{constantArena.js → CjsWebgpuConstantArena.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuConstantArena.js.map +1 -0
- package/dist/trinityal/webgpu/core/{batchGroups.js → CjsWebgpuEncodeState.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuEncodeState.js.map +1 -0
- package/dist/trinityal/webgpu/core/{perFrameSource.js → CjsWebgpuPerFrameSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuPerFrameSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{pipelineCache.js → CjsWebgpuPipelineCache.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuPipelineCache.js.map +1 -0
- package/dist/trinityal/webgpu/core/{psoDescription.js → CjsWebgpuPsoDescription.js} +2 -2
- package/dist/trinityal/webgpu/core/CjsWebgpuPsoDescription.js.map +1 -0
- package/dist/trinityal/webgpu/core/{renderTarget.js → CjsWebgpuRenderTarget.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuRenderTarget.js.map +1 -0
- package/dist/trinityal/webgpu/core/{samplerSource.js → CjsWebgpuSamplerSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuSamplerSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{textureSource.js → CjsWebgpuTextureSource.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuTextureSource.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityBatchDispatcher.js → CjsWebgpuTrinityBatchDispatcher.js} +4 -4
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchDispatcher.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityBatchResolver.js → CjsWebgpuTrinityBatchResolver.js} +81 -81
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityBatchResolver.js.map +1 -0
- package/dist/trinityal/webgpu/core/{trinityPassEncoder.js → CjsWebgpuTrinityPassEncoder.js} +2 -2
- package/dist/trinityal/webgpu/core/CjsWebgpuTrinityPassEncoder.js.map +1 -0
- package/dist/trinityal/webgpu/core/{workQueue.js → CjsWebgpuWorkQueue.js} +1 -1
- package/dist/trinityal/webgpu/core/CjsWebgpuWorkQueue.js.map +1 -0
- package/dist/trinityal/webgpu/internal.js +12 -11
- package/dist/trinityal/webgpu/internal.js.map +1 -1
- package/docs/audio/reference/classes/trinity.md +44 -34
- package/docs/character/architecture.md +276 -0
- package/docs/character/reference/character-appearance-plans.md +30 -66
- package/docs/character/reference/prepared-libraries.md +14 -30
- package/docs/global/reference/api.md +2 -1
- package/docs/global/reference/classes/README.md +53 -71
- package/docs/global/reference/classes/dropped.md +16 -0
- package/docs/resource/README.md +19 -15
- package/docs/resource/architecture.md +9 -2
- package/docs/resource/concepts/format-capabilities.md +124 -80
- package/docs/resource/concepts/shared-format-helpers.md +94 -0
- package/docs/resource/formats/README.md +230 -224
- package/docs/resource/formats/bitknit2.md +221 -0
- package/docs/resource/formats/carbon-effect-container.md +184 -269
- package/docs/resource/formats/gr2.md +6 -1
- package/docs/resource/formats/schemabound.md +28 -48
- package/docs/resource/formats/static.md +70 -97
- package/docs/resource/formats/webgl/carbon-constant-layouts.md +8 -8
- package/docs/resource/formats/webgl/decl-io.md +165 -256
- package/docs/resource/formats/webgl/memory-structured.md +64 -142
- package/docs/resource/formats/webgl/texture-sample.md +109 -138
- package/docs/resource/formats/webgpu/formats/carbon-webgpu.md +38 -69
- package/docs/resource/formats/webgpu/guides/effect-packaging.md +54 -116
- package/docs/resource/formats/webgpu/reference/api.md +64 -67
- package/docs/resource/formats/webgpu/reference/wgsl-compatibility.md +104 -260
- package/docs/resource/reference/classes/core.md +256 -236
- package/docs/resource/reference/classes/formats.md +1668 -1672
- package/docs/resource/reference/workers.md +4 -2
- package/docs/sof/reference/classes/core.md +1 -1
- package/docs/sof/reference/classes/faction.md +2 -2
- package/docs/sof/reference/classes/generic.md +4 -4
- package/docs/sof/reference/classes/pattern.md +1 -1
- package/docs/sof/reference/classes/shared.md +10 -10
- package/docs/trinity/architecture.md +55 -44
- package/docs/trinity/concepts/generated-class-lifecycle.md +10 -15
- package/docs/trinity/reference/classes/curves-and-utilities.md +496 -506
- package/docs/trinity/reference/classes/dropped.md +0 -189
- package/docs/trinity/reference/classes/eve-runtime.md +8 -8
- package/docs/trinity/reference/classes/generated.md +0 -10
- package/docs/trinity/reference/classes/particle.md +2 -2
- package/docs/trinity/reference/classes/trinity-core.md +1554 -1256
- package/docs/trinity/reference/implementation-status.md +50 -75
- package/docs/trinity/reference/main-semantic-extraction.md +13 -17
- package/docs/trinityal/reference/classes/README.md +77 -27
- package/docs/trinityal/reference/classes/dropped.md +82 -0
- package/docs/trinityal/webgpu/README.md +3 -1
- package/docs/trinityal/webgpu/architecture.md +121 -228
- package/docs/trinityal/webgpu/reference/api.md +5 -5
- package/docs/trinityal/webgpu/reference/classes/README.md +13 -13
- package/format-notices/gr2/NOTICE +18 -12
- package/format-notices/gr2/THIRD-PARTY-NOTICES.md +5 -5
- package/package.json +4 -1
- package/dist/audio/trinity/audio/AudActionLog.js +0 -173
- package/dist/audio/trinity/audio/AudActionLog.js.map +0 -1
- package/dist/audio/trinity/audio/AudObstructionOcclusion.js.map +0 -1
- package/dist/global/contracts/CjsScriptCallback.js +0 -94
- package/dist/global/contracts/CjsScriptCallback.js.map +0 -1
- package/dist/trinity/controllers/ITr2Controller.js.map +0 -1
- package/dist/trinity/core/Tr2GpuResourcePool.js.map +0 -1
- package/dist/trinity/core/Tr2QuadRenderer.js.map +0 -1
- package/dist/trinity/core/Tr2TextureArray.js.map +0 -1
- package/dist/trinity/core/batch/ITriRenderBatchAccumulator.js.map +0 -1
- package/dist/trinity/core/batch/Tr2RenderBatch.js.map +0 -1
- package/dist/trinity/core/batch/TriRenderBatchAccumulator.js.map +0 -1
- package/dist/trinity/core/context/CjsShadowMapExecutor.js +0 -43
- package/dist/trinity/core/context/CjsShadowMapExecutor.js.map +0 -1
- package/dist/trinity/core/context/CjsVolumetricsExecutor.js +0 -64
- package/dist/trinity/core/context/CjsVolumetricsExecutor.js.map +0 -1
- package/dist/trinity/core/context/Tr2VisibilityResults.js +0 -109
- package/dist/trinity/core/context/Tr2VisibilityResults.js.map +0 -1
- package/dist/trinity/core/device/Tr2RingBuffer.js.map +0 -1
- package/dist/trinity/core/device/Tr2SuballocatedBuffer.js.map +0 -1
- package/dist/trinity/core/mesh/ITr2ImpostorSource.js.map +0 -1
- package/dist/trinity/core/mesh/ITr2InstanceData.js.map +0 -1
- package/dist/trinity/core/rawData/Tr2PerObjectData.js.map +0 -1
- package/dist/trinity/core/rawData/constantLayout.js +0 -175
- package/dist/trinity/core/rawData/constantLayout.js.map +0 -1
- package/dist/trinity/core/vertex/Tr2VertexDefinition.js.map +0 -1
- package/dist/trinity/eve/child/EveChildInstancedMeshes.js.map +0 -1
- package/dist/trinity/eve/child/EveChildPartData.js.map +0 -1
- package/dist/trinity/generated/trinityCore/Tr2Denoiser.js +0 -47
- package/dist/trinity/generated/trinityCore/Tr2Denoiser.js.map +0 -1
- package/dist/trinity/particle/ITr2GenericEmitter.js.map +0 -1
- package/dist/trinityal/Tr2DeviceResourceAL.js.map +0 -1
- package/dist/trinityal/Tr2HalHelperStructures.js.map +0 -1
- package/dist/trinityal/Tr2RenderPassAL.js.map +0 -1
- package/dist/trinityal/Tr2ResourceSetAL.js +0 -419
- package/dist/trinityal/Tr2ResourceSetAL.js.map +0 -1
- package/dist/trinityal/Tr2SamplerDescription.js +0 -72
- package/dist/trinityal/Tr2SamplerDescription.js.map +0 -1
- package/dist/trinityal/stub/Tr2QueryALStub.js +0 -326
- package/dist/trinityal/stub/Tr2QueryALStub.js.map +0 -1
- package/dist/trinityal/stub/Tr2RenderContextALStub.js.map +0 -1
- package/dist/trinityal/stub/Tr2VideoAdapterInfoALStub.js.map +0 -1
- package/dist/trinityal/webgpu/core/batchGroups.js.map +0 -1
- package/dist/trinityal/webgpu/core/constantArena.js.map +0 -1
- package/dist/trinityal/webgpu/core/perFrameSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/pipelineCache.js.map +0 -1
- package/dist/trinityal/webgpu/core/psoDescription.js.map +0 -1
- package/dist/trinityal/webgpu/core/renderTarget.js.map +0 -1
- package/dist/trinityal/webgpu/core/samplerSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/textureSource.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityBatchDispatcher.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityBatchResolver.js.map +0 -1
- package/dist/trinityal/webgpu/core/trinityPassEncoder.js.map +0 -1
- package/dist/trinityal/webgpu/core/workQueue.js.map +0 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { CjsControllerExpressionParser } from './CjsControllerExpressionParser.js';
|
|
2
|
+
import { EvaluateNode, ToBoolean, IsFunctionPure, HasFunction, ToNumber, HasProperty } from './expressionRuntime.js';
|
|
3
|
+
|
|
1
4
|
// Source: parser/include/ccpparser.h (CcpParser::Parse, Program, Observer)
|
|
2
5
|
// Behavioral reference: ccpwgl/src/unsupported/state/expression/Tr2ExpressionProgram.js
|
|
3
6
|
//
|
|
@@ -19,16 +22,6 @@
|
|
|
19
22
|
// and no Tr2ExpressionProgram runtime class. That is true of trinity/ and
|
|
20
23
|
// false of Carbon: CcpParser lives in the parser repo. It was read as evidence
|
|
21
24
|
// of invention during the 2026-09-04 fidelity audit. Carbon is 32 repositories.
|
|
22
|
-
|
|
23
|
-
const BLOCKED_IDENTIFIERS = new Set(["__proto__", "prototype", "constructor", "Function", "eval", "process", "global", "globalThis", "window", "document", "this"]);
|
|
24
|
-
const CONSTANTS = {
|
|
25
|
-
true: 1,
|
|
26
|
-
false: 0,
|
|
27
|
-
pi: Math.PI,
|
|
28
|
-
pi2: Math.PI * 2,
|
|
29
|
-
_pi: Math.PI,
|
|
30
|
-
_e: Math.E
|
|
31
|
-
};
|
|
32
25
|
const CONTROLLER_EXPRESSION_TERMS = [["Controller", "StateTime", "time in seconds the current state is running"], ["Controller", "AnimationTime", "geometry animation duration for the given name"], ["Controller", "CurveSetTime", "duration in seconds of the named curve set"], ["Controller", "GetExternalControllerVariable", "external controller variable lookup"], ["Controller", "IsAnimationPlaying", "returns 1 if the named animation layer is playing"], ["Controller", "ShipSpeed", "owning ship speed"], ["Controller", "ShipMaxSpeed", "owning ship maximum speed"], ["Controller", "ShipBoosterIntensity", "owning ship booster intensity"], ["Controller", "Random", "random integer from min to max - 1"], ["Controller", "KillCount", "owning ship kill count"], ["Controller", "BoundingSphereRadius", "owning object's bounding sphere radius"], ["GraphicSettings", "ShaderQuality", "user shader quality setting"], ["DateTime", "IsWeekend", "returns 1 on Saturday or Sunday"], ["DateTime", "ServerYear", "current server year"], ["DateTime", "ServerMonth", "current server month"], ["DateTime", "ServerDay", "current server day of month"], ["DateTime", "ServerDayOfWeek", "current server day of week"], ["DateTime", "ServerHour", "current server hour"], ["DateTime", "ServerMinute", "current server minute"], ["DateTime", "ServerSecond", "current server second"], ["DateTime", "ServerTimePhase", "seconds phase in a server-time period"], ["DateTime", "ServerTimeGreaterThan", "server-time comparison"], ["DateTime", "ServerTimeLessThanOrEqual", "server-time comparison"], ["DateTime", "ServerTimeEqual", "server-time equality comparison"], ["DateTime", "DaysSinceServerTime", "days since the supplied server date"]].map(([group, name, description]) => ({
|
|
33
26
|
group,
|
|
34
27
|
name,
|
|
@@ -44,7 +37,6 @@ const CURVE_EXPRESSION_TERMS = [["Random", "fractal", "function", "x, alpha, bet
|
|
|
44
37
|
} : {}),
|
|
45
38
|
description
|
|
46
39
|
}));
|
|
47
|
-
|
|
48
40
|
/**
|
|
49
41
|
* Compiles a Carbon controller or curve expression into an AST and evaluates it
|
|
50
42
|
* without dynamic JavaScript eval, exposing the referenced variable and function
|
|
@@ -276,1005 +268,6 @@ class CjsControllerExpressionProgram {
|
|
|
276
268
|
* names and rejecting identifiers that could reach the JavaScript prototype
|
|
277
269
|
* chain.
|
|
278
270
|
*/
|
|
279
|
-
class CjsControllerExpressionParser {
|
|
280
|
-
source;
|
|
281
|
-
options;
|
|
282
|
-
tokens;
|
|
283
|
-
index = 0;
|
|
284
|
-
variableNames = new Set();
|
|
285
|
-
functionNames = new Set();
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Tokenizes the source up front; a malformed character or unterminated string
|
|
289
|
-
* throws a CjsControllerExpressionCompileError here rather than during Parse.
|
|
290
|
-
*/
|
|
291
|
-
constructor(source, options) {
|
|
292
|
-
this.source = source;
|
|
293
|
-
this.options = options || {};
|
|
294
|
-
this.tokens = Tokenize(source);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
* Parses the whole source as a single expression and requires that all input
|
|
299
|
-
* is consumed.
|
|
300
|
-
*/
|
|
301
|
-
Parse() {
|
|
302
|
-
const expression = this.ParseConditional();
|
|
303
|
-
this.Expect("eof");
|
|
304
|
-
return expression;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
/**
|
|
308
|
-
* Parses the ternary `cond ? a : b` level, which is right-associative and the
|
|
309
|
-
* lowest-precedence form.
|
|
310
|
-
*/
|
|
311
|
-
ParseConditional() {
|
|
312
|
-
const condition = this.ParseLogicalOr();
|
|
313
|
-
if (this.Match("operator", "?")) {
|
|
314
|
-
const consequent = this.ParseConditional();
|
|
315
|
-
this.Expect("operator", ":");
|
|
316
|
-
const alternate = this.ParseConditional();
|
|
317
|
-
return {
|
|
318
|
-
type: "conditional",
|
|
319
|
-
condition,
|
|
320
|
-
consequent,
|
|
321
|
-
alternate
|
|
322
|
-
};
|
|
323
|
-
}
|
|
324
|
-
return condition;
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/** Parses left-associative `||` chains. */
|
|
328
|
-
ParseLogicalOr() {
|
|
329
|
-
let node = this.ParseLogicalAnd();
|
|
330
|
-
while (this.Match("operator", "||")) {
|
|
331
|
-
node = {
|
|
332
|
-
type: "binary",
|
|
333
|
-
operator: "||",
|
|
334
|
-
left: node,
|
|
335
|
-
right: this.ParseLogicalAnd()
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
return node;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/** Parses left-associative `&&` chains, which bind tighter than `||`. */
|
|
342
|
-
ParseLogicalAnd() {
|
|
343
|
-
let node = this.ParseEquality();
|
|
344
|
-
while (this.Match("operator", "&&")) {
|
|
345
|
-
node = {
|
|
346
|
-
type: "binary",
|
|
347
|
-
operator: "&&",
|
|
348
|
-
left: node,
|
|
349
|
-
right: this.ParseEquality()
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
return node;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
/** Parses left-associative `==` and `!=` chains. */
|
|
356
|
-
ParseEquality() {
|
|
357
|
-
let node = this.ParseComparison();
|
|
358
|
-
while (true) {
|
|
359
|
-
if (this.Match("operator", "==")) {
|
|
360
|
-
node = {
|
|
361
|
-
type: "binary",
|
|
362
|
-
operator: "==",
|
|
363
|
-
left: node,
|
|
364
|
-
right: this.ParseComparison()
|
|
365
|
-
};
|
|
366
|
-
} else if (this.Match("operator", "!=")) {
|
|
367
|
-
node = {
|
|
368
|
-
type: "binary",
|
|
369
|
-
operator: "!=",
|
|
370
|
-
left: node,
|
|
371
|
-
right: this.ParseComparison()
|
|
372
|
-
};
|
|
373
|
-
} else {
|
|
374
|
-
return node;
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
/**
|
|
380
|
-
* Parses left-associative `<`, `<=`, `>` and `>=` chains, which bind tighter
|
|
381
|
-
* than equality.
|
|
382
|
-
*/
|
|
383
|
-
ParseComparison() {
|
|
384
|
-
let node = this.ParseTerm();
|
|
385
|
-
while (true) {
|
|
386
|
-
if (this.Match("operator", "<")) {
|
|
387
|
-
node = {
|
|
388
|
-
type: "binary",
|
|
389
|
-
operator: "<",
|
|
390
|
-
left: node,
|
|
391
|
-
right: this.ParseTerm()
|
|
392
|
-
};
|
|
393
|
-
} else if (this.Match("operator", "<=")) {
|
|
394
|
-
node = {
|
|
395
|
-
type: "binary",
|
|
396
|
-
operator: "<=",
|
|
397
|
-
left: node,
|
|
398
|
-
right: this.ParseTerm()
|
|
399
|
-
};
|
|
400
|
-
} else if (this.Match("operator", ">")) {
|
|
401
|
-
node = {
|
|
402
|
-
type: "binary",
|
|
403
|
-
operator: ">",
|
|
404
|
-
left: node,
|
|
405
|
-
right: this.ParseTerm()
|
|
406
|
-
};
|
|
407
|
-
} else if (this.Match("operator", ">=")) {
|
|
408
|
-
node = {
|
|
409
|
-
type: "binary",
|
|
410
|
-
operator: ">=",
|
|
411
|
-
left: node,
|
|
412
|
-
right: this.ParseTerm()
|
|
413
|
-
};
|
|
414
|
-
} else {
|
|
415
|
-
return node;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
/** Parses left-associative `+` and `-` chains. */
|
|
421
|
-
ParseTerm() {
|
|
422
|
-
let node = this.ParseFactor();
|
|
423
|
-
while (true) {
|
|
424
|
-
if (this.Match("operator", "+")) {
|
|
425
|
-
node = {
|
|
426
|
-
type: "binary",
|
|
427
|
-
operator: "+",
|
|
428
|
-
left: node,
|
|
429
|
-
right: this.ParseFactor()
|
|
430
|
-
};
|
|
431
|
-
} else if (this.Match("operator", "-")) {
|
|
432
|
-
node = {
|
|
433
|
-
type: "binary",
|
|
434
|
-
operator: "-",
|
|
435
|
-
left: node,
|
|
436
|
-
right: this.ParseFactor()
|
|
437
|
-
};
|
|
438
|
-
} else {
|
|
439
|
-
return node;
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* Parses left-associative `*`, `/` and `%` chains, which bind tighter than
|
|
446
|
-
* addition.
|
|
447
|
-
*/
|
|
448
|
-
ParseFactor() {
|
|
449
|
-
let node = this.ParseExponent();
|
|
450
|
-
while (true) {
|
|
451
|
-
if (this.Match("operator", "*")) {
|
|
452
|
-
node = {
|
|
453
|
-
type: "binary",
|
|
454
|
-
operator: "*",
|
|
455
|
-
left: node,
|
|
456
|
-
right: this.ParseExponent()
|
|
457
|
-
};
|
|
458
|
-
} else if (this.Match("operator", "/")) {
|
|
459
|
-
node = {
|
|
460
|
-
type: "binary",
|
|
461
|
-
operator: "/",
|
|
462
|
-
left: node,
|
|
463
|
-
right: this.ParseExponent()
|
|
464
|
-
};
|
|
465
|
-
} else if (this.Match("operator", "%")) {
|
|
466
|
-
node = {
|
|
467
|
-
type: "binary",
|
|
468
|
-
operator: "%",
|
|
469
|
-
left: node,
|
|
470
|
-
right: this.ParseExponent()
|
|
471
|
-
};
|
|
472
|
-
} else {
|
|
473
|
-
return node;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* Parses `^` power chains; unlike most languages this level is
|
|
480
|
-
* left-associative here.
|
|
481
|
-
*/
|
|
482
|
-
ParseExponent() {
|
|
483
|
-
let node = this.ParseUnary();
|
|
484
|
-
while (this.Match("operator", "^")) {
|
|
485
|
-
node = {
|
|
486
|
-
type: "binary",
|
|
487
|
-
operator: "^",
|
|
488
|
-
left: node,
|
|
489
|
-
right: this.ParseUnary()
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
return node;
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Parses right-nested prefix `!`, `-` and `+` operators, falling through to a
|
|
497
|
-
* primary when none is present.
|
|
498
|
-
*/
|
|
499
|
-
ParseUnary() {
|
|
500
|
-
if (this.Match("operator", "!")) {
|
|
501
|
-
return {
|
|
502
|
-
type: "unary",
|
|
503
|
-
operator: "!",
|
|
504
|
-
argument: this.ParseUnary()
|
|
505
|
-
};
|
|
506
|
-
}
|
|
507
|
-
if (this.Match("operator", "-")) {
|
|
508
|
-
return {
|
|
509
|
-
type: "unary",
|
|
510
|
-
operator: "-",
|
|
511
|
-
argument: this.ParseUnary()
|
|
512
|
-
};
|
|
513
|
-
}
|
|
514
|
-
if (this.Match("operator", "+")) {
|
|
515
|
-
return {
|
|
516
|
-
type: "unary",
|
|
517
|
-
operator: "+",
|
|
518
|
-
argument: this.ParseUnary()
|
|
519
|
-
};
|
|
520
|
-
}
|
|
521
|
-
return this.ParsePrimary();
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Parses a number, string, parenthesized expression, function call, built-in
|
|
526
|
-
* constant, or a variable identifier, recording bare identifiers in
|
|
527
|
-
* `variableNames`.
|
|
528
|
-
*/
|
|
529
|
-
ParsePrimary() {
|
|
530
|
-
const token = this.Peek();
|
|
531
|
-
if (this.Match("number")) {
|
|
532
|
-
return {
|
|
533
|
-
type: "literal",
|
|
534
|
-
value: token.value
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
if (this.Match("string")) {
|
|
538
|
-
return {
|
|
539
|
-
type: "literal",
|
|
540
|
-
value: token.value
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
if (this.Match("identifier")) {
|
|
544
|
-
const name = String(token.value);
|
|
545
|
-
this.AssertSafeIdentifier(name);
|
|
546
|
-
if (this.Match("operator", "(")) {
|
|
547
|
-
return this.ParseCall(name);
|
|
548
|
-
}
|
|
549
|
-
if (name in CONSTANTS) {
|
|
550
|
-
return {
|
|
551
|
-
type: "literal",
|
|
552
|
-
value: CONSTANTS[name]
|
|
553
|
-
};
|
|
554
|
-
}
|
|
555
|
-
this.variableNames.add(name);
|
|
556
|
-
return {
|
|
557
|
-
type: "identifier",
|
|
558
|
-
name
|
|
559
|
-
};
|
|
560
|
-
}
|
|
561
|
-
if (this.Match("operator", "(")) {
|
|
562
|
-
const node = this.ParseConditional();
|
|
563
|
-
this.Expect("operator", ")");
|
|
564
|
-
return node;
|
|
565
|
-
}
|
|
566
|
-
throw this.Error(`Unexpected token '${String(token.value)}'`);
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Parses a call argument list after the opening parenthesis and fails
|
|
571
|
-
* compilation when the name resolves to no built-in or caller-supplied
|
|
572
|
-
* function, so unknown functions cannot reach evaluation.
|
|
573
|
-
*/
|
|
574
|
-
ParseCall(name) {
|
|
575
|
-
this.AssertSafeIdentifier(name);
|
|
576
|
-
if (!GetFunction(name, this.options)) {
|
|
577
|
-
throw this.Error(`Unknown function '${name}'`);
|
|
578
|
-
}
|
|
579
|
-
const args = [];
|
|
580
|
-
if (!this.Match("operator", ")")) {
|
|
581
|
-
do {
|
|
582
|
-
args.push(this.ParseConditional());
|
|
583
|
-
} while (this.Match("operator", ","));
|
|
584
|
-
this.Expect("operator", ")");
|
|
585
|
-
}
|
|
586
|
-
this.functionNames.add(name);
|
|
587
|
-
return {
|
|
588
|
-
type: "call",
|
|
589
|
-
name,
|
|
590
|
-
args
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Rejects identifiers such as `__proto__`, `constructor` and `globalThis` that
|
|
596
|
-
* could be used to escape the sandboxed evaluator.
|
|
597
|
-
*/
|
|
598
|
-
AssertSafeIdentifier(name) {
|
|
599
|
-
if (BLOCKED_IDENTIFIERS.has(name)) {
|
|
600
|
-
throw this.Error(`Unsafe identifier '${name}'`);
|
|
601
|
-
}
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* Returns the token at the cursor without consuming it; the stream always ends
|
|
606
|
-
* with an `eof` token.
|
|
607
|
-
*/
|
|
608
|
-
Peek() {
|
|
609
|
-
return this.tokens[this.index];
|
|
610
|
-
}
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Consumes the next token and returns true when it has the given type and, if
|
|
614
|
-
* supplied, the given value; otherwise leaves the cursor untouched.
|
|
615
|
-
*/
|
|
616
|
-
Match(type, value) {
|
|
617
|
-
const token = this.Peek();
|
|
618
|
-
if (!token || token.type !== type) {
|
|
619
|
-
return false;
|
|
620
|
-
}
|
|
621
|
-
if (value !== undefined && token.value !== value) {
|
|
622
|
-
return false;
|
|
623
|
-
}
|
|
624
|
-
this.index++;
|
|
625
|
-
return true;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* Consumes and returns the next token, throwing a compile error naming the
|
|
630
|
-
* expected form when it does not match.
|
|
631
|
-
*/
|
|
632
|
-
Expect(type, value) {
|
|
633
|
-
const token = this.Peek();
|
|
634
|
-
if (this.Match(type, value)) {
|
|
635
|
-
return token;
|
|
636
|
-
}
|
|
637
|
-
throw this.Error(`Expected ${value || type}, got '${token ? String(token.value) : "end of input"}'`);
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
/**
|
|
641
|
-
* Builds a compile error carrying the source text and the character position
|
|
642
|
-
* of the current token.
|
|
643
|
-
*/
|
|
644
|
-
Error(message) {
|
|
645
|
-
const token = this.Peek();
|
|
646
|
-
return new CjsControllerExpressionCompileError({
|
|
647
|
-
expression: this.source,
|
|
648
|
-
reason: message,
|
|
649
|
-
position: token ? token.position : this.source.length
|
|
650
|
-
});
|
|
651
|
-
}
|
|
652
|
-
}
|
|
653
|
-
function Tokenize(source) {
|
|
654
|
-
const tokens = [];
|
|
655
|
-
let i = 0;
|
|
656
|
-
while (i < source.length) {
|
|
657
|
-
const c = source[i];
|
|
658
|
-
if (/\s/.test(c)) {
|
|
659
|
-
i++;
|
|
660
|
-
continue;
|
|
661
|
-
}
|
|
662
|
-
if (IsDigit(c) || c === "." && IsDigit(source[i + 1])) {
|
|
663
|
-
const start = i;
|
|
664
|
-
i = ReadNumber(source, i);
|
|
665
|
-
tokens.push({
|
|
666
|
-
type: "number",
|
|
667
|
-
value: Number(source.slice(start, i)),
|
|
668
|
-
position: start
|
|
669
|
-
});
|
|
670
|
-
continue;
|
|
671
|
-
}
|
|
672
|
-
if (c === '"' || c === "'") {
|
|
673
|
-
const start = i;
|
|
674
|
-
const result = ReadString(source, i);
|
|
675
|
-
i = result.end;
|
|
676
|
-
tokens.push({
|
|
677
|
-
type: "string",
|
|
678
|
-
value: result.value,
|
|
679
|
-
position: start
|
|
680
|
-
});
|
|
681
|
-
continue;
|
|
682
|
-
}
|
|
683
|
-
if (IsIdentifierStart(c)) {
|
|
684
|
-
const start = i;
|
|
685
|
-
i++;
|
|
686
|
-
while (IsIdentifierPart(source[i])) {
|
|
687
|
-
i++;
|
|
688
|
-
}
|
|
689
|
-
tokens.push({
|
|
690
|
-
type: "identifier",
|
|
691
|
-
value: source.slice(start, i),
|
|
692
|
-
position: start
|
|
693
|
-
});
|
|
694
|
-
continue;
|
|
695
|
-
}
|
|
696
|
-
const two = source.slice(i, i + 2);
|
|
697
|
-
if (two === "&&" || two === "||" || two === "<=" || two === ">=" || two === "==" || two === "!=") {
|
|
698
|
-
tokens.push({
|
|
699
|
-
type: "operator",
|
|
700
|
-
value: two,
|
|
701
|
-
position: i
|
|
702
|
-
});
|
|
703
|
-
i += 2;
|
|
704
|
-
continue;
|
|
705
|
-
}
|
|
706
|
-
if ("+-*/%^<>()!,?:".includes(c)) {
|
|
707
|
-
tokens.push({
|
|
708
|
-
type: "operator",
|
|
709
|
-
value: c,
|
|
710
|
-
position: i
|
|
711
|
-
});
|
|
712
|
-
i++;
|
|
713
|
-
continue;
|
|
714
|
-
}
|
|
715
|
-
throw new CjsControllerExpressionCompileError({
|
|
716
|
-
expression: source,
|
|
717
|
-
reason: `Unexpected character '${c}'`,
|
|
718
|
-
position: i
|
|
719
|
-
});
|
|
720
|
-
}
|
|
721
|
-
tokens.push({
|
|
722
|
-
type: "eof",
|
|
723
|
-
value: "",
|
|
724
|
-
position: source.length
|
|
725
|
-
});
|
|
726
|
-
return tokens;
|
|
727
|
-
}
|
|
728
|
-
function ReadNumber(source, index) {
|
|
729
|
-
let i = index;
|
|
730
|
-
while (IsDigit(source[i])) {
|
|
731
|
-
i++;
|
|
732
|
-
}
|
|
733
|
-
if (source[i] === ".") {
|
|
734
|
-
i++;
|
|
735
|
-
while (IsDigit(source[i])) {
|
|
736
|
-
i++;
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
if (source[i] === "e" || source[i] === "E") {
|
|
740
|
-
const exp = i;
|
|
741
|
-
i++;
|
|
742
|
-
if (source[i] === "+" || source[i] === "-") {
|
|
743
|
-
i++;
|
|
744
|
-
}
|
|
745
|
-
const digits = i;
|
|
746
|
-
while (IsDigit(source[i])) {
|
|
747
|
-
i++;
|
|
748
|
-
}
|
|
749
|
-
if (digits === i) {
|
|
750
|
-
return exp;
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
return i;
|
|
754
|
-
}
|
|
755
|
-
function ReadString(source, index) {
|
|
756
|
-
const quote = source[index];
|
|
757
|
-
let value = "";
|
|
758
|
-
let i = index + 1;
|
|
759
|
-
while (i < source.length) {
|
|
760
|
-
const c = source[i++];
|
|
761
|
-
if (c === quote) {
|
|
762
|
-
return {
|
|
763
|
-
value,
|
|
764
|
-
end: i
|
|
765
|
-
};
|
|
766
|
-
}
|
|
767
|
-
if (c === "\\") {
|
|
768
|
-
const n = source[i++];
|
|
769
|
-
switch (n) {
|
|
770
|
-
case "n":
|
|
771
|
-
value += "\n";
|
|
772
|
-
break;
|
|
773
|
-
case "r":
|
|
774
|
-
value += "\r";
|
|
775
|
-
break;
|
|
776
|
-
case "t":
|
|
777
|
-
value += "\t";
|
|
778
|
-
break;
|
|
779
|
-
default:
|
|
780
|
-
value += n;
|
|
781
|
-
break;
|
|
782
|
-
}
|
|
783
|
-
} else {
|
|
784
|
-
value += c;
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
throw new CjsControllerExpressionCompileError({
|
|
788
|
-
expression: source,
|
|
789
|
-
reason: "Unterminated string",
|
|
790
|
-
position: index
|
|
791
|
-
});
|
|
792
|
-
}
|
|
793
|
-
function EvaluateNode(node, context, program) {
|
|
794
|
-
switch (node.type) {
|
|
795
|
-
case "literal":
|
|
796
|
-
return node.value;
|
|
797
|
-
case "identifier":
|
|
798
|
-
return ResolveIdentifier(node.name, context);
|
|
799
|
-
case "unary":
|
|
800
|
-
return EvaluateUnary(node.operator, EvaluateNode(node.argument, context, program));
|
|
801
|
-
case "binary":
|
|
802
|
-
return EvaluateBinary(node.operator, node.left, node.right, context, program);
|
|
803
|
-
case "conditional":
|
|
804
|
-
return ToBoolean(EvaluateNode(node.condition, context, program)) ? EvaluateNode(node.consequent, context, program) : EvaluateNode(node.alternate, context, program);
|
|
805
|
-
case "call":
|
|
806
|
-
return EvaluateCall(node, context, program);
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
function EvaluateUnary(operator, value) {
|
|
810
|
-
switch (operator) {
|
|
811
|
-
case "!":
|
|
812
|
-
return ToBoolean(value) ? 0 : 1;
|
|
813
|
-
case "-":
|
|
814
|
-
return -ToNumber(value);
|
|
815
|
-
case "+":
|
|
816
|
-
return ToNumber(value);
|
|
817
|
-
default:
|
|
818
|
-
return 0;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
function EvaluateBinary(operator, leftNode, rightNode, context, program) {
|
|
822
|
-
if (operator === "&&") {
|
|
823
|
-
return ToBoolean(EvaluateNode(leftNode, context, program)) && ToBoolean(EvaluateNode(rightNode, context, program)) ? 1 : 0;
|
|
824
|
-
}
|
|
825
|
-
if (operator === "||") {
|
|
826
|
-
return ToBoolean(EvaluateNode(leftNode, context, program)) || ToBoolean(EvaluateNode(rightNode, context, program)) ? 1 : 0;
|
|
827
|
-
}
|
|
828
|
-
const left = EvaluateNode(leftNode, context, program);
|
|
829
|
-
const right = EvaluateNode(rightNode, context, program);
|
|
830
|
-
switch (operator) {
|
|
831
|
-
case "+":
|
|
832
|
-
return ToNumber(left) + ToNumber(right);
|
|
833
|
-
case "-":
|
|
834
|
-
return ToNumber(left) - ToNumber(right);
|
|
835
|
-
case "*":
|
|
836
|
-
return ToNumber(left) * ToNumber(right);
|
|
837
|
-
case "/":
|
|
838
|
-
return ToNumber(right) === 0 ? 0 : ToNumber(left) / ToNumber(right);
|
|
839
|
-
case "%":
|
|
840
|
-
return ToNumber(right) === 0 ? 0 : ToNumber(left) % ToNumber(right);
|
|
841
|
-
case "^":
|
|
842
|
-
return Math.pow(ToNumber(left), ToNumber(right));
|
|
843
|
-
case "<":
|
|
844
|
-
return ToNumber(left) < ToNumber(right) ? 1 : 0;
|
|
845
|
-
case "<=":
|
|
846
|
-
return ToNumber(left) <= ToNumber(right) ? 1 : 0;
|
|
847
|
-
case ">":
|
|
848
|
-
return ToNumber(left) > ToNumber(right) ? 1 : 0;
|
|
849
|
-
case ">=":
|
|
850
|
-
return ToNumber(left) >= ToNumber(right) ? 1 : 0;
|
|
851
|
-
case "==":
|
|
852
|
-
// Carbon's CcpParser numeric/string coercion is closer to loose JS here.
|
|
853
|
-
// deno-lint-ignore eqeqeq
|
|
854
|
-
return left == right ? 1 : 0;
|
|
855
|
-
case "!=":
|
|
856
|
-
// deno-lint-ignore eqeqeq
|
|
857
|
-
return left != right ? 1 : 0;
|
|
858
|
-
default:
|
|
859
|
-
return 0;
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
function EvaluateCall(node, context, program) {
|
|
863
|
-
const fn = GetFunction(node.name, program.options);
|
|
864
|
-
if (!fn) {
|
|
865
|
-
throw new CjsControllerExpressionEvaluateError({
|
|
866
|
-
expression: program.source,
|
|
867
|
-
reason: `Unknown function '${node.name}'`
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
const args = node.args.map(arg => EvaluateNode(arg, context, program));
|
|
871
|
-
return fn(context || {}, ...args);
|
|
872
|
-
}
|
|
873
|
-
function ResolveIdentifier(name, context = {}) {
|
|
874
|
-
if (name in CONSTANTS) {
|
|
875
|
-
return CONSTANTS[name];
|
|
876
|
-
}
|
|
877
|
-
if (context.variables) {
|
|
878
|
-
if (context.variables instanceof Map && context.variables.has(name)) {
|
|
879
|
-
return NormalizeValue(context.variables.get(name));
|
|
880
|
-
}
|
|
881
|
-
if (!(context.variables instanceof Map) && Object.prototype.hasOwnProperty.call(context.variables, name)) {
|
|
882
|
-
return NormalizeValue(context.variables[name]);
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
const value = context.controller?.GetVariableValue?.(name, undefined);
|
|
886
|
-
if (value !== undefined) {
|
|
887
|
-
return NormalizeValue(value);
|
|
888
|
-
}
|
|
889
|
-
if (Object.prototype.hasOwnProperty.call(context, name)) {
|
|
890
|
-
return NormalizeValue(context[name]);
|
|
891
|
-
}
|
|
892
|
-
return 0;
|
|
893
|
-
}
|
|
894
|
-
function GetFunction(name, options = {}) {
|
|
895
|
-
if (options.functions?.[name]) {
|
|
896
|
-
return options.functions[name];
|
|
897
|
-
}
|
|
898
|
-
return DEFAULT_FUNCTIONS[name] || null;
|
|
899
|
-
}
|
|
900
|
-
function IsFunctionPure(name, options = {}) {
|
|
901
|
-
if (options.functions?.[name]) {
|
|
902
|
-
const pureFunctions = options.pureFunctions;
|
|
903
|
-
return pureFunctions instanceof Set ? pureFunctions.has(name) : Array.isArray(pureFunctions) && pureFunctions.includes(name);
|
|
904
|
-
}
|
|
905
|
-
return PURE_DEFAULT_FUNCTIONS.has(name);
|
|
906
|
-
}
|
|
907
|
-
const PURE_DEFAULT_FUNCTIONS = new Set(["abs", "min", "max", "floor", "ceil", "round", "sqrt", "pow", "sin", "cos", "tan", "asin", "acos", "atan", "sinh", "cosh", "tanh", "asinh", "acosh", "atanh", "log2", "log10", "log", "ln", "exp", "sign", "rint", "sum", "avg", "clamp", "radians", "mod", "lerp"]);
|
|
908
|
-
const DEFAULT_FUNCTIONS = {
|
|
909
|
-
abs: (_ctx, x) => Math.abs(ToNumber(x)),
|
|
910
|
-
min: (_ctx, ...args) => Math.min(...args.map(ToNumber)),
|
|
911
|
-
max: (_ctx, ...args) => Math.max(...args.map(ToNumber)),
|
|
912
|
-
floor: (_ctx, x) => Math.floor(ToNumber(x)),
|
|
913
|
-
ceil: (_ctx, x) => Math.ceil(ToNumber(x)),
|
|
914
|
-
round: (_ctx, x) => Math.round(ToNumber(x)),
|
|
915
|
-
sqrt: (_ctx, x) => Math.sqrt(Math.max(0, ToNumber(x))),
|
|
916
|
-
pow: (_ctx, x, y) => Math.pow(ToNumber(x), ToNumber(y)),
|
|
917
|
-
sin: (_ctx, x) => Math.sin(ToNumber(x)),
|
|
918
|
-
cos: (_ctx, x) => Math.cos(ToNumber(x)),
|
|
919
|
-
tan: (_ctx, x) => Math.tan(ToNumber(x)),
|
|
920
|
-
asin: (_ctx, x) => Math.asin(ToNumber(x)),
|
|
921
|
-
acos: (_ctx, x) => Math.acos(ToNumber(x)),
|
|
922
|
-
atan: (_ctx, x) => Math.atan(ToNumber(x)),
|
|
923
|
-
sinh: (_ctx, x) => Math.sinh(ToNumber(x)),
|
|
924
|
-
cosh: (_ctx, x) => Math.cosh(ToNumber(x)),
|
|
925
|
-
tanh: (_ctx, x) => Math.tanh(ToNumber(x)),
|
|
926
|
-
asinh: (_ctx, x) => Math.asinh(ToNumber(x)),
|
|
927
|
-
acosh: (_ctx, x) => Math.acosh(ToNumber(x)),
|
|
928
|
-
atanh: (_ctx, x) => Math.atanh(ToNumber(x)),
|
|
929
|
-
log2: (_ctx, x) => Math.log2(ToNumber(x)),
|
|
930
|
-
log10: (_ctx, x) => Math.log10(ToNumber(x)),
|
|
931
|
-
log: (_ctx, x) => Math.log(ToNumber(x)),
|
|
932
|
-
ln: (_ctx, x) => Math.log(ToNumber(x)),
|
|
933
|
-
exp: (_ctx, x) => Math.exp(ToNumber(x)),
|
|
934
|
-
sign: (_ctx, x) => {
|
|
935
|
-
const value = ToNumber(x);
|
|
936
|
-
return value > 0 ? 1 : value < 0 ? -1 : 0;
|
|
937
|
-
},
|
|
938
|
-
rint: (_ctx, x) => RoundHalfToEven(ToNumber(x)),
|
|
939
|
-
sum: (_ctx, ...args) => SumValues(args),
|
|
940
|
-
avg: (_ctx, ...args) => args.length ? SumValues(args) / args.length : 0,
|
|
941
|
-
clamp: (_ctx, x, min, max) => Math.min(ToNumber(max), Math.max(ToNumber(min), ToNumber(x))),
|
|
942
|
-
radians: (_ctx, x) => ToNumber(x) * Math.PI / 180,
|
|
943
|
-
mod: (_ctx, x, y) => ToNumber(y) === 0 ? 0 : ToNumber(x) % ToNumber(y),
|
|
944
|
-
lerp: (_ctx, a, b, x) => ToNumber(a) * (1 - ToNumber(x)) + ToNumber(b) * ToNumber(x),
|
|
945
|
-
random: (_ctx, min = 0, max = 1) => ToNumber(min) + Math.random() * (ToNumber(max) - ToNumber(min)),
|
|
946
|
-
Random: (_ctx, min = 0, max = 1) => RandomInteger(min, max),
|
|
947
|
-
randomConstant: (ctx, min = 0, max = 1) => ToNumber(min) + GetRandomConstant(ctx) * (ToNumber(max) - ToNumber(min)),
|
|
948
|
-
randconst: (ctx, min = 0, max = 1) => DEFAULT_FUNCTIONS.randomConstant(ctx, min, max),
|
|
949
|
-
randhash: (_ctx, min = 0, max = 1, value = 0) => ToNumber(min) + Hash01(ToNumber(value)) * (ToNumber(max) - ToNumber(min)),
|
|
950
|
-
noise: (ctx, x) => Hash01(ToNumber(x) + GetRandomConstant(ctx)),
|
|
951
|
-
fractal: (ctx, x) => Hash01(ToNumber(x) + GetRandomConstant(ctx)),
|
|
952
|
-
input: (ctx, index) => GetInputValue(ctx, index),
|
|
953
|
-
inputAt: (ctx, index, time) => GetInputValue(ctx, index, time),
|
|
954
|
-
StateTime: ctx => ctx.stateMachine?.GetStateTime ? ctx.stateMachine.GetStateTime() : ToNumber(ctx.stateTime),
|
|
955
|
-
CurveSetTime: (ctx, name) => GetCurveSetTime(ctx, name),
|
|
956
|
-
AnimationTime: (ctx, name) => CallContextFunction(ctx, "AnimationTime", name),
|
|
957
|
-
IsAnimationPlaying: (ctx, name) => CallContextFunction(ctx, "IsAnimationPlaying", name),
|
|
958
|
-
GetExternalControllerVariable: (ctx, name, fallback = 0) => GetExternalControllerVariable(ctx, name, fallback),
|
|
959
|
-
ShipSpeed: ctx => CallContextFunction(ctx, "ShipSpeed"),
|
|
960
|
-
ShipMaxSpeed: ctx => CallContextFunction(ctx, "ShipMaxSpeed", undefined, 1),
|
|
961
|
-
ShipBoosterIntensity: ctx => CallContextFunction(ctx, "ShipBoosterIntensity"),
|
|
962
|
-
KillCount: ctx => CallContextFunction(ctx, "KillCount"),
|
|
963
|
-
BoundingSphereRadius: ctx => CallContextFunction(ctx, "BoundingSphereRadius"),
|
|
964
|
-
ShaderQuality: ctx => CallContextFunction(ctx, "ShaderQuality"),
|
|
965
|
-
IsWeekend: ctx => GetServerDatePart(ctx, "dayOfWeek") % 6 === 0 ? 1 : 0,
|
|
966
|
-
ServerYear: ctx => GetServerDatePart(ctx, "year"),
|
|
967
|
-
ServerMonth: ctx => GetServerDatePart(ctx, "month"),
|
|
968
|
-
ServerDay: ctx => GetServerDatePart(ctx, "day"),
|
|
969
|
-
ServerDayOfWeek: ctx => GetServerDatePart(ctx, "dayOfWeek"),
|
|
970
|
-
ServerHour: ctx => GetServerDatePart(ctx, "hour"),
|
|
971
|
-
ServerMinute: ctx => GetServerDatePart(ctx, "minute"),
|
|
972
|
-
ServerSecond: ctx => GetServerDatePart(ctx, "second"),
|
|
973
|
-
ServerTimePhase: (ctx, period) => GetServerTimePhase(ctx, period),
|
|
974
|
-
ServerTimeGreaterThan: (ctx, year, month, day, hour, minute, second) => ServerTimeComparison(ctx, [year, month, day, hour, minute, second], 1),
|
|
975
|
-
ServerTimeLessThanOrEqual: (ctx, year, month, day, hour, minute, second) => ServerTimeComparison(ctx, [year, month, day, hour, minute, second], -1),
|
|
976
|
-
ServerTimeEqual: (ctx, year, month, day, hour, minute, second) => ServerTimeComparison(ctx, [year, month, day, hour, minute, second], 0),
|
|
977
|
-
DaysSinceServerTime: (ctx, year, month, day) => DaysSinceServerTime(ctx, year, month, day)
|
|
978
|
-
};
|
|
979
|
-
function GetRandomConstant(context) {
|
|
980
|
-
const source = context.curve ?? context.self ?? context.expression;
|
|
981
|
-
if (HasFunction(source, "GetRandomConstant")) {
|
|
982
|
-
return ToNumber(source.GetRandomConstant());
|
|
983
|
-
}
|
|
984
|
-
if (HasProperty(source, "randomConstant")) {
|
|
985
|
-
return ToNumber(source.randomConstant);
|
|
986
|
-
}
|
|
987
|
-
return 0;
|
|
988
|
-
}
|
|
989
|
-
function GetInputValue(context, index, time) {
|
|
990
|
-
const source = context.curve ?? context.self ?? context.expression ?? context;
|
|
991
|
-
if (HasFunction(source, "GetInputValue")) {
|
|
992
|
-
return ToNumber(source.GetInputValue(RoundInputIndex(index), time));
|
|
993
|
-
}
|
|
994
|
-
const inputs = HasProperty(source, "inputs") ? source.inputs : context.inputs;
|
|
995
|
-
const input = Array.isArray(inputs) ? inputs[RoundInputIndex(index)] : null;
|
|
996
|
-
if (!input) {
|
|
997
|
-
return 0;
|
|
998
|
-
}
|
|
999
|
-
if (time !== undefined && HasFunction(input, "GetValueAt")) {
|
|
1000
|
-
return ToNumber(input.GetValueAt(ToNumber(time)));
|
|
1001
|
-
}
|
|
1002
|
-
if (HasFunction(input, "GetValueAt")) {
|
|
1003
|
-
return ToNumber(input.GetValueAt(ToNumber(context.time)));
|
|
1004
|
-
}
|
|
1005
|
-
if (HasProperty(input, "currentValue")) {
|
|
1006
|
-
return ToNumber(input.currentValue);
|
|
1007
|
-
}
|
|
1008
|
-
return ToNumber(input);
|
|
1009
|
-
}
|
|
1010
|
-
function RoundInputIndex(index) {
|
|
1011
|
-
return Math.trunc(ToNumber(index) + 0.5);
|
|
1012
|
-
}
|
|
1013
|
-
function GetCurveSetTime(context, name) {
|
|
1014
|
-
const owner = context.owner;
|
|
1015
|
-
if (owner) {
|
|
1016
|
-
if (HasFunction(owner, "GetRangeDuration") && typeof name === "string" && name.includes("/")) {
|
|
1017
|
-
const parts = name.split("/");
|
|
1018
|
-
return ToNumber(owner.GetRangeDuration(parts[0], parts.slice(1).join("/")));
|
|
1019
|
-
}
|
|
1020
|
-
if (HasFunction(owner, "GetCurveSetDuration")) {
|
|
1021
|
-
return ToNumber(owner.GetCurveSetDuration(name));
|
|
1022
|
-
}
|
|
1023
|
-
}
|
|
1024
|
-
return CallContextFunction(context, "CurveSetTime", name);
|
|
1025
|
-
}
|
|
1026
|
-
function GetExternalControllerVariable(context, name, fallback) {
|
|
1027
|
-
if (HasProperty(context, "externalControllerVariables") && context.externalControllerVariables && typeof context.externalControllerVariables === "object" && Object.prototype.hasOwnProperty.call(context.externalControllerVariables, String(name))) {
|
|
1028
|
-
return ToNumber(context.externalControllerVariables[String(name)]);
|
|
1029
|
-
}
|
|
1030
|
-
if (HasFunction(context.owner, "GetControllerValueByName")) {
|
|
1031
|
-
const value = context.owner.GetControllerValueByName(name);
|
|
1032
|
-
return value === undefined || value === null ? ToNumber(fallback) : ToNumber(value);
|
|
1033
|
-
}
|
|
1034
|
-
return ToNumber(fallback);
|
|
1035
|
-
}
|
|
1036
|
-
function RandomInteger(min, max) {
|
|
1037
|
-
const minValue = ToNumber(min);
|
|
1038
|
-
const span = Math.trunc(ToNumber(max) - minValue);
|
|
1039
|
-
if (span <= 0) {
|
|
1040
|
-
return minValue;
|
|
1041
|
-
}
|
|
1042
|
-
return minValue + Math.floor(Math.random() * span);
|
|
1043
|
-
}
|
|
1044
|
-
function GetServerDatePart(context, part) {
|
|
1045
|
-
const override = TryCallContextFunction(context, `Server${Capitalize(part)}`);
|
|
1046
|
-
if (override !== null) {
|
|
1047
|
-
return override;
|
|
1048
|
-
}
|
|
1049
|
-
const date = GetServerDate(context);
|
|
1050
|
-
switch (part) {
|
|
1051
|
-
case "year":
|
|
1052
|
-
return date.getFullYear();
|
|
1053
|
-
case "month":
|
|
1054
|
-
return date.getMonth() + 1;
|
|
1055
|
-
case "day":
|
|
1056
|
-
return date.getDate();
|
|
1057
|
-
case "dayOfWeek":
|
|
1058
|
-
return date.getDay();
|
|
1059
|
-
case "hour":
|
|
1060
|
-
return date.getHours();
|
|
1061
|
-
case "minute":
|
|
1062
|
-
return date.getMinutes();
|
|
1063
|
-
case "second":
|
|
1064
|
-
return date.getSeconds();
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
function GetServerTimePhase(context, period) {
|
|
1068
|
-
const value = Math.abs(ToNumber(period));
|
|
1069
|
-
if (value === 0) {
|
|
1070
|
-
return 0;
|
|
1071
|
-
}
|
|
1072
|
-
return GetServerTimeSeconds(context) % value;
|
|
1073
|
-
}
|
|
1074
|
-
function ServerTimeComparison(context, values, mode) {
|
|
1075
|
-
const parts = [GetServerDatePart(context, "year"), GetServerDatePart(context, "month"), GetServerDatePart(context, "day"), GetServerDatePart(context, "hour"), GetServerDatePart(context, "minute"), GetServerDatePart(context, "second")];
|
|
1076
|
-
for (let i = 0; i < parts.length; i++) {
|
|
1077
|
-
const expected = ToNumber(values[i], -1);
|
|
1078
|
-
if (expected === -1) {
|
|
1079
|
-
continue;
|
|
1080
|
-
}
|
|
1081
|
-
if (mode === 0) {
|
|
1082
|
-
if (parts[i] !== expected) {
|
|
1083
|
-
return 0;
|
|
1084
|
-
}
|
|
1085
|
-
continue;
|
|
1086
|
-
}
|
|
1087
|
-
if (parts[i] > expected) {
|
|
1088
|
-
return mode === 1 ? 1 : 0;
|
|
1089
|
-
}
|
|
1090
|
-
if (parts[i] < expected) {
|
|
1091
|
-
return mode === -1 ? 1 : 0;
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
return 1;
|
|
1095
|
-
}
|
|
1096
|
-
function DaysSinceServerTime(context, year, month, day) {
|
|
1097
|
-
const currentYear = GetServerDatePart(context, "year");
|
|
1098
|
-
const currentMonth = GetServerDatePart(context, "month");
|
|
1099
|
-
const currentDay = GetServerDatePart(context, "day");
|
|
1100
|
-
const targetYear = ToNumber(year, -1) === -1 ? currentYear : ToNumber(year);
|
|
1101
|
-
const targetMonth = ToNumber(month, -1) === -1 ? currentMonth : ToNumber(month);
|
|
1102
|
-
const targetDay = ToNumber(day, -1) === -1 ? currentDay : ToNumber(day);
|
|
1103
|
-
const target = Date.UTC(targetYear, targetMonth, targetDay);
|
|
1104
|
-
const current = Date.UTC(currentYear, currentMonth, currentDay);
|
|
1105
|
-
if (!Number.isFinite(target) || !Number.isFinite(current)) {
|
|
1106
|
-
return Number.MIN_VALUE;
|
|
1107
|
-
}
|
|
1108
|
-
return (current - target) / (60 * 60 * 24 * 1000);
|
|
1109
|
-
}
|
|
1110
|
-
function GetServerDate(context) {
|
|
1111
|
-
const value = GetServerTimeValue(context);
|
|
1112
|
-
if (value instanceof Date) {
|
|
1113
|
-
return value;
|
|
1114
|
-
}
|
|
1115
|
-
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1116
|
-
return new Date(NormalizeServerTimeMilliseconds(value));
|
|
1117
|
-
}
|
|
1118
|
-
return new Date();
|
|
1119
|
-
}
|
|
1120
|
-
function GetServerTimeSeconds(context) {
|
|
1121
|
-
const value = GetServerTimeValue(context);
|
|
1122
|
-
if (value instanceof Date) {
|
|
1123
|
-
return value.getTime() / 1000;
|
|
1124
|
-
}
|
|
1125
|
-
if (typeof value === "number" && Number.isFinite(value)) {
|
|
1126
|
-
return NormalizeServerTimeMilliseconds(value) / 1000;
|
|
1127
|
-
}
|
|
1128
|
-
return Date.now() / 1000;
|
|
1129
|
-
}
|
|
1130
|
-
function GetServerTimeValue(context) {
|
|
1131
|
-
if (HasProperty(context, "serverTime")) {
|
|
1132
|
-
const value = context.serverTime;
|
|
1133
|
-
if (value instanceof Date || typeof value === "number") {
|
|
1134
|
-
return value;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
if (HasProperty(context, "functions") && context.functions && typeof context.functions === "object" && HasFunction(context.functions, "GetServerTime")) {
|
|
1138
|
-
const value = context.functions.GetServerTime(context);
|
|
1139
|
-
if (value instanceof Date || typeof value === "number") {
|
|
1140
|
-
return value;
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
if (HasFunction(context.owner, "GetServerTime")) {
|
|
1144
|
-
const value = context.owner.GetServerTime();
|
|
1145
|
-
if (value instanceof Date || typeof value === "number") {
|
|
1146
|
-
return value;
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
|
-
return null;
|
|
1150
|
-
}
|
|
1151
|
-
function NormalizeServerTimeMilliseconds(value) {
|
|
1152
|
-
if (Math.abs(value) > 1e14) {
|
|
1153
|
-
return value / 10000;
|
|
1154
|
-
}
|
|
1155
|
-
if (Math.abs(value) < 1e10) {
|
|
1156
|
-
return value * 1000;
|
|
1157
|
-
}
|
|
1158
|
-
return value;
|
|
1159
|
-
}
|
|
1160
|
-
function CallContextFunction(context, name, arg, fallback = 0) {
|
|
1161
|
-
const value = TryCallContextFunction(context, name, arg);
|
|
1162
|
-
return value === null ? fallback : value;
|
|
1163
|
-
}
|
|
1164
|
-
function TryCallContextFunction(context, name, arg) {
|
|
1165
|
-
if (HasProperty(context, "functions") && context.functions && typeof context.functions === "object" && HasFunction(context.functions, name)) {
|
|
1166
|
-
return ToNumber(context.functions[name](arg, context));
|
|
1167
|
-
}
|
|
1168
|
-
if (HasFunction(context.owner, name)) {
|
|
1169
|
-
return ToNumber(context.owner[name](arg));
|
|
1170
|
-
}
|
|
1171
|
-
return null;
|
|
1172
|
-
}
|
|
1173
|
-
function RoundHalfToEven(value) {
|
|
1174
|
-
const floor = Math.floor(value);
|
|
1175
|
-
const diff = value - floor;
|
|
1176
|
-
if (diff < 0.5) {
|
|
1177
|
-
return floor;
|
|
1178
|
-
}
|
|
1179
|
-
if (diff > 0.5) {
|
|
1180
|
-
return floor + 1;
|
|
1181
|
-
}
|
|
1182
|
-
return floor % 2 === 0 ? floor : floor + 1;
|
|
1183
|
-
}
|
|
1184
|
-
function SumValues(values) {
|
|
1185
|
-
let total = 0;
|
|
1186
|
-
for (const value of values) {
|
|
1187
|
-
total += ToNumber(value);
|
|
1188
|
-
}
|
|
1189
|
-
return total;
|
|
1190
|
-
}
|
|
1191
|
-
function Hash01(value) {
|
|
1192
|
-
const x = Math.sin(value * 12.9898 + 78.233) * 43758.5453;
|
|
1193
|
-
return x - Math.floor(x);
|
|
1194
|
-
}
|
|
1195
|
-
function NormalizeValue(value) {
|
|
1196
|
-
if (value === true) {
|
|
1197
|
-
return 1;
|
|
1198
|
-
}
|
|
1199
|
-
if (value === false) {
|
|
1200
|
-
return 0;
|
|
1201
|
-
}
|
|
1202
|
-
if (value === undefined || value === null) {
|
|
1203
|
-
return 0;
|
|
1204
|
-
}
|
|
1205
|
-
return value;
|
|
1206
|
-
}
|
|
1207
|
-
function ToNumber(value, fallback = 0) {
|
|
1208
|
-
value = NormalizeValue(value);
|
|
1209
|
-
const number = Number(value);
|
|
1210
|
-
return Number.isFinite(number) ? number : fallback;
|
|
1211
|
-
}
|
|
1212
|
-
function Capitalize(value) {
|
|
1213
|
-
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
1214
|
-
}
|
|
1215
|
-
function ToBoolean(value) {
|
|
1216
|
-
if (typeof value === "string") {
|
|
1217
|
-
return value.length > 0;
|
|
1218
|
-
}
|
|
1219
|
-
return ToNumber(value) !== 0;
|
|
1220
|
-
}
|
|
1221
|
-
function IsDigit(c) {
|
|
1222
|
-
return !!c && c >= "0" && c <= "9";
|
|
1223
|
-
}
|
|
1224
|
-
function IsIdentifierStart(c) {
|
|
1225
|
-
return !!c && /[A-Za-z_]/.test(c);
|
|
1226
|
-
}
|
|
1227
|
-
function IsIdentifierPart(c) {
|
|
1228
|
-
return !!c && /[A-Za-z0-9_]/.test(c);
|
|
1229
|
-
}
|
|
1230
|
-
function HasProperty(value, key) {
|
|
1231
|
-
return !!value && typeof value === "object" && key in value;
|
|
1232
|
-
}
|
|
1233
|
-
function HasFunction(value, key) {
|
|
1234
|
-
return HasProperty(value, key) && typeof value[key] === "function";
|
|
1235
|
-
}
|
|
1236
|
-
|
|
1237
|
-
/**
|
|
1238
|
-
* Error raised while tokenizing or parsing an expression, carrying the source
|
|
1239
|
-
* text, the reason, and the character position at which parsing failed.
|
|
1240
|
-
*/
|
|
1241
|
-
class CjsControllerExpressionCompileError extends Error {
|
|
1242
|
-
expression;
|
|
1243
|
-
reason;
|
|
1244
|
-
position;
|
|
1245
|
-
|
|
1246
|
-
/**
|
|
1247
|
-
* Formats the message as the position, reason and full expression so a failed
|
|
1248
|
-
* compile is diagnosable from the message alone.
|
|
1249
|
-
*/
|
|
1250
|
-
constructor(data) {
|
|
1251
|
-
super(`Error compiling expression at ${data.position}: ${data.reason} (${data.expression})`);
|
|
1252
|
-
this.name = "CjsControllerExpressionCompileError";
|
|
1253
|
-
this.expression = data.expression;
|
|
1254
|
-
this.reason = data.reason;
|
|
1255
|
-
this.position = data.position;
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
/**
|
|
1260
|
-
* Error raised while evaluating a compiled expression, carrying the source text
|
|
1261
|
-
* and the reason.
|
|
1262
|
-
*/
|
|
1263
|
-
class CjsControllerExpressionEvaluateError extends Error {
|
|
1264
|
-
expression;
|
|
1265
|
-
reason;
|
|
1266
|
-
|
|
1267
|
-
/**
|
|
1268
|
-
* Formats the message as the reason and the full expression; unlike compile
|
|
1269
|
-
* errors there is no meaningful source position at evaluation time.
|
|
1270
|
-
*/
|
|
1271
|
-
constructor(data) {
|
|
1272
|
-
super(`Error evaluating expression: ${data.reason} (${data.expression})`);
|
|
1273
|
-
this.name = "CjsControllerExpressionEvaluateError";
|
|
1274
|
-
this.expression = data.expression;
|
|
1275
|
-
this.reason = data.reason;
|
|
1276
|
-
}
|
|
1277
|
-
}
|
|
1278
271
|
|
|
1279
|
-
export {
|
|
272
|
+
export { CjsControllerExpressionProgram };
|
|
1280
273
|
//# sourceMappingURL=CjsControllerExpressionProgram.js.map
|