@holtjs/stage 0.14.0 → 0.16.0

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/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { $n as HiDpiConfigureOptions, $t as OpenWgpuNativeFfiOptions, A as createInputRecorder, An as InstancedBatchObject, At as SceneDigestOverlayStats, Bn as SceneHostLike, Bt as Pointer, C as RecordedInputEntry, Cn as DrawStreamBulkView, D as TimelineClickOptions, Dn as EquipmentBinding, Dt as SceneDigestEngineSandbox, E as StagePlugin, En as DrawStreamSpriteOptions, Et as SceneDigestActiveFocus, Fn as PanelObject, Ft as buildSceneDigest, Gn as SpriteObject, Gt as WebGpuBootstrapResult, Hn as ShapeBatchObject, Ht as RendererWebGpu, In as PanelOpenSide, It as sanitizeTrackToken, Jn as TextObject, Jt as requestWebGpuDevice, Kn as SpritePlayOptions, Kt as WebGpuCanvasContextLike, Ln as PanelStyleConfig, Lt as InputConfig, M as createInputTimeline, Mn as MsdfIconConfig, Mt as SceneDigestSurfaceEntry, Nn as MsdfIconObject, Nt as SceneDigestSurfaceSource, O as TimelineDragOptions, On as Graphics, Ot as SceneDigestNode, Pn as NineSliceObject, Pt as SceneDigestSurfaces, Qn as CameraFollowOptions, Qt as OpenDawnWebGpuOptions, Rn as RectClipMask, Rt as InputPlugin, S as InputTimelinePlugin, Sn as DisplaySemantics, T as StageKernel, Tn as DrawStreamOptions, Tt as SceneDigest, Un as ShapeBatchStyleDefaults, Ut as RendererWebGpuOptions, Vn as ShapeBatchColumns, Vt as PointerSample, Wn as SpriteAnimEventListener, Wt as RequestWebGpuOptions, Xn as TileSpriteObject, Xt as HeadlessWebGpuHandle, Yn as TextStyleConfig, Yt as HeadlessWebGpuBackend, Zn as Camera, Zt as HeadlessWebGpuOptions, _ as ActionMap, _n as CustomPassOptions, a as GameLoop, an as RendererGlOptions, b as InputTargetSpec, bn as DisplayObject, c as LoaderPlugin, cn as StageRenderTarget, d as SceneCtor, dn as BlitterObject, en as openDawnWebGpu, er as HiDpiScaleLike, f as SceneInput, fn as Bob$1, g as ViewportFitResult, gn as CustomPassObject, h as StageRenderer, hn as CustomPassCallback, i as GameConfig$1, in as RendererGl, j as createInputReplay, jn as InstancedColumns, jt as SceneDigestSandbox, k as TimelineKeyOptions, kn as ImageObject, kt as SceneDigestOptions, l as ScaleManager, ln as AnchorPose2D, m as SceneManager, mn as ContainerFiltersShim, n as EngineClockSnapshot, nn as requestHeadlessWebGpu, o as GameObjectFactory, on as RendererStats, p as SceneLifecycleStats, pn as Container, qn as SyncAttachmentOptions, qt as WebGpuDeviceLike, r as Game, rn as Renderer2D, s as JsonCache, sn as Stage2DCustomImageHandler, t as EngineClock, tn as openWgpuNativeFfi, u as Scene, un as BindEquipmentOptions, v as InputProvider, vn as DirectionalPlayOptions, w as StageInputEvent, wn as DrawStreamObject, x as InputTimelineOptions, xn as DisplayObjectType, y as InputRecorderPlugin, yn as DisplayList, zn as RectangleObject, zt as KeyboardPlugin } from "./game-rKghsNlA.js";
1
+ import { $n as SpriteObject, $t as WebGpuBootstrapResult, A as StageKernel, An as DisplaySemantics, Bn as MsdfIconConfig, Bt as SceneDigestSurfaceEntry, C as RecordedInputEntry, Cn as CustomPassCallback, D as RollbackStateCodec, Dn as DisplayList, E as RollbackSessionOptions, En as DirectionalPlayOptions, F as createInputRecorder, Fn as EquipmentBinding, Ft as SceneDigestEngineSandbox, Gn as PanelStyleConfig, Gt as InputConfig, Hn as NineSliceObject, Ht as SceneDigestSurfaces, I as createInputReplay, In as Graphics, It as SceneDigestNode, Jn as SceneHostLike, Jt as Pointer, Kn as RectClipMask, Kt as InputPlugin, L as createInputTimeline, Ln as ImageObject, Lt as SceneDigestOptions, M as TimelineClickOptions, Mn as DrawStreamObject, N as TimelineDragOptions, Nn as DrawStreamOptions, Nt as SceneDigest, O as RollbackStats, On as DisplayObject, P as TimelineKeyOptions, Pn as DrawStreamSpriteOptions, Pt as SceneDigestActiveFocus, Qn as SpriteAnimEventListener, Qt as RequestWebGpuOptions, R as createRollbackSession, Rn as InstancedBatchObject, Rt as SceneDigestOverlayStats, S as InputTimelinePlugin, Sn as ContainerFiltersShim, T as RollbackSession, Tn as CustomPassOptions, Un as PanelObject, Ut as buildSceneDigest, Vn as MsdfIconObject, Vt as SceneDigestSurfaceSource, Wn as PanelOpenSide, Wt as sanitizeTrackToken, Xn as ShapeBatchObject, Xt as RendererWebGpu, Yn as ShapeBatchColumns, Yt as PointerSample, Zn as ShapeBatchStyleDefaults, Zt as RendererWebGpuOptions, _ as ActionMap, _n as AnchorPose2D, a as GameLoop, an as HeadlessWebGpuOptions, ar as Camera, b as InputTargetSpec, bn as Bob$1, c as LoaderPlugin, cn as openDawnWebGpu, cr as HiDpiScaleLike, d as SceneCtor, dn as Renderer2D, en as WebGpuCanvasContextLike, er as SpritePlayOptions, f as SceneInput, fn as RendererGl, g as ViewportFitResult, gn as StageRenderTarget, h as StageRenderer, hn as Stage2DCustomImageHandler, i as GameConfig$1, in as HeadlessWebGpuHandle, ir as TileSpriteObject, j as StagePlugin, jn as DrawStreamBulkView, k as StageInputEvent, kn as DisplayObjectType, l as ScaleManager, ln as openWgpuNativeFfi, m as SceneManager, mn as RendererStats, n as EngineClockSnapshot, nn as requestWebGpuDevice, nr as TextObject, o as GameObjectFactory, on as OpenDawnWebGpuOptions, or as CameraFollowOptions, p as SceneLifecycleStats, pn as RendererGlOptions, qn as RectangleObject, qt as KeyboardPlugin, r as Game, rn as HeadlessWebGpuBackend, rr as TextStyleConfig, s as JsonCache, sn as OpenWgpuNativeFfiOptions, sr as HiDpiConfigureOptions, t as EngineClock, tn as WebGpuDeviceLike, tr as SyncAttachmentOptions, u as Scene, un as requestHeadlessWebGpu, v as InputProvider, vn as BindEquipmentOptions, w as RollbackResult, wn as CustomPassObject, x as InputTimelineOptions, xn as Container, y as InputRecorderPlugin, yn as BlitterObject, zn as InstancedColumns, zt as SceneDigestSandbox } from "./game-Dxh9e0Hv.js";
2
2
  import { A as FilterModeValue, B as WEBGL, C as AUTO, D as CANVAS, E as BlendModes, F as Scale, G as packColorAbgr, H as WHITE_RGB, I as ScaleMode, K as parseColor, L as Scenes, M as Matrix2D, N as Rect2D, O as EventEmitter, P as RgbaColor, R as TintMode, S as TextureSource, T as BlendMode, U as WorldView2D, V as WEBGPU, W as createMatrix2D, _ as SpriteSheetConfig, a as AtlasClipRule, b as TextureImageSource, c as GenerateFrameNamesConfig, d as AtlasJsonLike, f as CanvasTexture, g as GlTextureHost, h as FrameExtraMeta, i as AtlasAutoAnimOptions, j as HEX_MASK, k as FilterMode, l as GenerateFrameNumbersConfig, m as FrameAnchorTuple, n as AnimationFrameInput, o as CompiledAnimationFrame, p as Frame, q as rgbToCss, r as AnimationManager, s as DirectionalAnimGroup, t as AnimationConfig, u as StageAnimation, v as Texture, w as BLACK_RGB, x as TextureManager, y as TextureImageOptions, z as TintModes } from "./anims-BOvaKn6w.js";
