@opentui/core 0.2.0 → 0.2.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/index.js CHANGED
@@ -70,7 +70,7 @@ import {
70
70
  registerCorePlugin,
71
71
  resolveCoreSlot,
72
72
  vstyles
73
- } from "./index-mch6dv67.js";
73
+ } from "./index-hxymw48q.js";
74
74
  import {
75
75
  ASCIIFontSelectionHelper,
76
76
  ATTRIBUTE_BASE_BITS,
@@ -245,7 +245,7 @@ import {
245
245
  white,
246
246
  wrapWithDelegates,
247
247
  yellow
248
- } from "./index-mw2x3082.js";
248
+ } from "./index-b9g14b8c.js";
249
249
  export {
250
250
  yellow,
251
251
  wrapWithDelegates,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "type": "module",
7
- "version": "0.2.0",
7
+ "version": "0.2.1",
8
8
  "description": "OpenTUI is a TypeScript library on a native Zig core for building terminal user interfaces (TUIs)",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -18,11 +18,6 @@
18
18
  "require": "./index.js",
19
19
  "types": "./index.d.ts"
20
20
  },
21
- "./3d": {
22
- "import": "./3d.js",
23
- "require": "./3d.js",
24
- "types": "./3d.d.ts"
25
- },
26
21
  "./testing": {
27
22
  "import": "./testing.js",
28
23
  "require": "./testing.js",
@@ -46,8 +41,7 @@
46
41
  },
47
42
  "dependencies": {
48
43
  "bun-ffi-structs": "0.1.2",
49
- "diff": "8.0.2",
50
- "jimp": "1.6.0",
44
+ "diff": "9.0.0",
51
45
  "marked": "17.0.1",
52
46
  "string-width": "7.2.0",
53
47
  "strip-ansi": "7.1.2",
@@ -57,7 +51,6 @@
57
51
  "@opentui/keymap": "workspace:*",
58
52
  "@types/bun": "latest",
59
53
  "@types/node": "^24.0.0",
60
- "@types/three": "0.177.0",
61
54
  "commander": "^13.1.0",
62
55
  "typescript": "^5",
63
56
  "web-tree-sitter": "0.25.10"
@@ -66,15 +59,11 @@
66
59
  "web-tree-sitter": "0.25.10"
67
60
  },
68
61
  "optionalDependencies": {
69
- "@dimforge/rapier2d-simd-compat": "^0.17.3",
70
- "bun-webgpu": "0.1.7",
71
- "planck": "^1.4.2",
72
- "three": "0.177.0",
73
- "@opentui/core-darwin-x64": "0.2.0",
74
- "@opentui/core-darwin-arm64": "0.2.0",
75
- "@opentui/core-linux-x64": "0.2.0",
76
- "@opentui/core-linux-arm64": "0.2.0",
77
- "@opentui/core-win32-x64": "0.2.0",
78
- "@opentui/core-win32-arm64": "0.2.0"
62
+ "@opentui/core-darwin-x64": "0.2.1",
63
+ "@opentui/core-darwin-arm64": "0.2.1",
64
+ "@opentui/core-linux-x64": "0.2.1",
65
+ "@opentui/core-linux-arm64": "0.2.1",
66
+ "@opentui/core-win32-x64": "0.2.1",
67
+ "@opentui/core-win32-arm64": "0.2.1"
79
68
  }
80
69
  }
package/platform/ffi.d.ts CHANGED
@@ -2,6 +2,10 @@ declare const pointerBrand: unique symbol;
2
2
  export type Pointer = (number | bigint) & {
3
3
  readonly [pointerBrand]: "Pointer";
4
4
  };
