@mcptoolshop/physics-svg
v0.1.1
Published
Deterministic 2D physics engine with SVG rendering for web games and simulations
Downloads
93
Readme
@mcptoolshop/physics-svg
Deterministic 2D physics engine with SVG rendering for web games and simulations.
Part of the siege-kit monorepo.
Install
npm install @mcptoolshop/physics-svgUsage
import { createWorld, step } from '@mcptoolshop/physics-svg';
const world = createWorld({ gravity: [0, 9.81] });
// Add bodies, step the simulation, render to SVGWith React
import { PhysicsCanvas } from '@mcptoolshop/physics-svg/react';
function App() {
return <PhysicsCanvas width={800} height={600} />;
}Features
- Deterministic simulation: Same inputs always produce the same outputs
- SVG rendering: Crisp vector graphics at any resolution
- React bindings: Optional
@mcptoolshop/physics-svg/reactentry point - GSAP integration: Optional GSAP-powered animations
- Tree-shakeable: Only import what you use
Peer Dependencies
| Package | Required | Version |
|---------|----------|---------|
| react | Optional | >= 18 |
| react-dom | Optional | >= 18 |
| gsap | Optional | >= 3 |
Links
License
MIT