3
+ import { LocomotionFeel, LocomotionFeelInput, LocomotionFeelOptions, LocomotionFeelSample } from "./particles.js";
3
4
  import { FlattenedFlexNode, FlattenedFlexTree, FlexAlign, FlexContainerSpec, FlexDir, FlexIconSpec, FlexItemRect, FlexItemSpec, FlexJustify, FlexNodeSpec, FlexPadding, FlexPanelStyle, FlexResult, FlexTextSpec, MountFlexUiOptions, MountedFlexUi, WrapContainerSpec, WrapItemRect, WrapItemSpec, WrapJustify, WrapResult, computeFlexLayout, computeWrapLayout, flattenFlexTree, mountFlexUi, resolvePadding } from "./flex.js";
4
5
  import { a as SpringHandle, c as TweenManager, i as Easings, l as TweenOptions, n as EasingFn, o as SpringOptions, r as EasingName, s as TweenHandle, t as DisposableOwner, u as TweenStats } from "./tween-BiF1FUvc.js";
5
6
  import { a as ScriptOptions, i as ScriptHandle, o as ScriptScheduler, r as ScriptContext, s as ScriptStats, t as CoroutineGenerator } from "./coroutine-DLgJumtD.js";
@@ -332,4 +333,4 @@ export declare const Stage: {
332
333
  };
333
334
  };
334
335
  };