5
+ type PointerSource = ArrayBuffer | (ArrayBufferView & {
6
+ buffer: ArrayBuffer;
7
+ });
8
+ type BunPointer = number;
5
9
  export declare const FFIType: {
6
10
  readonly char: "char";
7
11
  readonly int8_t: "int8_t";
@@ -57,8 +61,66 @@ export interface Library<Fns extends Record<string, FFIFunction>> {
57
61
  createCallback(callback: (...args: any[]) => any, definition: FFIFunction): FFICallbackInstance;
58
62
  close(): void;
59
63
  }
64
+ interface FfiBackend {
65
+ dlopen<Fns extends Record<string, FFIFunction>>(path: string | URL, symbols: Fns): Library<Fns>;
66
+ ptr(value: PointerSource): Pointer;
67
+ suffix: string;
68
+ toArrayBuffer(pointer: Pointer, offset: number | undefined, length: number): ArrayBuffer;
69
+ }
70
+ interface BunFFIFunction {
71
+ readonly args?: readonly FFITypeOrString[];
72
+ readonly returns?: FFITypeOrString;
73
+ readonly ptr?: BunPointer;
74
+ readonly threadsafe?: boolean;
75
+ }
76
+ interface BunFfiLibrary<Fns extends Record<string, BunFFIFunction>> {
77
+ symbols: {
78
+ [K in keyof Fns]: (...args: any[]) => any;
79
+ };
80
+ close(): void;
81
+ }
82
+ interface BunFfiBackend {
83
+ JSCallback: new (callback: (...args: any[]) => any, definition: BunFFIFunction) => FFICallbackInstance;
84
+ dlopen<Fns extends Record<string, BunFFIFunction>>(path: string | URL, symbols: Fns): BunFfiLibrary<Fns>;
85
+ ptr(value: PointerSource): Pointer;
86
+ suffix: string;
87
+ toArrayBuffer(pointer: BunPointer, offset: number | undefined, length: number): ArrayBuffer;
88
+ }
89
+ interface NodeFFIFunction {
90
+ readonly parameters: readonly string[];
91
+ readonly result: string;
92
+ }
93
+ interface NodeDynamicLibrary {
94
+ close(): void;
95
+ registerCallback(signature: NodeFFIFunction, callback: (...args: any[]) => any): bigint;
96
+ unregisterCallback(pointer: bigint): void;
97
+ }
98
+ interface NodeFfiLibrary {
99
+ readonly lib: NodeDynamicLibrary;
100
+ readonly functions: Record<string, (...args: any[]) => any>;
101
+ }
102
+ interface NodeFfiBackend {
103
+ dlopen(path: string | null, symbols: Record<string, NodeFFIFunction>): NodeFfiLibrary;
104
+ getRawPointer(source: ArrayBuffer): bigint;
105
+ suffix: string;
106
+ toArrayBuffer(pointer: bigint, length: number, copy?: boolean): ArrayBuffer;
107
+ }
108
+ export declare const FFI_UNAVAILABLE = "OpenTUI native FFI is not available for this runtime yet";
109
+ export declare const BUN_DLOPEN_NULL = "Bun FFI backend does not support dlopen(null)";
110
+ export declare const LIBRARY_CLOSED = "Cannot create FFI callback after library.close() has been called";
111
+ export declare const NODE_CALLBACK_THREADSAFE = "Node FFI callbacks are same-thread only and do not support threadsafe callbacks";
112
+ export declare const NODE_NAPI_UNSUPPORTED = "Node FFI backend does not support Bun N-API FFI types";
113
+ export declare const NODE_POINTER_OVERRIDE = "Node FFI backend does not support FFIFunction.ptr overrides";
114
+ export declare const NODE_PTR_VALUE = "node:ffi ptr() only supports ArrayBuffer and ArrayBufferView values backed by ArrayBuffer";
115
+ export declare const NODE_STRING_RETURN = "Node FFI backend does not normalize string return values (yet)";
116
+ export declare const NODE_USIZE_UNSUPPORTED = "Node FFI backend does not support usize until (yet)";
117
+ export declare const POINTER_NEGATIVE = "Pointer must be non-negative";
118
+ export declare const POINTER_UNSAFE = "Pointer exceeds safe integer range";
119
+ export declare function toPointer(value: number | bigint): Pointer;
120
+ export declare function createBunBackend(bun: BunFfiBackend): FfiBackend;
121
+ export declare function createNodeBackend(nodeFfi: NodeFfiBackend): FfiBackend;
60
122
  export declare const dlopen: <Fns extends Record<string, FFIFunction>>(path: string | URL, symbols: Fns) => Library<Fns>;
61
- export declare const ptr: (value: ArrayBufferLike | ArrayBufferView) => Pointer;
123
+ export declare const ptr: (value: PointerSource) => Pointer;
62
124
  export declare const suffix: string;
63
125
  export declare const toArrayBuffer: (pointer: Pointer, offset: number | undefined, length: number) => ArrayBuffer;
64
126
  export {};
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  createRuntimePlugin,
4
4
  runtimeModuleIdForSpecifier
5
- } from "./index-epp5y71w.js";
6
- import"./index-mch6dv67.js";
7
- import"./index-mw2x3082.js";
5
+ } from "./index-htg1x5tj.js";
6
+ import"./index-hxymw48q.js";
7
+ import"./index-b9g14b8c.js";
8
8
 
