@opentui/three 0.3.4 → 0.4.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/index.js CHANGED
@@ -8,7 +8,6 @@ import { CliRenderEvents, RGBA as RGBA2 } from "@opentui/core";
8
8
  // src/canvas.ts
9
9
  import { GPUCanvasContextMock } from "bun-webgpu";
10
10
  import { RGBA } from "@opentui/core";
11
- import { toArrayBuffer } from "bun:ffi";
12
11
  import { Jimp } from "jimp";
13
12
 
14
13
  // src/shaders/supersampling.wgsl
@@ -531,7 +530,7 @@ class CLICanvas {
531
530
  this.superSampleDrawTimeMs = performance.now() - ssStart;
532
531
  } else {
533
532
  this.superSampleDrawTimeMs = 0;
534
- const pixelData = new Uint8Array(toArrayBuffer(bufPtr, 0, textureBuffer.size));
533
+ const pixelData = new Uint8Array(textureBuffer.getMappedRange());
535
534
  const isBGRA = contextFormat === "bgra8unorm";
536
535
  const backgroundColor = RGBA.fromValues(0, 0, 0, 1);
537
536
  for (let y = 0;y < this.height; y++) {
@@ -2664,7 +2663,7 @@ class PhysicsExplosionManager {
2664
2663
  }
2665
2664
  }
2666
2665
  // src/physics/RapierPhysicsAdapter.ts
2667
- import RAPIER from "@dimforge/rapier2d-simd-compat";
2666
+ import * as RAPIER from "@dimforge/rapier2d-simd-compat/rapier.es.js";
2668
2667
 
2669
2668
  class RapierRigidBody {
2670
2669
  rapierBody;
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.3.4",
7
+ "version": "0.4.0",
8
8
  "description": "Three.js WebGPU renderer for OpenTUI",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -25,7 +25,7 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@opentui/core": "0.3.4",
28
+ "@opentui/core": "0.4.0",
29
29
  "jimp": "1.6.1",
30
30
  "three": "0.177.0"
31
31
  },
@@ -1,19 +1,19 @@
1
- import RAPIER from "@dimforge/rapier2d-simd-compat";
1
+ import type { RigidBody, World } from "@dimforge/rapier2d-simd-compat";
2
2
  import type { PhysicsVector2, PhysicsRigidBodyDesc, PhysicsColliderDesc, PhysicsRigidBody, PhysicsWorld } from "./physics-interface.js";
3
3
  export declare class RapierRigidBody implements PhysicsRigidBody {
4
4
  private rapierBody;
5
- constructor(rapierBody: RAPIER.RigidBody);
5
+ constructor(rapierBody: RigidBody);
6
6
  applyImpulse(force: PhysicsVector2): void;
7
7
  applyTorqueImpulse(torque: number): void;
8
8
  getTranslation(): PhysicsVector2;
9
9
  getRotation(): number;
10
- get nativeBody(): RAPIER.RigidBody;
10
+ get nativeBody(): RigidBody;
11
11
  }
12
12
  export declare class RapierPhysicsWorld implements PhysicsWorld {
13
13
  private rapierWorld;
14
- constructor(rapierWorld: RAPIER.World);
14
+ constructor(rapierWorld: World);
15
15
  createRigidBody(desc: PhysicsRigidBodyDesc): PhysicsRigidBody;
16
16
  createCollider(colliderDesc: PhysicsColliderDesc, rigidBody: PhysicsRigidBody): void;
17
17
  removeRigidBody(rigidBody: PhysicsRigidBody): void;
18
- static createFromRapierWorld(rapierWorld: RAPIER.World): RapierPhysicsWorld;
18
+ static createFromRapierWorld(rapierWorld: World): RapierPhysicsWorld;
19
19
  }