335
- export { AUTO, ActionMap, type AnchorPose2D, type AnimationConfig, type AnimationFrameInput, AnimationManager, type AtlasAutoAnimOptions, type AtlasClipRule, type AtlasJsonLike, BLACK_RGB, type BindEquipmentOptions, type BlendMode, BlendModes, BlitterObject, type Bob$1 as Bob, CANVAS, Camera, type CameraFollowOptions, CanvasTexture, type CompiledAnimationFrame, Container, type ContainerFiltersShim, type CoroutineGenerator, type CustomPassCallback, CustomPassObject, type CustomPassOptions, type DirectionalAnimGroup, type DirectionalPlayOptions, DisplayList, DisplayObject, type DisplayObjectType, type DisplaySemantics, type DisposableOwner, type DrawStreamBulkView, DrawStreamObject, type DrawStreamOptions, type DrawStreamSpriteOptions, type EasingFn, type EasingName, Easings, EngineClock, type EngineClockSnapshot, type EquipmentBinding, EventEmitter, FilterMode, type FilterModeValue, type FlattenedFlexNode, type FlattenedFlexTree, type FlexAlign, type FlexContainerSpec, type FlexDir, type FlexIconSpec, type FlexItemRect, type FlexItemSpec, type FlexJustify, type FlexNodeSpec, type FlexPadding, type FlexPanelStyle, type FlexResult, type FlexTextSpec, Frame, type FrameAnchorTuple, type FrameExtraMeta, Game, type GameConfig$1 as GameConfig, GameLoop, GameObjectFactory, type GenerateFrameNamesConfig, type GenerateFrameNumbersConfig, type GlTextureHost, Graphics, HEX_MASK, type HeadlessWebGpuBackend, type HeadlessWebGpuHandle, type HeadlessWebGpuOptions, type HiDpiConfigureOptions, type HiDpiScaleLike, ImageObject, type InputConfig, InputPlugin, type InputProvider, type InputRecorderPlugin, type InputTargetSpec, type InputTimelineOptions, type InputTimelinePlugin, InstancedBatchObject, type InstancedColumns, type JoystickDpad, type JoystickDpadOptions, type JoystickState, type JoystickVector, type JoystickViewport, type JoystickZone, type JoystickZonePredicate, type JoystickZoneRect, JsonCache, KeyboardPlugin, LoaderPlugin, type Matrix2D, type MountFlexUiOptions, type MountedFlexUi, type MsdfIconConfig, MsdfIconObject, NineSliceObject, type OpenDawnWebGpuOptions, type OpenWgpuNativeFfiOptions, PanelObject, type PanelOpenSide, type PanelStyleConfig, Pointer, type PointerSample, type RecordedInputEntry, type Rect2D, type RectClipMask, RectangleObject, Renderer2D, RendererGl, type RendererGlOptions, type RendererStats, RendererWebGpu, type RendererWebGpuOptions, type RequestWebGpuOptions, type RgbaColor, SURFACE_BAND, Scale, ScaleManager, type ScaleMode, Scene, type SceneCtor, type SceneDigest, type SceneDigestActiveFocus, type SceneDigestEngineSandbox, type SceneDigestNode, type SceneDigestOptions, type SceneDigestOverlayStats, type SceneDigestSandbox, type SceneDigestSurfaceEntry, type SceneDigestSurfaceSource, type SceneDigestSurfaces, type SceneHostLike, type SceneInput, type SceneLifecycleStats, SceneManager, Scenes, type ScriptContext, type ScriptHandle, type ScriptOptions, ScriptScheduler, type ScriptStats, type ShapeBatchColumns, ShapeBatchObject, type ShapeBatchStyleDefaults, type SpringHandle, type SpringOptions, type SpriteAnimEventListener, SpriteObject, type SpritePlayOptions, type SpriteSheetConfig, Stage as default, type Stage2DCustomImageHandler, type StageAnimation, type StageInputEvent, StageKernel, type StagePlugin, type StageRenderTarget, type StageRenderer, type SurfaceBand, type SurfaceBandName, type SurfaceBarrier, type SurfaceCancelContext, type SurfaceCancelDispatchResult, type SurfaceCancelResult, type SurfaceDomEntry, type SurfaceFocusContext, type SurfaceFocusDispatchResult, type SurfaceFocusResult, type SurfaceKeyContext, type SurfaceKeyDispatchResult, type SurfaceKeyResult, type SurfaceNodeInfo, type SurfaceNodeInput, type SurfaceScope, type SurfaceTree, type SyncAttachmentOptions, TextObject, type TextStyleConfig, Texture, type TextureImageOptions, type TextureImageSource, TextureManager, TextureSource, TileSpriteObject, type TimelineClickOptions, type TimelineDragOptions, type TimelineKeyOptions, type TintMode, TintModes, type TweenHandle, TweenManager, type TweenOptions, type TweenStats, type ViewportFitResult, VirtualJoystick, type VirtualJoystickMode, type VirtualJoystickOptions, type VirtualJoystickStyle, WEBGL, WEBGPU, WHITE_RGB, type WebGpuBootstrapResult, type WebGpuCanvasContextLike, type WebGpuDeviceLike, type WorldView2D, type WrapContainerSpec, type WrapItemRect, type WrapItemSpec, type WrapJustify, type WrapResult, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, flattenFlexTree, isInJoystickZone, mountFlexUi, openDawnWebGpu, openWgpuNativeFfi, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestHeadlessWebGpu, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
336
+ export { AUTO, ActionMap, type AnchorPose2D, type AnimationConfig, type AnimationFrameInput, AnimationManager, type AtlasAutoAnimOptions, type AtlasClipRule, type AtlasJsonLike, BLACK_RGB, type BindEquipmentOptions, type BlendMode, BlendModes, BlitterObject, type Bob$1 as Bob, CANVAS, Camera, type CameraFollowOptions, CanvasTexture, type CompiledAnimationFrame, Container, type ContainerFiltersShim, type CoroutineGenerator, type CustomPassCallback, CustomPassObject, type CustomPassOptions, type DirectionalAnimGroup, type DirectionalPlayOptions, DisplayList, DisplayObject, type DisplayObjectType, type DisplaySemantics, type DisposableOwner, type DrawStreamBulkView, DrawStreamObject, type DrawStreamOptions, type DrawStreamSpriteOptions, type EasingFn, type EasingName, Easings, EngineClock, type EngineClockSnapshot, type EquipmentBinding, EventEmitter, FilterMode, type FilterModeValue, type FlattenedFlexNode, type FlattenedFlexTree, type FlexAlign, type FlexContainerSpec, type FlexDir, type FlexIconSpec, type FlexItemRect, type FlexItemSpec, type FlexJustify, type FlexNodeSpec, type FlexPadding, type FlexPanelStyle, type FlexResult, type FlexTextSpec, Frame, type FrameAnchorTuple, type FrameExtraMeta, Game, type GameConfig$1 as GameConfig, GameLoop, GameObjectFactory, type GenerateFrameNamesConfig, type GenerateFrameNumbersConfig, type GlTextureHost, Graphics, HEX_MASK, type HeadlessWebGpuBackend, type HeadlessWebGpuHandle, type HeadlessWebGpuOptions, type HiDpiConfigureOptions, type HiDpiScaleLike, ImageObject, type InputConfig, InputPlugin, type InputProvider, type InputRecorderPlugin, type InputTargetSpec, type InputTimelineOptions, type InputTimelinePlugin, InstancedBatchObject, type InstancedColumns, type JoystickDpad, type JoystickDpadOptions, type JoystickState, type JoystickVector, type JoystickViewport, type JoystickZone, type JoystickZonePredicate, type JoystickZoneRect, JsonCache, KeyboardPlugin, LoaderPlugin, LocomotionFeel, type LocomotionFeelInput, type LocomotionFeelOptions, type LocomotionFeelSample, type Matrix2D, type MountFlexUiOptions, type MountedFlexUi, type MsdfIconConfig, MsdfIconObject, NineSliceObject, type OpenDawnWebGpuOptions, type OpenWgpuNativeFfiOptions, PanelObject, type PanelOpenSide, type PanelStyleConfig, Pointer, type PointerSample, type RecordedInputEntry, type Rect2D, type RectClipMask, RectangleObject, Renderer2D, RendererGl, type RendererGlOptions, type RendererStats, RendererWebGpu, type RendererWebGpuOptions, type RequestWebGpuOptions, type RgbaColor, type RollbackResult, RollbackSession, type RollbackSessionOptions, type RollbackStateCodec, type RollbackStats, SURFACE_BAND, Scale, ScaleManager, type ScaleMode, Scene, type SceneCtor, type SceneDigest, type SceneDigestActiveFocus, type SceneDigestEngineSandbox, type SceneDigestNode, type SceneDigestOptions, type SceneDigestOverlayStats, type SceneDigestSandbox, type SceneDigestSurfaceEntry, type SceneDigestSurfaceSource, type SceneDigestSurfaces, type SceneHostLike, type SceneInput, type SceneLifecycleStats, SceneManager, Scenes, type ScriptContext, type ScriptHandle, type ScriptOptions, ScriptScheduler, type ScriptStats, type ShapeBatchColumns, ShapeBatchObject, type ShapeBatchStyleDefaults, type SpringHandle, type SpringOptions, type SpriteAnimEventListener, SpriteObject, type SpritePlayOptions, type SpriteSheetConfig, Stage as default, type Stage2DCustomImageHandler, type StageAnimation, type StageInputEvent, StageKernel, type StagePlugin, type StageRenderTarget, type StageRenderer, type SurfaceBand, type SurfaceBandName, type SurfaceBarrier, type SurfaceCancelContext, type SurfaceCancelDispatchResult, type SurfaceCancelResult, type SurfaceDomEntry, type SurfaceFocusContext, type SurfaceFocusDispatchResult, type SurfaceFocusResult, type SurfaceKeyContext, type SurfaceKeyDispatchResult, type SurfaceKeyResult, type SurfaceNodeInfo, type SurfaceNodeInput, type SurfaceScope, type SurfaceTree, type SyncAttachmentOptions, TextObject, type TextStyleConfig, Texture, type TextureImageOptions, type TextureImageSource, TextureManager, TextureSource, TileSpriteObject, type TimelineClickOptions, type TimelineDragOptions, type TimelineKeyOptions, type TintMode, TintModes, type TweenHandle, TweenManager, type TweenOptions, type TweenStats, type ViewportFitResult, VirtualJoystick, type VirtualJoystickMode, type VirtualJoystickOptions, type VirtualJoystickStyle, WEBGL, WEBGPU, WHITE_RGB, type WebGpuBootstrapResult, type WebGpuCanvasContextLike, type WebGpuDeviceLike, type WorldView2D, type WrapContainerSpec, type WrapItemRect, type WrapItemSpec, type WrapJustify, type WrapResult, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createRollbackSession, createSurfaceTree, flattenFlexTree, isInJoystickZone, mountFlexUi, openDawnWebGpu, openWgpuNativeFfi, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestHeadlessWebGpu, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
package/dist/index.js CHANGED
@@ -1,9 +1,10 @@
1
1
  import { _ as rgbToCss, a as EventEmitter, c as Scale, d as WEBGL, f as WEBGPU, g as parseColor, h as packColorAbgr, i as CANVAS, l as Scenes, m as createMatrix2D, n as BLACK_RGB, o as FilterMode, p as WHITE_RGB, r as BlendModes, s as HEX_MASK, t as AUTO, u as TintModes } from "./types-CXsCvp1p.js";
2
- import { _ as CanvasTexture, a as JsonCache, b as TextureManager, c as Scene, d as KeyboardPlugin, f as Pointer, g as SdfPanelBatcher, h as MsdfIconBatcher, i as GameObjectFactory, l as SceneManager, m as PixelAaBatcher, n as Game, o as LoaderPlugin, p as RendererGl, r as GameLoop, s as ScaleManager, t as EngineClock, u as InputPlugin, v as Frame, x as TextureSource, y as Texture } from "./game-BF1ZbJRC.js";
2
+ import { _ as CanvasTexture, a as JsonCache, b as TextureManager, c as Scene, d as KeyboardPlugin, f as Pointer, g as SdfPanelBatcher, h as MsdfIconBatcher, i as GameObjectFactory, l as SceneManager, m as PixelAaBatcher, n as Game, o as LoaderPlugin, p as RendererGl, r as GameLoop, s as ScaleManager, t as EngineClock, u as InputPlugin, v as Frame, x as TextureSource, y as Texture } from "./game-CFxS641c.js";
3
3
  import { AnimationManager } from "./anims.js";
4
- import { a as requestHeadlessWebGpu, i as openWgpuNativeFfi, n as requestWebGpuDevice, o as Renderer2D, r as openDawnWebGpu, s as Camera, t as RendererWebGpu } from "./renderer-webgpu-CnIevdNP.js";
4
+ import { a as requestHeadlessWebGpu, i as openWgpuNativeFfi, n as requestWebGpuDevice, o as Renderer2D, r as openDawnWebGpu, s as Camera, t as RendererWebGpu } from "./renderer-webgpu-q4vdE3kA.js";
5
5
  import { _ as TileSpriteObject, a as DisplayObject, c as ImageObject, d as NineSliceObject, f as PanelObject, g as TextObject, h as SpriteObject, i as DisplayList, l as InstancedBatchObject, m as ShapeBatchObject, n as Container, o as DrawStreamObject, p as RectangleObject, r as CustomPassObject, s as Graphics, t as BlitterObject, u as MsdfIconObject } from "./display-CVjvA8ZO.js";
6
- import { ActionMap, StageKernel, createInputRecorder, createInputReplay, createInputTimeline } from "./kernel.js";
6
+ import { ActionMap, RollbackSession, StageKernel, createInputRecorder, createInputReplay, createInputTimeline, createRollbackSession } from "./kernel.js";
7
+ import { LocomotionFeel } from "./particles.js";
7
8
  import { buildSceneDigest, sanitizeTrackToken } from "./trace.js";
8
9
  import { computeFlexLayout, computeWrapLayout, flattenFlexTree, mountFlexUi, resolvePadding } from "./flex.js";
9
10
  import { Easings, TweenManager } from "./tween.js";
@@ -51,4 +52,4 @@ const Stage2D = {
51
52
  Display: { Canvas: { CanvasPool: { enableSmoothing() {} } } }
52
53
  };
53
54
  const Stage = Stage2D;
54
- export { AUTO, ActionMap, AnimationManager, BLACK_RGB, BlendModes, BlitterObject, CANVAS, Camera, CanvasTexture, Container, CustomPassObject, DisplayList, DisplayObject, DrawStreamObject, Easings, EngineClock, EventEmitter, FilterMode, Frame, Game, GameLoop, GameObjectFactory, Graphics, HEX_MASK, ImageObject, InputPlugin, InstancedBatchObject, JsonCache, KeyboardPlugin, LoaderPlugin, MsdfIconBatcher, MsdfIconObject, NineSliceObject, PanelObject, PixelAaBatcher, Pointer, RectangleObject, Renderer2D, RendererGl, RendererWebGpu, SURFACE_BAND, Scale, ScaleManager, Scene, SceneManager, Scenes, ScriptScheduler, SdfPanelBatcher, ShapeBatchObject, SpriteObject, Stage, Stage as default, Stage2D, StageKernel, TextObject, Texture, TextureManager, TextureSource, TileSpriteObject, TintModes, TweenManager, VirtualJoystick, WEBGL, WEBGPU, WHITE_RGB, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createSurfaceTree, flattenFlexTree, isInJoystickZone, mountFlexUi, openDawnWebGpu, openWgpuNativeFfi, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestHeadlessWebGpu, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
55
+ export { AUTO, ActionMap, AnimationManager, BLACK_RGB, BlendModes, BlitterObject, CANVAS, Camera, CanvasTexture, Container, CustomPassObject, DisplayList, DisplayObject, DrawStreamObject, Easings, EngineClock, EventEmitter, FilterMode, Frame, Game, GameLoop, GameObjectFactory, Graphics, HEX_MASK, ImageObject, InputPlugin, InstancedBatchObject, JsonCache, KeyboardPlugin, LoaderPlugin, LocomotionFeel, MsdfIconBatcher, MsdfIconObject, NineSliceObject, PanelObject, PixelAaBatcher, Pointer, RectangleObject, Renderer2D, RendererGl, RendererWebGpu, RollbackSession, SURFACE_BAND, Scale, ScaleManager, Scene, SceneManager, Scenes, ScriptScheduler, SdfPanelBatcher, ShapeBatchObject, SpriteObject, Stage, Stage as default, Stage2D, StageKernel, TextObject, Texture, TextureManager, TextureSource, TileSpriteObject, TintModes, TweenManager, VirtualJoystick, WEBGL, WEBGPU, WHITE_RGB, buildSceneDigest, clampJoystickOrigin, computeFlexLayout, computeJoystickVector, computeSurfaceDomZ, computeWrapLayout, createInputRecorder, createInputReplay, createInputTimeline, createMatrix2D, createRollbackSession, createSurfaceTree, flattenFlexTree, isInJoystickZone, mountFlexUi, openDawnWebGpu, openWgpuNativeFfi, packColorAbgr, parseColor, pullJoystickOrigin, quantizeJoystickDpad, requestHeadlessWebGpu, requestWebGpuDevice, resolvePadding, resolveSurfacePriority, rgbToCss, sanitizeTrackToken, surfacePriorityToDomZ };
@@ -1,4 +1,4 @@
1
- import { Bt as Pointer, Fn as PanelObject, pn as Container, u as Scene } from "./game-rKghsNlA.js";
1
+ import { Jt as Pointer, Un as PanelObject, u as Scene, xn as Container } from "./game-Dxh9e0Hv.js";
2
2
  export type VirtualJoystickMode = 'floating' | 'fixed';
3
3
  export interface JoystickVector {
4
4
  /** Normalized X axis in [-1, 1] after deadzone remapping. */
package/dist/kernel.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { a as ScriptOptions, i as ScriptHandle, o as ScriptScheduler, r as ScriptContext, s as ScriptStats, t as CoroutineGenerator } from "./coroutine-DLgJumtD.js";
2
- import { A as createInputRecorder, C as RecordedInputEntry, D as TimelineClickOptions, E as StagePlugin, M as createInputTimeline, O as TimelineDragOptions, S as InputTimelinePlugin, T as StageKernel, _ as ActionMap, b as InputTargetSpec, j as createInputReplay, k as TimelineKeyOptions, v as InputProvider, w as StageInputEvent, x as InputTimelineOptions, y as InputRecorderPlugin } from "./game-rKghsNlA.js";
3
- export { ActionMap, type CoroutineGenerator, InputProvider, InputRecorderPlugin, InputTargetSpec, InputTimelineOptions, InputTimelinePlugin, RecordedInputEntry, type ScriptContext, type ScriptHandle, type ScriptOptions, ScriptScheduler, type ScriptStats, StageInputEvent, StageKernel, StagePlugin, TimelineClickOptions, TimelineDragOptions, TimelineKeyOptions, createInputRecorder, createInputReplay, createInputTimeline };
2
+ import { A as StageKernel, C as RecordedInputEntry, D as RollbackStateCodec, E as RollbackSessionOptions, F as createInputRecorder, I as createInputReplay, L as createInputTimeline, M as TimelineClickOptions, N as TimelineDragOptions, O as RollbackStats, P as TimelineKeyOptions, R as createRollbackSession, S as InputTimelinePlugin, T as RollbackSession, _ as ActionMap, b as InputTargetSpec, j as StagePlugin, k as StageInputEvent, v as InputProvider, w as RollbackResult, x as InputTimelineOptions, y as InputRecorderPlugin } from "./game-Dxh9e0Hv.js";
3
+ export { ActionMap, type CoroutineGenerator, InputProvider, InputRecorderPlugin, InputTargetSpec, InputTimelineOptions, InputTimelinePlugin, RecordedInputEntry, RollbackResult, RollbackSession, RollbackSessionOptions, RollbackStateCodec, RollbackStats, type ScriptContext, type ScriptHandle, type ScriptOptions, ScriptScheduler, type ScriptStats, StageInputEvent, StageKernel, StagePlugin, TimelineClickOptions, TimelineDragOptions, TimelineKeyOptions, createInputRecorder, createInputReplay, createInputTimeline, createRollbackSession };
package/dist/kernel.js CHANGED
@@ -654,4 +654,169 @@ function createInputReplay(log, id = "stage.input-replay") {
654
654
  };
655
655
  return replay;
656
656
  }
657
- export { ActionMap, ScriptScheduler, StageKernel, createInputRecorder, createInputReplay, createInputTimeline };
657
+ function fnv1aBytes(buf) {
658
+ let h = 0x811c9dc5;
659
+ for (let i = 0; i < buf.length; i++) {
660
+ h ^= buf[i];
661
+ h = Math.imul(h, 16777619) >>> 0;
662
+ }
663
+ return h >>> 0;
664
+ }
665
+ /**
666
+ * Deterministic ring-buffered rollback netcode (GGPO-style prediction + authoritative correction)
667
+ * and interactive Time-Travel debugger with zero steady-state heap allocations.
668
+ */
669
+ var RollbackSession = class RollbackSession {
670
+ windowFrames;
671
+ curFrame;
672
+ minRecordedFrame;
673
+ codec;
674
+ stepFn;
675
+ inputEq;
676
+ ringFrames;
677
+ ringBufs;
678
+ ringLens;
679
+ ringChecksums;
680
+ ringInputs;
681
+ rollbacks = 0;
682
+ resimFrames = 0;
683
+ maxDepth = 0;
684
+ constructor(options) {
685
+ this.windowFrames = Math.max(2, Math.floor(options.windowFrames ?? 120));
686
+ this.curFrame = Math.max(0, Math.floor(options.initialFrame ?? 0));
687
+ this.minRecordedFrame = this.curFrame;
688
+ this.codec = options.codec;
689
+ this.stepFn = options.step;
690
+ this.inputEq = options.inputEquals ?? Object.is;
691
+ this.ringFrames = new Int32Array(this.windowFrames).fill(-1);
692
+ this.ringBufs = new Array(this.windowFrames);
693
+ this.ringLens = new Uint32Array(this.windowFrames);
694
+ this.ringChecksums = new Uint32Array(this.windowFrames);
695
+ this.ringInputs = new Array(this.windowFrames);
696
+ }
697
+ /** Create a `RollbackSession` bound directly to a `SoaWorld` (`world.snapshot` / `world.restore` / `world.checksum`). */
698
+ static fromSoaWorld(world, step, options = {}) {
699
+ return new RollbackSession({
700
+ ...options,
701
+ codec: {
702
+ save: (into) => world.snapshot(into),
703
+ load: (snap) => world.restore(snap),
704
+ checksum: world.checksum ? () => world.checksum() : void 0
705
+ },
706
+ step
707
+ });
708
+ }
709
+ get currentFrame() {
710
+ return this.curFrame;
711
+ }
712
+ get oldestFrame() {
713
+ return Math.max(this.minRecordedFrame, this.curFrame - this.windowFrames);
714
+ }
715
+ captureAtSlot(slot, frame) {
716
+ let capBuf = this.ringBufs[slot];
717
+ const snap = this.codec.save(capBuf);
718
+ if (!capBuf || snap.buffer !== capBuf.buffer || capBuf.byteLength < snap.byteLength) {
719
+ const nextCap = Math.max(256, snap.byteLength * 2);
720
+ capBuf = new Uint8Array(nextCap);
721
+ capBuf.set(snap, 0);
722
+ this.ringBufs[slot] = capBuf;
723
+ }
724
+ this.ringLens[slot] = snap.byteLength;
725
+ this.ringChecksums[slot] = this.codec.checksum ? this.codec.checksum() >>> 0 : fnv1aBytes(snap);
726
+ this.ringFrames[slot] = frame;
727
+ }
728
+ /** Save pre-step state for `currentFrame`, execute `step(currentFrame, input)`, and advance `currentFrame`. */
729
+ advance(input) {
730
+ const f = this.curFrame;
731
+ const slot = f % this.windowFrames;
732
+ this.captureAtSlot(slot, f);
733
+ this.ringInputs[slot] = input;
734
+ this.stepFn(f, input);
735
+ this.curFrame = f + 1;
736
+ return this.curFrame;
737
+ }
738
+ /** Read the input applied at historical `frame` (within `[oldestFrame .. currentFrame - 1]`). */
739
+ inputAt(frame) {
740
+ if (frame < this.oldestFrame || frame >= this.curFrame) return void 0;
741
+ const slot = frame % this.windowFrames;
742
+ return this.ringFrames[slot] === frame ? this.ringInputs[slot] : void 0;
743
+ }
744
+ /** Compute current live state checksum. */
745
+ currentChecksum() {
746
+ if (this.codec.checksum) return this.codec.checksum() >>> 0;
747
+ return fnv1aBytes(this.codec.save());
748
+ }
749
+ /** Compute checksum of the pre-step snapshot stored at historical `frame` (`null` if evicted). */
750
+ checksumAt(frame) {
751
+ if (frame === this.curFrame) return this.currentChecksum();
752
+ if (frame < this.oldestFrame || frame > this.curFrame) return null;
753
+ const slot = frame % this.windowFrames;
754
+ if (this.ringFrames[slot] !== frame) return null;
755
+ return this.ringChecksums[slot];
756
+ }
757
+ /**
758
+ * Time-Travel rewind: restore live simulation state back to `targetFrame` (`oldestFrame <= targetFrame <= currentFrame`),
759
+ * resetting `currentFrame = targetFrame` so subsequent `advance()` calls branch into a new timeline cleanly.
760
+ */
761
+ rewindTo(targetFrame) {
762
+ const tf = Math.floor(targetFrame);
763
+ if (tf === this.curFrame) return;
764
+ if (tf < this.oldestFrame || tf > this.curFrame) throw new RangeError(`RollbackSession.rewindTo: frame ${tf} outside retained window [${this.oldestFrame}..${this.curFrame}]`);
765
+ const slot = tf % this.windowFrames;
766
+ const buf = this.ringBufs[slot];
767
+ if (this.ringFrames[slot] !== tf || !buf) throw new Error(`RollbackSession.rewindTo: missing snapshot for frame ${tf}`);
768
+ this.codec.load(buf.subarray(0, this.ringLens[slot]));
769
+ for (let f = tf + 1; f < this.curFrame; f++) this.ringFrames[f % this.windowFrames] = -1;
770
+ this.curFrame = tf;
771
+ }
772
+ /**
773
+ * Apply an authoritative remote/replay input for `targetFrame`.
774
+ * If it matches the predicted input already simulated at `targetFrame`, returns immediately (`rolledBack: false`).
775
+ * Otherwise restores `targetFrame`'s snapshot, updates the input at `targetFrame`, and re-simulates `[targetFrame .. currentFrame - 1]`.
776
+ */
777
+ applyAuthoritativeInput(targetFrame, actualInput, equals) {
778
+ const tf = Math.floor(targetFrame);
779
+ if (tf < this.oldestFrame || tf >= this.curFrame) throw new RangeError(`RollbackSession.applyAuthoritativeInput: frame ${tf} outside active window [${this.oldestFrame}..${this.curFrame - 1}]`);
780
+ const slot = tf % this.windowFrames;
781
+ const buf = this.ringBufs[slot];
782
+ if (this.ringFrames[slot] !== tf || !buf) throw new Error(`RollbackSession.applyAuthoritativeInput: missing snapshot at frame ${tf}`);
783
+ if ((equals ?? this.inputEq)(this.ringInputs[slot], actualInput)) return {
784
+ rolledBack: false,
785
+ targetFrame: tf,
786
+ framesResimulated: 0,
787
+ checksum: this.currentChecksum()
788
+ };
789
+ const endFrame = this.curFrame;
790
+ const depth = endFrame - tf;
791
+ this.codec.load(buf.subarray(0, this.ringLens[slot]));
792
+ this.ringInputs[slot] = actualInput;
793
+ for (let f = tf; f < endFrame; f++) {
794
+ const fSlot = f % this.windowFrames;
795
+ if (f > tf) this.captureAtSlot(fSlot, f);
796
+ this.stepFn(f, this.ringInputs[fSlot]);
797
+ }
798
+ this.rollbacks++;
799
+ this.resimFrames += depth;
800
+ if (depth > this.maxDepth) this.maxDepth = depth;
801
+ return {
802
+ rolledBack: true,
803
+ targetFrame: tf,
804
+ framesResimulated: depth,
805
+ checksum: this.currentChecksum()
806
+ };
807
+ }
808
+ stats() {
809
+ return {
810
+ currentFrame: this.curFrame,
811
+ oldestFrame: this.oldestFrame,
812
+ windowFrames: this.windowFrames,
813
+ rollbackCount: this.rollbacks,
814
+ resimulatedFrames: this.resimFrames,
815
+ maxRollbackDepth: this.maxDepth
816
+ };
817
+ }
818
+ };
819
+ function createRollbackSession(options) {
820
+ return new RollbackSession(options);
821
+ }
822
+ export { ActionMap, RollbackSession, ScriptScheduler, StageKernel, createInputRecorder, createInputReplay, createInputTimeline, createRollbackSession };
@@ -1,4 +1,4 @@
1
- import { Bn as SceneHostLike, bn as DisplayObject, gn as CustomPassObject, kn as ImageObject, pn as Container } from "./game-rKghsNlA.js";
1
+ import { Jn as SceneHostLike, Ln as ImageObject, On as DisplayObject, gn as StageRenderTarget, wn as CustomPassObject, xn as Container } from "./game-Dxh9e0Hv.js";
2
2
  export type DayPhase = 'day' | 'dusk' | 'night';
3
3
  export interface DayNightConfig {
4
4
  dayLengthMs?: number;
@@ -112,7 +112,9 @@ export declare class Lighting2DSystem {
112
112
  readonly overlayImage: ImageObject;
113
113
  /** Screen-space `BlendModes.ADD` container right above `overlayImage` so emissive flames/eyes shine crisp in pitch-black night! */
114
114
  readonly emissiveLayer: Container;
115
- private renderTarget;
115
+ renderTarget: StageRenderTarget;
116
+ private readonly baseRtKey;
117
+ private resizeSeq;
116
118
  private readonly lightGraphics;
117
119
  private glowBatch;
118
120
  private glowCap;
package/dist/lighting.js CHANGED
@@ -345,6 +345,8 @@ var Lighting2DSystem = class {
345
345
  /** Screen-space `BlendModes.ADD` container right above `overlayImage` so emissive flames/eyes shine crisp in pitch-black night! */
346
346
  emissiveLayer;
347
347
  renderTarget;
348
+ baseRtKey;
349
+ resizeSeq = 0;
348
350
  lightGraphics;
349
351
  glowBatch = null;
350
352
  glowCap = 128;
@@ -380,6 +382,7 @@ var Lighting2DSystem = class {
380
382
  this.viewportW = Math.max(1, Math.round(opts.width));
381
383
  this.viewportH = Math.max(1, Math.round(opts.height));
382
384
  const rtKey = opts.key ?? `__stage_lightmap_${Math.random().toString(36).slice(2, 8)}`;
385
+ this.baseRtKey = rtKey;
383
386
  const rtW = Math.max(2, Math.round(this.viewportW * this.resScale));
384
387
  const rtH = Math.max(2, Math.round(this.viewportH * this.resScale));
385
388
  const rtHost = scene.renderer;
@@ -507,17 +510,20 @@ var Lighting2DSystem = class {
507
510
  this.manualAmbientRgb = rgb;
508
511
  }
509
512
  resize(width, height) {
510
- this.viewportW = Math.max(1, Math.round(width));
511
- this.viewportH = Math.max(1, Math.round(height));
512
- const rtW = Math.max(2, Math.round(this.viewportW * this.resScale));
513
- const rtH = Math.max(2, Math.round(this.viewportH * this.resScale));
514
- const oldKey = this.renderTarget.key;
515
- this.renderTarget.destroy();
516
- const newKey = `${oldKey}_r`;
517
- const rtHost = this.scene.renderer;
518
- this.renderTarget = rtHost.createRenderTarget(newKey, rtW, rtH, this.scene.textures, FilterMode.LINEAR);
519
- this.overlayImage.setTexture(newKey);
520
- this.overlayImage.setDisplaySize(this.viewportW, this.viewportH);
513
+ const nextW = Math.max(1, Math.round(width));
514
+ const nextH = Math.max(1, Math.round(height));
515
+ this.viewportW = nextW;
516
+ this.viewportH = nextH;
517
+ const rtW = Math.max(2, Math.round(nextW * this.resScale));
518
+ const rtH = Math.max(2, Math.round(nextH * this.resScale));
519
+ if (rtW !== this.renderTarget.width || rtH !== this.renderTarget.height) {
520
+ this.renderTarget.destroy();
521
+ const newKey = `${this.baseRtKey}_r${++this.resizeSeq}`;
522
+ const rtHost = this.scene.renderer;
523
+ this.renderTarget = rtHost.createRenderTarget(newKey, rtW, rtH, this.scene.textures, FilterMode.LINEAR);
524
+ this.overlayImage.setTexture(newKey);
525
+ }
526
+ this.overlayImage.setDisplaySize(nextW, nextH);
521
527
  }
522
528
  syncEmissiveBindings() {
523
529
  let idx = 0;
@@ -216,4 +216,79 @@ export declare class JuiceController {
216
216
  * Returns effective world particle delta in seconds (`0` while held in hitstop).
217
217
  */
218
218
  tick(frameMs: number, nowMs: number, paused?: boolean): number;
219
+ }
220
+ export interface LocomotionFeelOptions {
221
+ /** Spring stiffness driving squash/stretch recovery back to `1.0` (`default = 260`). */
222
+ readonly stiffness?: number;
223
+ /** Damping ratio (`< 1` bouncy, `1` critically damped; `default = 0.62` for lively rubbery settle). */
224
+ readonly dampingRatio?: number;
225
+ /** Maximum lean angle in radians at full reference horizontal speed (`default = 0.12` rad ~ 7 deg). */
226
+ readonly maxLeanRad?: number;
227
+ /** Reference movement speed in world px/s for full lean & stride bob (`default = 180`). */
228
+ readonly referenceSpeed?: number;
229
+ /** Automatic squash impulse injected when reversing movement direction sharply (`default = -0.18`). */
230
+ readonly turnSquash?: number;
231
+ /** Automatic squash factor per px/s of downward landing velocity (`default = 0.0014`). */
232
+ readonly landSquashScale?: number;
233
+ /** Optional vertical stride hop amplitude in pixels while moving on the ground (`default = 0`). */
234
+ readonly strideBobPx?: number;
235
+ /** Stride hop frequency in Hz (`default = 7.5`). */
236
+ readonly strideFreqHz?: number;
237
+ }
238
+ export interface LocomotionFeelInput {
239
+ readonly vx: number;
240
+ readonly vy: number;
241
+ /** Optional height above ground (`>= 0`); triggers automatic landing squash when touching down to `0`. */
242
+ readonly wz?: number;
243
+ }
244
+ export interface LocomotionFeelSample {
245
+ /** Volume-preserving horizontal scale multiplier (`scaleX = 1 / scaleY`). */
246
+ scaleX: number;
247
+ /** Volume-preserving vertical scale multiplier. */
248
+ scaleY: number;
249
+ /** Velocity-driven lean angle in radians. */
250
+ rotation: number;
251
+ /** Vertical stride-hop offset in pixels (`<= 0`). */
252
+ offsetY: number;
253
+ }
254
+ /**
255
+ * Procedural character secondary-motion controller providing volume-preserving (`scaleX * scaleY = 1`)
256
+ * spring squash-and-stretch, sharp-turn anticipation squash, landing thud, stride bob, and velocity lean
257
+ * for any `SpriteObject`, `ImageObject`, or `Container` without baking extra animation frames.
258
+ */
259
+ export declare class LocomotionFeel {
260
+ private stretch;
261
+ private stretchVel;
262
+ private lean;
263
+ private stridePhase;
264
+ private prevDirX;
265
+ private prevDirY;
266
+ private hadPrevDir;
267
+ private prevWz;
268
+ private prevVz;
269
+ private readonly stiffness;
270
+ private readonly damping;
271
+ private readonly maxLean;
272
+ private readonly refSpeed;
273
+ private readonly turnSquash;
274
+ private readonly landScale;
275
+ private readonly bobPx;
276
+ private readonly bobFreq;
277
+ private readonly out;
278
+ constructor(opts?: LocomotionFeelOptions);
279
+ /**
280
+ * Inject an instantaneous squash (`amount < 0`, wide & short) or stretch (`amount > 0`, tall & narrow)
281
+ * impulse — e.g. `-0.28` on melee hit/landing, `+0.25` on dash/jump launch.
282
+ */
283
+ impulse(amount: number): this;
284
+ reset(): this;
285
+ /** Advance procedural squash/stretch, turn anticipation, landing thud, and lean by `dtSec` seconds. */
286
+ step(dtSec: number, input: LocomotionFeelInput): LocomotionFeelSample;
287
+ get current(): LocomotionFeelSample;
288
+ /** Apply current `scaleX`, `scaleY`, and `rotation` multipliers onto a Stage `DisplayObject`. */
289
+ applyTo(target: {
290
+ scaleX: number;
291
+ scaleY: number;
292
+ rotation: number;
293
+ }, baseScaleX?: number, baseScaleY?: number): LocomotionFeelSample;
219
294
  }
package/dist/particles.js CHANGED
@@ -475,4 +475,130 @@ var JuiceController = class {
475
475
  return this.stop > 0 ? 0 : safeMs / 1e3;
476
476
  }
477
477
  };
478
- export { AmbientEmitterPool, FADE_EASE, FADE_FLICKER, FADE_LINEAR, FADE_PUNCH, FADE_SINE, FLAG_SIZE_POP, JuiceController, PARTICLE_BUBBLE, PARTICLE_RECT, PARTICLE_SPARKLE, PARTICLE_WAKE, ParticlePool, drawParticlePool };
478
+ /**
479
+ * Procedural character secondary-motion controller providing volume-preserving (`scaleX * scaleY = 1`)
480
+ * spring squash-and-stretch, sharp-turn anticipation squash, landing thud, stride bob, and velocity lean
481
+ * for any `SpriteObject`, `ImageObject`, or `Container` without baking extra animation frames.
482
+ */
483
+ var LocomotionFeel = class {
484
+ stretch = 0;
485
+ stretchVel = 0;
486
+ lean = 0;
487
+ stridePhase = 0;
488
+ prevDirX = 0;
489
+ prevDirY = 0;
490
+ hadPrevDir = false;
491
+ prevWz = 0;
492
+ prevVz = 0;
493
+ stiffness;
494
+ damping;
495
+ maxLean;
496
+ refSpeed;
497
+ turnSquash;
498
+ landScale;
499
+ bobPx;
500
+ bobFreq;
501
+ out = {
502
+ scaleX: 1,
503
+ scaleY: 1,
504
+ rotation: 0,
505
+ offsetY: 0
506
+ };
507
+ constructor(opts = {}) {
508
+ this.stiffness = Math.max(10, opts.stiffness ?? 260);
509
+ const zeta = Math.max(.1, Math.min(2, opts.dampingRatio ?? .62));
510
+ this.damping = 2 * zeta * Math.sqrt(this.stiffness);
511
+ this.maxLean = Math.max(0, opts.maxLeanRad ?? .12);
512
+ this.refSpeed = Math.max(1, opts.referenceSpeed ?? 180);
513
+ this.turnSquash = opts.turnSquash ?? -.18;
514
+ this.landScale = Math.max(0, opts.landSquashScale ?? .0014);
515
+ this.bobPx = Math.max(0, opts.strideBobPx ?? 0);
516
+ this.bobFreq = Math.max(.5, opts.strideFreqHz ?? 7.5);
517
+ }
518
+ /**
519
+ * Inject an instantaneous squash (`amount < 0`, wide & short) or stretch (`amount > 0`, tall & narrow)
520
+ * impulse — e.g. `-0.28` on melee hit/landing, `+0.25` on dash/jump launch.
521
+ */
522
+ impulse(amount) {
523
+ this.stretch = Math.max(-.55, Math.min(.55, this.stretch + amount));
524
+ return this;
525
+ }
526
+ reset() {
527
+ this.stretch = 0;
528
+ this.stretchVel = 0;
529
+ this.lean = 0;
530
+ this.stridePhase = 0;
531
+ this.hadPrevDir = false;
532
+ this.prevWz = 0;
533
+ this.prevVz = 0;
534
+ this.out.scaleX = 1;
535
+ this.out.scaleY = 1;
536
+ this.out.rotation = 0;
537
+ this.out.offsetY = 0;
538
+ return this;
539
+ }
540
+ /** Advance procedural squash/stretch, turn anticipation, landing thud, and lean by `dtSec` seconds. */
541
+ step(dtSec, input) {
542
+ const dt = Math.min(.1, Math.max(0, dtSec));
543
+ if (dt <= 0) return this.out;
544
+ const { vx, vy } = input;
545
+ const wz = Math.max(0, input.wz ?? 0);
546
+ const speed = Math.hypot(vx, vy);
547
+ if (speed > this.refSpeed * .2) {
548
+ const dx = vx / speed;
549
+ const dy = vy / speed;
550
+ if (this.hadPrevDir) {
551
+ const dot = dx * this.prevDirX + dy * this.prevDirY;
552
+ if (dot < -.25 && this.turnSquash !== 0) this.impulse(this.turnSquash * Math.min(1, (-dot - .25) / .75));
553
+ }
554
+ this.prevDirX = dx;
555
+ this.prevDirY = dy;
556
+ this.hadPrevDir = true;
557
+ } else if (speed < this.refSpeed * .05) this.hadPrevDir = false;
558
+ const vz = (wz - this.prevWz) / dt;
559
+ if (this.prevWz > .5 && wz <= .01) {
560
+ const impactSpeed = Math.max(40, -Math.min(vz, this.prevVz));
561
+ this.impulse(-Math.min(.42, impactSpeed * this.landScale));
562
+ }
563
+ this.prevWz = wz;
564
+ this.prevVz = vz;
565
+ const subSteps = 2;
566
+ const h = dt / subSteps;
567
+ for (let s = 0; s < subSteps; s++) {
568
+ const acc = -this.stiffness * this.stretch - this.damping * this.stretchVel;
569
+ this.stretchVel += acc * h;
570
+ this.stretch += this.stretchVel * h;
571
+ }
572
+ if (Math.abs(this.stretch) < 1e-4 && Math.abs(this.stretchVel) < 1e-4) {
573
+ this.stretch = 0;
574
+ this.stretchVel = 0;
575
+ }
576
+ const targetLean = Math.max(-1, Math.min(1, vx / this.refSpeed)) * this.maxLean;
577
+ const leanAlpha = 1 - Math.exp(-16 * dt);
578
+ this.lean += (targetLean - this.lean) * leanAlpha;
579
+ let offsetY = 0;
580
+ if (this.bobPx > 0 && wz <= .05 && speed > this.refSpeed * .1) {
581
+ const speedNorm = Math.min(1.25, speed / this.refSpeed);
582
+ this.stridePhase = (this.stridePhase + dt * this.bobFreq * speedNorm * Math.PI * 2) % (Math.PI * 2);
583
+ offsetY = -Math.abs(Math.sin(this.stridePhase)) * this.bobPx * speedNorm;
584
+ } else this.stridePhase = 0;
585
+ const clamped = Math.max(-.55, Math.min(.55, this.stretch));
586
+ const sy = Math.exp(clamped);
587
+ this.out.scaleX = 1 / sy;
588
+ this.out.scaleY = sy;
589
+ this.out.rotation = Math.abs(this.lean) < 1e-4 ? 0 : this.lean;
590
+ this.out.offsetY = offsetY;
591
+ return this.out;
592
+ }
593
+ get current() {
594
+ return this.out;
595
+ }
596
+ /** Apply current `scaleX`, `scaleY`, and `rotation` multipliers onto a Stage `DisplayObject`. */
597
+ applyTo(target, baseScaleX = 1, baseScaleY = 1) {
598
+ target.scaleX = baseScaleX * this.out.scaleX;
599
+ target.scaleY = baseScaleY * this.out.scaleY;
600
+ target.rotation = this.out.rotation;
601
+ return this.out;
602
+ }
603
+ };
604
+ export { AmbientEmitterPool, FADE_EASE, FADE_FLICKER, FADE_LINEAR, FADE_PUNCH, FADE_SINE, FLAG_SIZE_POP, JuiceController, LocomotionFeel, PARTICLE_BUBBLE, PARTICLE_RECT, PARTICLE_SPARKLE, PARTICLE_WAKE, ParticlePool, drawParticlePool };
@@ -1,4 +1,4 @@
1
- import { Bn as SceneHostLike, bn as DisplayObject, pn as Container } from "./game-rKghsNlA.js";
1
+ import { Jn as SceneHostLike, On as DisplayObject, xn as Container } from "./game-Dxh9e0Hv.js";
2
2
  export interface Camera25DConfig {
3
3
  viewportWidth: number;
4
4
  viewportHeight: number;
@@ -130,6 +130,8 @@ export interface MountStage25DOptions {
130
130
  trackId?: string;
131
131
  /** Enable real-time oblique sun-cast silhouette shadows (`true` or `Shadow25DConfig`). */
132
132
  shadows?: boolean | Shadow25DConfig;
133
+ /** Automatically sync `camera.resize(w, h)` whenever `scene.scale` emits `'resize'` (`default = true`). */
134
+ autoResize?: boolean;
133
135
  }
134
136
  export interface Stage25DRig {
135
137
  readonly camera: Camera25D;
@@ -402,6 +402,12 @@ function mountStage25D(scene, camera, opts = {}) {
402
402
  }
403
403
  };
404
404
  sync();
405
+ const scaleBus = scene.scale;
406
+ const onScaleResize = opts.autoResize !== false && scaleBus && typeof scaleBus.on === "function" ? (size) => {
407
+ camera.resize(size.width, size.height);
408
+ sync();
409
+ } : null;
410
+ if (onScaleResize && scaleBus?.on) scaleBus.on("resize", onScaleResize);
405
411
  return {
406
412
  camera,
407
413
  root,
@@ -454,6 +460,7 @@ function mountStage25D(scene, camera, opts = {}) {
454
460
  sync();
455
461
  },
456
462
  destroy() {
463
+ if (onScaleResize && scaleBus?.off) scaleBus.off("resize", onScaleResize);
457
464
  for (let i = 0; i < entries.length; i++) destroyShadowRecord(entries[i]);
458
465
  entries.length = 0;
459
466
  shadowMap.clear();