npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@colossum/physics

v0.1.0

Published

Colossum Physics: a browser-first Box3D WebAssembly runtime with SIMD, pthread scaling, batched body creation, convex hulls, height fields, and a packed WebGPU pose bridge.

Readme

Colossum Physics

Colossum Physics is a browser-first rigid-body runtime built on pinned Box3D WebAssembly. It combines batched body and shape creation, reusable convex hulls, height fields, deterministic fixed-step simulation, SIMD and pthread variants, and one packed WebGPU pose upload per simulation generation.

Install

npm install @colossum/physics
npx colossum-physics-assets public/colossum-physics

The asset command copies the verified Emscripten modules, WebAssembly binaries, and manifest into the same-origin public directory expected by the runtime. Commit those assets or run the command as part of your application's build.

Quick start

import { createPhysicsRuntime } from "@colossum/physics";

const runtime = await createPhysicsRuntime({
  // Defaults to /colossum-physics/manifest.json after copying the assets.
  variant: "auto",
});

const world = runtime.createWorld({
  capacity: 2_001,
  visualCapacity: 2_001,
  gravity: [0, -9.81, 0],
});

const [body] = world.createBodies({
  bodies: [{
    motionType: "dynamic",
    position: [0, 4, 0],
    shape: { kind: "box", halfExtents: [0.5, 0.5, 0.5] },
    density: 1,
  }],
});

world.step(1 / 60, { substeps: 4 });
const render = world.syncPosesForFrame(device);

// Bind render.posePrevious, render.poseCurrent, and render.visualToBody.

world.destroyBody(body);
world.destroy();
runtime.destroy();

The browser never queries transforms one body at a time. A normal simulation frame performs one world step, one packed-pose operation, and at most one contiguous GPUQueue.writeBuffer call. Render-only frames reuse the GPU-resident previous/current pose buffers.

Runtime assets and pthread requirements

The threaded variants create Web Workers and shared WebAssembly memory. Serve the application page and the copied /colossum-physics/ directory from the same origin. The application response must include:

Cross-Origin-Opener-Policy: same-origin
Cross-Origin-Embedder-Policy: require-corp

Without cross-origin isolation, automatic selection falls back to the single-thread SIMD artifact. The package contains these verified fixed-memory variants:

  • SIMD, single thread;
  • SIMD + pthreads, four total Box3D workers;
  • SIMD + pthreads, eight total Box3D workers as an explicit scaling option.

Pthread artifacts use one preallocated worker pool and allow one live world at a time. Destroy the world before creating its replacement. The single-thread runtime supports multiple live worlds up to the configured limit.

Public API

The public surface includes:

  • createPhysicsRuntime and deterministic variant selection;
  • fixed-capacity PhysicsWorld lifecycle;
  • batched boxes, spheres, capsules, cylinders, and reusable convex hulls;
  • height-field terrain;
  • generation-safe body and hull handles;
  • fixed-step simulation and packed WebGPU pose synchronization;
  • typed diagnostics and failures.

See the API field manual and the live capability playground.

Browser support

Colossum Physics requires WebAssembly SIMD. The packed pose bridge additionally requires WebGPU. Pthread selection requires SharedArrayBuffer, cross-origin isolation, and enough logical processors for the selected worker count.

License

Colossum Physics is available under the MIT License. Box3D and toolchain notices are included in THIRD_PARTY_NOTICES.md.