9
9
  // src/runtime-plugin-support.ts
10
10
  var {plugin: registerBunPlugin } = globalThis.Bun;
package/runtime-plugin.js CHANGED
@@ -3,9 +3,9 @@ import {
3
3
  createRuntimePlugin,
4
4
  isCoreRuntimeModuleSpecifier,
5
5
  runtimeModuleIdForSpecifier
6
- } from "./index-epp5y71w.js";
7
- import"./index-mch6dv67.js";
8
- import"./index-mw2x3082.js";
6
+ } from "./index-htg1x5tj.js";
7
+ import"./index-hxymw48q.js";
8
+ import"./index-b9g14b8c.js";
9
9
  export {
10
10
  runtimeModuleIdForSpecifier,
11
11
  isCoreRuntimeModuleSpecifier,
package/testing.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  TreeSitterClient,
6
6
  calculateRenderGeometry,
7
7
  resolveRenderLib
8
- } from "./index-mw2x3082.js";
8
+ } from "./index-b9g14b8c.js";
9
9
 
10
10
  // src/testing/test-renderer.ts
11
11
  import { Readable, Writable } from "stream";
@@ -1,74 +0,0 @@
1
- import * as THREE from "three";
2
- import type { Scene } from "three";
3
- export interface ResourceConfig {
4
- imagePath: string;
5
- sheetNumFrames: number;
6
- }
7
- export interface SheetProperties {
8
- imagePath: string;
9
- sheetTilesetWidth: number;
10
- sheetTilesetHeight: number;
11
- sheetNumFrames: number;
12
- }
13
- export interface InstanceManagerOptions {
14
- maxInstances: number;
15
- renderOrder?: number;
16
- depthWrite?: boolean;
17
- name?: string;
18
- frustumCulled?: boolean;
19
- matrix?: THREE.Matrix4;
20
- }
21
- export interface MeshPoolOptions {
22
- geometry: () => THREE.BufferGeometry;
23
- material: THREE.Material;
24
- maxInstances: number;
25
- name?: string;
26
- }
27
- export declare class MeshPool {
28
- private pools;
29
- acquireMesh(poolId: string, options: MeshPoolOptions): THREE.InstancedMesh;
30
- releaseMesh(poolId: string, mesh: THREE.InstancedMesh): void;
31
- fill(poolId: string, options: MeshPoolOptions, count: number): void;
32
- clearPool(poolId: string): void;
33
- clearAllPools(): void;
34
- }
35
- export declare class InstanceManager {
36
- private scene;
37
- private instancedMesh;
38
- private material;
39
- private maxInstances;
40
- private _freeIndices;
41
- private instanceCount;
42
- private _matrix;
43
- constructor(scene: Scene, geometry: THREE.BufferGeometry, material: THREE.Material, options: InstanceManagerOptions);
44
- acquireInstanceSlot(): number;
45
- releaseInstanceSlot(instanceIndex: number): void;
46
- getInstanceCount(): number;
47
- getMaxInstances(): number;
48
- get hasFreeIndices(): boolean;
49
- get mesh(): THREE.InstancedMesh;
50
- dispose(): void;
51
- }
52
- export declare class SpriteResource {
53
- private _texture;
54
- private _sheetProperties;
55
- private scene;
56
- private _meshPool;
57
- constructor(texture: THREE.DataTexture, sheetProperties: SheetProperties, scene: Scene);
58
- get texture(): THREE.DataTexture;
59
- get sheetProperties(): SheetProperties;
60
- get meshPool(): MeshPool;
61
- createInstanceManager(geometry: THREE.BufferGeometry, material: THREE.Material, options: InstanceManagerOptions): InstanceManager;
62
- get uvTileSize(): THREE.Vector2;
63
- dispose(): void;
64
- }
65
- export declare class SpriteResourceManager {
66
- private resources;
67
- private textureCache;
68
- private scene;
69
- constructor(scene: Scene);
70
- private getResourceKey;
71
- getOrCreateResource(texture: THREE.DataTexture, sheetProps: SheetProperties): Promise<SpriteResource>;
72
- createResource(config: ResourceConfig): Promise<SpriteResource>;
73
- clearCache(): void;
74
- }
@@ -1,13 +0,0 @@
1
- import { Sprite, SpriteMaterial, type SpriteMaterialParameters } from "three";
2
- export declare class SheetSprite extends Sprite {
3
- private _frameIndex;
4
- private _numFrames;
5
- constructor(material: SpriteMaterial, numFrames: number);
6
- setIndex: (index: number) => void;
7
- }
8
- export declare class SpriteUtils {
9
- static fromFile(path: string, { materialParameters, }?: {
10
- materialParameters?: Omit<SpriteMaterialParameters, "map">;
11
- }): Promise<Sprite>;
12
- static sheetFromFile(path: string, numFrames: number): Promise<SheetSprite>;
13
- }
@@ -1,24 +0,0 @@
1
- import { Color, Texture, DataTexture } from "three";
2
- export declare class TextureUtils {
3
- /**
4
- * Loads a texture from a file path using sharp.
5
- * Returns a THREE.Texture with ImageData attached to its .image property.
6
- */
7
- static loadTextureFromFile(path: string): Promise<DataTexture | null>;
8
- /**
9
- * Alias for loadTextureFromFile for convenience.
10
- */
11
- static fromFile(path: string): Promise<DataTexture | null>;
12
- /**
13
- * Creates a THREE.Texture with a checkerboard pattern.
14
- */
15
- static createCheckerboard(size?: number, color1?: Color, color2?: Color, checkSize?: number): Texture;
16
- /**
17
- * Creates a THREE.Texture with a gradient pattern.
18
- */
19
- static createGradient(size?: number, startColor?: Color, endColor?: Color, direction?: "horizontal" | "vertical" | "radial"): Texture;
20
- /**
21
- * Creates a THREE.Texture with a procedural noise pattern.
22
- */
23
- static createNoise(size?: number, scale?: number, octaves?: number, color1?: Color, color2?: Color): Texture;
24
- }
@@ -1,40 +0,0 @@
1
- import { OrthographicCamera, PerspectiveCamera, Scene } from "three";
2
- import { OptimizedBuffer } from "../buffer.js";
3
- import { Renderable, type RenderableOptions } from "../Renderable.js";
4
- import type { RenderContext } from "../types.js";
5
- import { ThreeCliRenderer, type ThreeCliRendererOptions } from "./WGPURenderer.js";
6
- export interface ThreeRenderableOptions extends RenderableOptions<ThreeRenderable> {
7
- scene?: Scene | null;
8
- camera?: PerspectiveCamera | OrthographicCamera;
9
- renderer?: Omit<ThreeCliRendererOptions, "width" | "height" | "autoResize">;
10
- autoAspect?: boolean;
11
- }
12
- export declare class ThreeRenderable extends Renderable {
13
- private engine;
14
- private scene;
15
- private autoAspect;
16
- private initPromise;
17
- private initFailed;
18
- private drawInFlight;
19
- private frameCallback;
20
- private frameCallbackRegistered;
21
- private cliRenderer;
22
- private clearColor;
23
- constructor(ctx: RenderContext, options: ThreeRenderableOptions);
24
- get aspectRatio(): number;
25
- get renderer(): ThreeCliRenderer;
26
- getScene(): Scene | null;
27
- setScene(scene: Scene | null): void;
28
- getActiveCamera(): PerspectiveCamera | OrthographicCamera;
29
- setActiveCamera(camera: PerspectiveCamera | OrthographicCamera): void;
30
- setAutoAspect(autoAspect: boolean): void;
31
- protected onResize(width: number, height: number): void;
32
- protected renderSelf(buffer: OptimizedBuffer, deltaTime: number): void;
33
- protected destroySelf(): void;
34
- private registerFrameCallback;
35
- private renderToBuffer;
36
- private ensureInitialized;
37
- private updateCameraAspect;
38
- private getAspectRatio;
39
- private getRenderSize;
40
- }
@@ -1,61 +0,0 @@
1
- import { PerspectiveCamera, OrthographicCamera, Scene } from "three";
2
- import type { OptimizedBuffer } from "../buffer.js";
3
- import { RGBA } from "../lib/RGBA.js";
4
- import { SuperSampleAlgorithm } from "./canvas.js";
5
- import { type CliRenderer } from "../renderer.js";
6
- export declare enum SuperSampleType {
7
- NONE = "none",
8
- GPU = "gpu",
9
- CPU = "cpu"
10
- }
11
- export interface ThreeCliRendererOptions {
12
- width: number;
13
- height: number;
14
- focalLength?: number;
15
- backgroundColor?: RGBA;
16
- superSample?: SuperSampleType;
17
- alpha?: boolean;
18
- autoResize?: boolean;
19
- libPath?: string;
20
- }
21
- export declare class ThreeCliRenderer {
22
- private readonly cliRenderer;
23
- private outputWidth;
24
- private outputHeight;
25
- private renderWidth;
26
- private renderHeight;
27
- private superSample;
28
- private backgroundColor;
29
- private alpha;
30
- private threeRenderer?;
31
- private canvas?;
32
- private device;
33
- private activeCamera;
34
- private _aspectRatio;
35
- private doRenderStats;
36
- private resizeHandler;
37
- private debugToggleHandler;
38
- private destroyHandler;
39
- private renderTimeMs;
40
- private readbackTimeMs;
41
- private totalDrawTimeMs;
42
- private renderMethod;
43
- get aspectRatio(): number;
44
- constructor(cliRenderer: CliRenderer, options: ThreeCliRendererOptions);
45
- toggleDebugStats(): void;
46
- init(): Promise<void>;
47
- getSuperSampleAlgorithm(): SuperSampleAlgorithm;
48
- setSuperSampleAlgorithm(superSampleAlgorithm: SuperSampleAlgorithm): void;
49
- saveToFile(filePath: string): Promise<void>;
50
- setActiveCamera(camera: PerspectiveCamera | OrthographicCamera): void;
51
- getActiveCamera(): PerspectiveCamera | OrthographicCamera;
52
- setBackgroundColor(color: RGBA): void;
53
- setSize(width: number, height: number, forceUpdate?: boolean): void;
54
- drawScene(root: Scene, buffer: OptimizedBuffer, deltaTime: number): Promise<void>;
55
- private rendering;
56
- private destroyed;
57
- doDrawScene(root: Scene, camera: PerspectiveCamera | OrthographicCamera, buffer: OptimizedBuffer, deltaTime: number): Promise<void>;
58
- toggleSuperSampling(): void;
59
- renderStats(buffer: OptimizedBuffer): void;
60
- destroy(): void;
61
- }
@@ -1,71 +0,0 @@
1
- import * as THREE from "three";
2
- import { NodeMaterial } from "three/webgpu";
3
- import type { TiledSprite, SpriteDefinition, SpriteAnimator } from "./SpriteAnimator.js";
4
- import type { SpriteResource } from "../SpriteResourceManager.js";
5
- export interface ExplosionEffectParameters {
6
- numRows: number;
7
- numCols: number;
8
- durationMs: number;
9
- strength: number;
10
- strengthVariation: number;
11
- gravity: number;
12
- gravityScale: number;
13
- fadeOut: boolean;
14
- angularVelocityMin: THREE.Vector3;
15
- angularVelocityMax: THREE.Vector3;
16
- initialVelocityYBoost: number;
17
- zVariationStrength: number;
18
- materialFactory: () => NodeMaterial;
19
- }
20
- export declare const DEFAULT_EXPLOSION_PARAMETERS: ExplosionEffectParameters;
21
- export interface ExplosionCreationData {
22
- resource: SpriteResource;
23
- frameUvOffset: THREE.Vector2;
24
- frameUvSize: THREE.Vector2;
25
- spriteWorldTransform: THREE.Matrix4;
26
- }
27
- export interface SpriteRecreationData {
28
- definition: SpriteDefinition;
29
- currentTransform: {
30
- position: THREE.Vector3;
31
- quaternion: THREE.Quaternion;
32
- scale: THREE.Vector3;
33
- };
34
- }
35
- export interface ExplosionHandle {
36
- readonly effect: ExplodingSpriteEffect;
37
- readonly recreationData: SpriteRecreationData;
38
- hasBeenRestored: boolean;
39
- restoreSprite: (spriteAnimator: SpriteAnimator) => Promise<TiledSprite | null>;
40
- }
41
- export declare class ExplodingSpriteEffect {
42
- private static baseMaterialCache;
43
- private scene;
44
- private resource;
45
- private frameUvOffset;
46
- private frameUvSize;
47
- private spriteWorldTransform;
48
- private params;
49
- private instancedMesh;
50
- private material;
51
- private numParticles;
52
- private uniformRefs;
53
- isActive: boolean;
54
- private timeElapsedMs;
55
- constructor(scene: THREE.Scene, resource: SpriteResource, frameUvOffset: THREE.Vector2, frameUvSize: THREE.Vector2, spriteWorldTransform: THREE.Matrix4, userParams?: Partial<ExplosionEffectParameters>);
56
- private _createGPUParticles;
57
- private _createGPUMaterial;
58
- static _buildTemplateMaterial(texture: THREE.DataTexture, params: ExplosionEffectParameters, materialFactory: () => NodeMaterial): NodeMaterial;
59
- update(deltaTimeMs: number): void;
60
- dispose(): void;
61
- }
62
- export declare class ExplosionManager {
63
- private scene;
64
- private activeExplosions;
65
- constructor(scene: THREE.Scene);
66
- fillPool(resource: SpriteResource, count: number, params?: Partial<ExplosionEffectParameters>): void;
67
- private _createEffectCreationData;
68
- createExplosionForSprite(spriteToExplode: TiledSprite, userParams?: Partial<ExplosionEffectParameters>): ExplosionHandle | null;
69
- update(deltaTimeMs: number): void;
70
- disposeAll(): void;
71
- }
@@ -1,76 +0,0 @@
1
- import * as THREE from "three";
2
- import { NodeMaterial } from "three/webgpu";
3
- import type { TiledSprite, SpriteDefinition, SpriteAnimator } from "./SpriteAnimator.js";
4
- import type { PhysicsWorld } from "../physics/physics-interface.js";
5
- import type { SpriteResource } from "../SpriteResourceManager.js";
6
- export interface PhysicsExplosionEffectParameters {
7
- numRows: number;
8
- numCols: number;
9
- durationMs: number;
10
- explosionForce: number;
11
- forceVariation: number;
12
- torqueStrength: number;
13
- gravityScale: number;
14
- fadeOut: boolean;
15
- linearDamping: number;
16
- angularDamping: number;
17
- restitution: number;
18
- friction: number;
19
- density: number;
20
- materialFactory: () => NodeMaterial;
21
- }
22
- export declare const DEFAULT_PHYSICS_EXPLOSION_PARAMETERS: PhysicsExplosionEffectParameters;
23
- export interface PhysicsExplosionCreationData {
24
- resource: SpriteResource;
25
- frameUvOffset: THREE.Vector2;
26
- frameUvSize: THREE.Vector2;
27
- spriteWorldTransform: THREE.Matrix4;
28
- }
29
- export interface PhysicsSpriteRecreationData {
30
- definition: SpriteDefinition;
31
- currentTransform: {
32
- position: THREE.Vector3;
33
- quaternion: THREE.Quaternion;
34
- scale: THREE.Vector3;
35
- };
36
- }
37
- export interface PhysicsExplosionHandle {
38
- readonly effect: PhysicsExplodingSpriteEffect;
39
- readonly recreationData: PhysicsSpriteRecreationData;
40
- hasBeenRestored: boolean;
41
- restoreSprite: (spriteAnimator: SpriteAnimator) => Promise<TiledSprite | null>;
42
- }
43
- export declare class PhysicsExplodingSpriteEffect {
44
- private static materialCache;
45
- private scene;
46
- private physicsWorld;
47
- private resource;
48
- private frameUvOffset;
49
- private frameUvSize;
50
- private spriteWorldTransform;
51
- private params;
52
- private particles;
53
- private numParticles;
54
- private instancedMesh;
55
- private material;
56
- private uvOffsetAttribute;
57
- isActive: boolean;
58
- private timeElapsedMs;
59
- private particleIdCounter;
60
- constructor(scene: THREE.Scene, physicsWorld: PhysicsWorld, resource: SpriteResource, frameUvOffset: THREE.Vector2, frameUvSize: THREE.Vector2, spriteWorldTransform: THREE.Matrix4, userParams?: Partial<PhysicsExplosionEffectParameters>);
61
- private _createPhysicsParticles;
62
- static getSharedMaterial(texture: THREE.DataTexture, materialFactory: () => NodeMaterial): NodeMaterial;
63
- update(deltaTimeMs: number): void;
64
- dispose(): void;
65
- }
66
- export declare class PhysicsExplosionManager {
67
- private scene;
68
- private physicsWorld;
69
- private activeExplosions;
70
- constructor(scene: THREE.Scene, physicsWorld: PhysicsWorld);
71
- fillPool(resource: SpriteResource, count: number, params?: Partial<PhysicsExplosionEffectParameters>): void;
72
- private _createEffectCreationData;
73
- createExplosionForSprite(spriteToExplode: TiledSprite, userParams?: Partial<PhysicsExplosionEffectParameters>): Promise<PhysicsExplosionHandle | null>;
74
- update(deltaTimeMs: number): void;
75
- disposeAll(): void;
76
- }