@skewedaspect/sage 0.10.0-beta.1 → 0.10.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/behaviors/sound.d.ts +22 -0
- package/dist/classes/gameEngine.d.ts +7 -0
- package/dist/classes/gameLevel.d.ts +6 -0
- package/dist/classes/level.d.ts +19 -0
- package/dist/debug/builtins.d.ts +0 -4
- package/dist/entities/entityPicking.d.ts +1 -0
- package/dist/entities/nodeEntity.d.ts +10 -0
- package/dist/entities/nodeSimulation.d.ts +9 -1
- package/dist/entities/nodeSimulationContext.d.ts +4 -0
- package/dist/events/payloads.d.ts +0 -12
- package/dist/input/actionContext.d.ts +2 -0
- package/dist/input/binding.d.ts +3 -1
- package/dist/input/bindings/delta.d.ts +23 -0
- package/dist/input/bindings/toggle.d.ts +5 -1
- package/dist/input/bindings/trigger.d.ts +5 -1
- package/dist/input/bindings/value.d.ts +7 -4
- package/dist/input/deliverAction.d.ts +3 -2
- package/dist/input/deviceReaders/mouse.d.ts +1 -1
- package/dist/input/deviceState.d.ts +5 -0
- package/dist/interfaces/game.d.ts +1 -1
- package/dist/interfaces/level.d.ts +2 -2
- package/dist/managers/asset.d.ts +17 -3
- package/dist/managers/game.d.ts +8 -1
- package/dist/managers/input.d.ts +34 -0
- package/dist/managers/level.d.ts +14 -0
- package/dist/managers/simulationSave.d.ts +10 -2
- package/dist/{postProcessingFrameGraph-rr2DbgPi.js → postProcessingFrameGraph-C3Og4kaS.js} +34 -26
- package/dist/postProcessingFrameGraph-C3Og4kaS.js.map +1 -0
- package/dist/sage.d.ts +13 -5
- package/dist/sage.es.js +919 -429
- package/dist/sage.es.js.map +1 -1
- package/dist/sage.umd.js +1 -1
- package/dist/sage.umd.js.map +1 -1
- package/dist/utils/bounds.d.ts +11 -0
- package/package.json +1 -1
- package/dist/postProcessingFrameGraph-rr2DbgPi.js.map +0 -1
|
@@ -10,61 +10,69 @@ var p = {
|
|
|
10
10
|
async function m(m, h) {
|
|
11
11
|
let g = m.activeCamera;
|
|
12
12
|
if (!g) return;
|
|
13
|
-
let _ = m.getEngine(), v = new t(m)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
13
|
+
let _ = m.getEngine(), v = new t(m);
|
|
14
|
+
function y(e, t) {
|
|
15
|
+
return v.textureManager.createRenderTargetTexture(e, {
|
|
16
|
+
size: {
|
|
17
|
+
width: 100,
|
|
18
|
+
height: 100
|
|
19
|
+
},
|
|
20
|
+
sizeIsPercentage: !0,
|
|
21
|
+
options: {
|
|
22
|
+
formats: [t],
|
|
23
|
+
samples: 4
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
let b = y("sage-fg-color", e.TEXTUREFORMAT_RGBA), x = y("sage-fg-depth", e.TEXTUREFORMAT_DEPTH24_STENCIL8), S = new i("sage-clear", v);
|
|
28
|
+
S.targetTexture = b, S.depthTexture = x, S.clearDepth = !0, S.clearStencil = !0, v.addTask(S);
|
|
29
|
+
let C = new l("sage-render", v, m);
|
|
30
|
+
C.targetTexture = S.outputTexture, C.depthTexture = S.outputDepthTexture, C.camera = g, C.objectList = {
|
|
27
31
|
meshes: m.meshes,
|
|
28
32
|
particleSystems: m.particleSystems
|
|
29
|
-
},
|
|
30
|
-
let
|
|
33
|
+
}, C.isMainObjectRenderer = !0, v.addTask(C);
|
|
34
|
+
let w = C.outputTexture;
|
|
31
35
|
if (h.ssao) {
|
|
32
36
|
let e = new o("sage-geometry", v, m);
|
|
33
37
|
v.addTask(e);
|
|
34
38
|
let t = new u("sage-ssao", v, .5, 1);
|
|
35
|
-
t.sourceTexture =
|
|
39
|
+
t.sourceTexture = w, t.depthTexture = e.geometryViewDepthTexture, t.normalTexture = e.geometryViewNormalTexture, t.camera = g, v.addTask(t), h.ssao.radius !== void 0 && (t.ssao.radius = h.ssao.radius), h.ssao.samples !== void 0 && (t.ssao.samples = h.ssao.samples), h.ssao.totalStrength !== void 0 && (t.ssao.totalStrength = h.ssao.totalStrength), w = t.outputTexture;
|
|
36
40
|
}
|
|
37
41
|
if (h.bloom) {
|
|
38
42
|
let e = new n("sage-bloom", v, h.bloom.weight ?? .5, h.bloom.kernel ?? 128, h.bloom.threshold ?? .1, !0, h.bloom.scale ?? .5);
|
|
39
|
-
e.sourceTexture =
|
|
43
|
+
e.sourceTexture = w, v.addTask(e), w = e.outputTexture;
|
|
40
44
|
}
|
|
41
45
|
if (h.grain) {
|
|
42
46
|
let e = new s("sage-grain", v);
|
|
43
|
-
e.sourceTexture =
|
|
47
|
+
e.sourceTexture = w, v.addTask(e), h.grain.intensity !== void 0 && (e.postProcess.intensity = h.grain.intensity), h.grain.animated !== void 0 && (e.postProcess.animated = h.grain.animated), w = e.outputTexture;
|
|
44
48
|
}
|
|
45
49
|
if (h.sharpen) {
|
|
46
50
|
let e = new d("sage-sharpen", v);
|
|
47
|
-
e.sourceTexture =
|
|
51
|
+
e.sourceTexture = w, v.addTask(e), h.sharpen.edge !== void 0 && (e.postProcess.edgeAmount = h.sharpen.edge), h.sharpen.color !== void 0 && (e.postProcess.colorAmount = h.sharpen.color), w = e.outputTexture;
|
|
48
52
|
}
|
|
49
53
|
if (h.chromaticAberration) {
|
|
50
54
|
let e = new r("sage-chromab", v);
|
|
51
|
-
e.sourceTexture =
|
|
55
|
+
e.sourceTexture = w, v.addTask(e), h.chromaticAberration.amount !== void 0 && (e.postProcess.aberrationAmount = h.chromaticAberration.amount), w = e.outputTexture;
|
|
52
56
|
}
|
|
53
57
|
if (h.tonemap || h.vignette) {
|
|
54
58
|
let e = new c("sage-imgproc", v);
|
|
55
|
-
if (e.sourceTexture =
|
|
59
|
+
if (e.sourceTexture = w, v.addTask(e), h.tonemap && (e.postProcess.toneMappingEnabled = !0, h.tonemap.operator && (e.postProcess.toneMappingType = p[h.tonemap.operator] ?? f.TONEMAPPING_STANDARD)), h.vignette && (e.postProcess.vignetteEnabled = !0, h.vignette.weight !== void 0 && (e.postProcess.vignetteWeight = h.vignette.weight), h.vignette.stretch !== void 0 && (e.postProcess.vignetteStretch = h.vignette.stretch), h.vignette.color)) {
|
|
56
60
|
let t = h.vignette.color;
|
|
57
61
|
e.postProcess.vignetteColor.set(t.r, t.g, t.b, 1);
|
|
58
62
|
}
|
|
59
|
-
|
|
63
|
+
w = e.outputTexture;
|
|
60
64
|
}
|
|
61
65
|
h.volumetric && console.warn("[SAGE] Volumetric lighting config is recognized but automatic light detection is not yet supported. Use scene.frameGraph to add FrameGraphVolumetricLightingTask manually.");
|
|
62
|
-
let
|
|
63
|
-
|
|
66
|
+
let T = new a("sage-output", v);
|
|
67
|
+
T.sourceTexture = w, v.addTask(T), m.cameraToUseForPointers = g, m.frameGraph = v;
|
|
68
|
+
let E = _.onResizeObservable.add(async () => {
|
|
64
69
|
await v.buildAsync();
|
|
70
|
+
});
|
|
71
|
+
m.onDisposeObservable.addOnce(() => {
|
|
72
|
+
_.onResizeObservable.remove(E);
|
|
65
73
|
}), await v.buildAsync();
|
|
66
74
|
}
|
|
67
75
|
//#endregion
|
|
68
76
|
export { m as applyFrameGraphPostProcessing };
|
|
69
77
|
|
|
70
|
-
//# sourceMappingURL=postProcessingFrameGraph-
|
|
78
|
+
//# sourceMappingURL=postProcessingFrameGraph-C3Og4kaS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postProcessingFrameGraph-C3Og4kaS.js","names":[],"sources":["../src/handlers/postProcessingFrameGraph.ts"],"sourcesContent":["//----------------------------------------------------------------------------------------------------------------------\n// Frame Graph Post-Processing Backend\n//\n// Builds a directed task chain using BabylonJS Frame Graph system.\n// Each post-processing effect is a separate task chained via texture handles.\n//----------------------------------------------------------------------------------------------------------------------\n\nimport {\n Constants,\n FrameGraph,\n FrameGraphBloomTask,\n FrameGraphChromaticAberrationTask,\n FrameGraphClearTextureTask,\n FrameGraphCopyToBackbufferColorTask,\n FrameGraphGeometryRendererTask,\n FrameGraphGrainTask,\n FrameGraphImageProcessingTask,\n FrameGraphObjectRendererTask,\n FrameGraphSSAO2RenderingPipelineTask,\n FrameGraphSharpenTask,\n type FrameGraphTextureHandle,\n ImageProcessingConfiguration,\n type Scene,\n} from '@babylonjs/core';\n\nimport type { PostProcessingConfig } from '../interfaces/level.ts';\n\n//----------------------------------------------------------------------------------------------------------------------\n\n/**\n * Map from user-facing tonemap operator names to BabylonJS constants.\n * BabylonJS only has STANDARD (0) and ACES (1) — the other names all map to STANDARD.\n */\nconst TONEMAP_OPERATORS : Record<string, number> = {\n hable: ImageProcessingConfiguration.TONEMAPPING_STANDARD,\n reinhard: ImageProcessingConfiguration.TONEMAPPING_STANDARD,\n hejidawson: ImageProcessingConfiguration.TONEMAPPING_STANDARD,\n photographic: ImageProcessingConfiguration.TONEMAPPING_STANDARD,\n aces: ImageProcessingConfiguration.TONEMAPPING_ACES,\n};\n\n//----------------------------------------------------------------------------------------------------------------------\n\nexport async function applyFrameGraphPostProcessing(scene : Scene, config : PostProcessingConfig) : Promise<void>\n{\n const camera = scene.activeCamera;\n if(!camera)\n {\n return;\n }\n\n const engine = scene.getEngine();\n const fg = new FrameGraph(scene);\n\n // The color target and its depth attachment differ only in format: the object renderer checks that\n // their size and sample count agree when the graph builds.\n function createTarget(name : string, format : number) : FrameGraphTextureHandle\n {\n return fg.textureManager.createRenderTargetTexture(name, {\n size: { width: 100, height: 100 },\n sizeIsPercentage: true,\n options: { formats: [ format ], samples: 4 },\n });\n }\n\n const colorTexture = createTarget('sage-fg-color', Constants.TEXTUREFORMAT_RGBA);\n const depthTexture = createTarget('sage-fg-depth', Constants.TEXTUREFORMAT_DEPTH24_STENCIL8);\n\n // 1. Clear. The clear task resolves its outputDepthTexture handle only when it is given a depth texture\n // to clear; the object renderer below reads that handle, and an unresolved one has no texture behind it.\n const clearTask = new FrameGraphClearTextureTask('sage-clear', fg);\n clearTask.targetTexture = colorTexture;\n clearTask.depthTexture = depthTexture;\n clearTask.clearDepth = true;\n clearTask.clearStencil = true;\n fg.addTask(clearTask);\n\n // 2. Render objects\n const renderTask = new FrameGraphObjectRendererTask('sage-render', fg, scene);\n renderTask.targetTexture = clearTask.outputTexture;\n renderTask.depthTexture = clearTask.outputDepthTexture;\n renderTask.camera = camera;\n renderTask.objectList = { meshes: scene.meshes, particleSystems: scene.particleSystems };\n renderTask.isMainObjectRenderer = true;\n fg.addTask(renderTask);\n\n // Track the current output texture through the chain\n let currentTexture : FrameGraphTextureHandle = renderTask.outputTexture;\n\n // 3. SSAO (needs geometry renderer for depth/normals)\n if(config.ssao)\n {\n const geoTask = new FrameGraphGeometryRendererTask('sage-geometry', fg, scene);\n fg.addTask(geoTask);\n\n const ssaoTask = new FrameGraphSSAO2RenderingPipelineTask('sage-ssao', fg, 0.5, 1.0);\n ssaoTask.sourceTexture = currentTexture;\n ssaoTask.depthTexture = geoTask.geometryViewDepthTexture;\n ssaoTask.normalTexture = geoTask.geometryViewNormalTexture;\n ssaoTask.camera = camera;\n fg.addTask(ssaoTask);\n\n if(config.ssao.radius !== undefined) { ssaoTask.ssao.radius = config.ssao.radius; }\n if(config.ssao.samples !== undefined) { ssaoTask.ssao.samples = config.ssao.samples; }\n if(config.ssao.totalStrength !== undefined) { ssaoTask.ssao.totalStrength = config.ssao.totalStrength; }\n\n currentTexture = ssaoTask.outputTexture;\n }\n\n // 4. Bloom\n if(config.bloom)\n {\n const bloomTask = new FrameGraphBloomTask(\n 'sage-bloom',\n fg,\n config.bloom.weight ?? 0.5,\n config.bloom.kernel ?? 128,\n config.bloom.threshold ?? 0.1,\n true,\n config.bloom.scale ?? 0.5\n );\n bloomTask.sourceTexture = currentTexture;\n fg.addTask(bloomTask);\n\n currentTexture = bloomTask.outputTexture;\n }\n\n // 5. Grain\n if(config.grain)\n {\n const grainTask = new FrameGraphGrainTask('sage-grain', fg);\n grainTask.sourceTexture = currentTexture;\n fg.addTask(grainTask);\n\n if(config.grain.intensity !== undefined) { grainTask.postProcess.intensity = config.grain.intensity; }\n if(config.grain.animated !== undefined) { grainTask.postProcess.animated = config.grain.animated; }\n\n currentTexture = grainTask.outputTexture;\n }\n\n // 6. Sharpen\n if(config.sharpen)\n {\n const sharpenTask = new FrameGraphSharpenTask('sage-sharpen', fg);\n sharpenTask.sourceTexture = currentTexture;\n fg.addTask(sharpenTask);\n\n if(config.sharpen.edge !== undefined) { sharpenTask.postProcess.edgeAmount = config.sharpen.edge; }\n if(config.sharpen.color !== undefined) { sharpenTask.postProcess.colorAmount = config.sharpen.color; }\n\n currentTexture = sharpenTask.outputTexture;\n }\n\n // 7. Chromatic aberration\n if(config.chromaticAberration)\n {\n const chromTask = new FrameGraphChromaticAberrationTask('sage-chromab', fg);\n chromTask.sourceTexture = currentTexture;\n fg.addTask(chromTask);\n\n if(config.chromaticAberration.amount !== undefined)\n {\n chromTask.postProcess.aberrationAmount = config.chromaticAberration.amount;\n }\n\n currentTexture = chromTask.outputTexture;\n }\n\n // 8. Image processing (tonemap + vignette)\n if(config.tonemap || config.vignette)\n {\n const imgTask = new FrameGraphImageProcessingTask('sage-imgproc', fg);\n imgTask.sourceTexture = currentTexture;\n fg.addTask(imgTask);\n\n if(config.tonemap)\n {\n imgTask.postProcess.toneMappingEnabled = true;\n\n if(config.tonemap.operator)\n {\n imgTask.postProcess.toneMappingType\n = TONEMAP_OPERATORS[config.tonemap.operator]\n ?? ImageProcessingConfiguration.TONEMAPPING_STANDARD;\n }\n }\n\n if(config.vignette)\n {\n imgTask.postProcess.vignetteEnabled = true;\n\n if(config.vignette.weight !== undefined) { imgTask.postProcess.vignetteWeight = config.vignette.weight; }\n if(config.vignette.stretch !== undefined)\n {\n imgTask.postProcess.vignetteStretch = config.vignette.stretch;\n }\n if(config.vignette.color)\n {\n const vc = config.vignette.color;\n imgTask.postProcess.vignetteColor.set(vc.r, vc.g, vc.b, 1);\n }\n }\n\n currentTexture = imgTask.outputTexture;\n }\n\n // 9. Volumetric lighting — not yet wired up for automatic light detection\n if(config.volumetric)\n {\n console.warn(\n '[SAGE] Volumetric lighting config is recognized but automatic light detection is not yet supported. '\n + 'Use scene.frameGraph to add FrameGraphVolumetricLightingTask manually.'\n );\n }\n\n // 10. Output to screen\n const copyTask = new FrameGraphCopyToBackbufferColorTask('sage-output', fg);\n copyTask.sourceTexture = currentTexture;\n fg.addTask(copyTask);\n\n // Wire up the scene — cameraToUseForPointers is needed because activeCamera becomes null between tasks\n scene.cameraToUseForPointers = camera;\n scene.frameGraph = fg;\n\n // Rebuild on resize. The scene disposes the graph with itself, and the engine outlives both, so the\n // observer goes with the scene rather than rebuilding a disposed graph for the engine's lifetime.\n const resizeObserver = engine.onResizeObservable.add(async () =>\n {\n await fg.buildAsync();\n });\n\n scene.onDisposeObservable.addOnce(() =>\n {\n engine.onResizeObservable.remove(resizeObserver);\n });\n\n // Initial build\n await fg.buildAsync();\n}\n\n//----------------------------------------------------------------------------------------------------------------------\n"],"mappings":";;AAiCA,IAAM,IAA6C;CAC/C,OAAO,EAA6B;CACpC,UAAU,EAA6B;CACvC,YAAY,EAA6B;CACzC,cAAc,EAA6B;CAC3C,MAAM,EAA6B;AACvC;AAIA,eAAsB,EAA8B,GAAe,GACnE;CACI,IAAM,IAAS,EAAM;CACrB,IAAG,CAAC,GAEA;CAGJ,IAAM,IAAS,EAAM,UAAU,GACzB,IAAK,IAAI,EAAW,CAAK;CAI/B,SAAS,EAAa,GAAe,GACrC;EACI,OAAO,EAAG,eAAe,0BAA0B,GAAM;GACrD,MAAM;IAAE,OAAO;IAAK,QAAQ;GAAI;GAChC,kBAAkB;GAClB,SAAS;IAAE,SAAS,CAAE,CAAO;IAAG,SAAS;GAAE;EAC/C,CAAC;CACL;CAEA,IAAM,IAAe,EAAa,iBAAiB,EAAU,kBAAkB,GACzE,IAAe,EAAa,iBAAiB,EAAU,8BAA8B,GAIrF,IAAY,IAAI,EAA2B,cAAc,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AG,EAAG,GAAG,EAAG,GAAG,CAAC;EAC7D;EAGJ,IAAiB,EAAQ;CAC7B;CAGA,AAAG,EAAO,cAEN,QAAQ,KACJ,4KAEJ;CAIJ,IAAM,IAAW,IAAI,EAAoC,eAAe,CAAE;CAM1E,AALA,EAAS,gBAAgB,GACzB,EAAG,QAAQ,CAAQ,GAGnB,EAAM,yBAAyB,GAC/B,EAAM,aAAa;CAInB,IAAM,IAAiB,EAAO,mBAAmB,IAAI,YACrD;EACI,MAAM,EAAG,WAAW;CACxB,CAAC;CAQD,AANA,EAAM,oBAAoB,cAC1B;EACI,EAAO,mBAAmB,OAAO,CAAc;CACnD,CAAC,GAGD,MAAM,EAAG,WAAW;AACxB"}
|
package/dist/sage.d.ts
CHANGED
|
@@ -6,9 +6,10 @@ import { AudioEngine } from "./engines/audio.d.ts";
|
|
|
6
6
|
import { SceneEngine } from "./engines/scene.d.ts";
|
|
7
7
|
import { AssetManager } from "./managers/asset.d.ts";
|
|
8
8
|
/**
|
|
9
|
-
* Creates and initializes a fully-wired GameEngine with rendering, physics, and entity management.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* Creates and initializes a fully-wired GameEngine with rendering, physics, and entity management. The
|
|
10
|
+
* engine owns one InputManager (`engine.managers.inputManager`): its action registry, its action context
|
|
11
|
+
* registry, device state capture, and the routing loop that runs before each frame's fixed steps
|
|
12
|
+
* (docs/design/input.md). A game declares its own actions, contexts, and bindings onto it.
|
|
12
13
|
*
|
|
13
14
|
* @param canvas
|
|
14
15
|
* @param entityClasses - The entity class table, keyed by class name, that the simulation spawns from
|
|
@@ -30,8 +31,8 @@ export * from "./utils/logger.d.ts";
|
|
|
30
31
|
export * from "./utils/metadata.d.ts";
|
|
31
32
|
export * from "./utils/timer.d.ts";
|
|
32
33
|
export * from "./utils/version.d.ts";
|
|
33
|
-
export { Behavior, GameEntity, GameSimulationManager } from '@skewedaspect/sage-core';
|
|
34
|
-
export type { BehaviorClass, ComposedOf, EventMap, EventSubscription, GameEntityState, GameEntityType, GameEvent as GameEntityEvent, GameSimulationContext, GameSimulationOptions, GameSimulationSnapshot, NarrowedTo, OpsFor, StateBag, StateFor, } from '@skewedaspect/sage-core';
|
|
34
|
+
export { Behavior, EventBus, GameEntity, GameSimulationManager, NamedBehavior, StateMachineBehavior, defineStates, dilationLimit, drainPassLimit, operationCallDepthLimit, } from '@skewedaspect/sage-core';
|
|
35
|
+
export type { BehaviorClass, ComposedOf, DeepReadonly, EventMap, EventSubscription, GameEntityState, GameEntityType, GameEvent as GameEntityEvent, GameSimulationContext, GameSimulationOptions, GameSimulationSnapshot, NamedState, NarrowedTo, OpsFor, OpsOf, StateBag, StateFor, StateSliceOf, } from '@skewedaspect/sage-core';
|
|
35
36
|
export { NodeEntity } from "./entities/nodeEntity.d.ts";
|
|
36
37
|
export type { NodeEntityState, QuaternionState, Vector3State } from "./entities/nodeEntity.d.ts";
|
|
37
38
|
export { NodePool } from "./entities/nodePool.d.ts";
|
|
@@ -44,6 +45,8 @@ export type { GameEntityDefinition, GameEntityDefinitionClass } from "./entities
|
|
|
44
45
|
export { buildStandardMeshSource } from "./entities/standardMeshSource.d.ts";
|
|
45
46
|
export type { MeshAssetSource } from "./entities/standardMeshSource.d.ts";
|
|
46
47
|
export type { MeshConfig, MeshMaterialConfig } from "./entities/meshConfig.d.ts";
|
|
48
|
+
export { SoundBehavior } from "./behaviors/sound.d.ts";
|
|
49
|
+
export type { SoundConfig, SoundState } from "./behaviors/sound.d.ts";
|
|
47
50
|
export { ActionRegistry } from "./input/actionRegistry.d.ts";
|
|
48
51
|
export { ActionContextRegistry } from "./input/actionContext.d.ts";
|
|
49
52
|
export type { Binding, BindingDefinition, BindingFire, BindingInput, BindingKind, DeviceID, DeviceType, } from "./input/binding.d.ts";
|
|
@@ -60,6 +63,8 @@ export { ToggleBinding } from "./input/bindings/toggle.d.ts";
|
|
|
60
63
|
export type { ToggleOptions } from "./input/bindings/toggle.d.ts";
|
|
61
64
|
export { ValueBinding } from "./input/bindings/value.d.ts";
|
|
62
65
|
export type { ValueOptions } from "./input/bindings/value.d.ts";
|
|
66
|
+
export { DeltaBinding } from "./input/bindings/delta.d.ts";
|
|
67
|
+
export type { DeltaOptions } from "./input/bindings/delta.d.ts";
|
|
63
68
|
export { resolveBinding } from "./input/resolveBinding.d.ts";
|
|
64
69
|
export { deliverAction } from "./input/deliverAction.d.ts";
|
|
65
70
|
export { InputCapture } from "./input/inputCapture.d.ts";
|
|
@@ -68,6 +73,7 @@ export { exportConfiguration, importConfiguration } from "./input/configuration.
|
|
|
68
73
|
export type { Configuration, ContextDefinition } from "./input/configuration.d.ts";
|
|
69
74
|
export type { Action, AnalogAction, DigitalAction } from '@skewedaspect/sage-core';
|
|
70
75
|
export type { FrameCallback } from "./managers/game.d.ts";
|
|
76
|
+
export { InputManager, ROUTING_LOOP_SENDER_ID } from "./managers/input.d.ts";
|
|
71
77
|
export type { TransitionOptions } from "./managers/level.d.ts";
|
|
72
78
|
export { AudioManager } from "./managers/audio.d.ts";
|
|
73
79
|
export type { ChannelInfo } from "./managers/audio.d.ts";
|
|
@@ -77,6 +83,8 @@ export { OutlineManager } from "./managers/outline.d.ts";
|
|
|
77
83
|
export { SimulationSaveManager } from "./managers/simulationSave.d.ts";
|
|
78
84
|
export type { BeforeSaveHook, LevelLoader, LoadResult, SaveEnvelope } from "./managers/simulationSave.d.ts";
|
|
79
85
|
export { DebugConsole } from "./classes/debugConsole.d.ts";
|
|
86
|
+
export { computeHierarchyBounds } from "./utils/bounds.d.ts";
|
|
87
|
+
export type { HierarchyBounds } from "./utils/bounds.d.ts";
|
|
80
88
|
export { generateId } from "./utils/id.d.ts";
|
|
81
89
|
export { StateMachine } from "./utils/stateMachine.d.ts";
|
|
82
90
|
export { getCanonicalTransform, toQuatObject, toQuaternion, toVec3Object, toVector3, } from "./utils/vectors.d.ts";
|