# @polygonjs/plugin-physics

> Physics plugin for the 3D engine https://polygonjs.com

Latest version **1.1.257** (published 2022-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @polygonjs/plugin-physics
pnpm add @polygonjs/plugin-physics
yarn add @polygonjs/plugin-physics
bun add @polygonjs/plugin-physics
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.257 |
| Published | 2022-04-27 |
| First published | 2021-01-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=12.16.1 |
| Dependencies | 2 |
| Unpacked size | 17.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Guillaume Fradin |
| Maintainers | polygonjs |
| Keywords | 3D, javascript, webgl, procedural, node-based, physics, animation, ammo.js |

## Links

- npm: https://www.npmjs.com/package/@polygonjs/plugin-physics
- Repository: https://github.com/polygonjs/plugin-physics
- Homepage: https://github.com/polygonjs/plugin-physics#readme
- Issues: https://github.com/polygonjs/plugin-physics/issues
- npm.io page: https://npm.io/package/@polygonjs/plugin-physics

## Dependencies (2)

- [ammojs-typed](https://npm.io/package/ammojs-typed.md) 1.0.6
- [@polygonjs/polygonjs](https://npm.io/package/@polygonjs/polygonjs.md) ^1.1.257

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 1.1.257 (latest) — 2022-04-27
- 1.1.246-2 — 2022-03-28
- 1.1.246-1 — 2022-03-28
- 1.1.218-2 — 2022-01-25
- 1.1.218 — 2022-01-25
- 1.0.11 — 2021-04-24
- 1.0.10 — 2021-04-24
- 1.0.9 — 2021-04-21
- 1.0.8 — 2021-04-21
- 1.0.6 — 2021-04-05
- 1.0.5 — 2021-04-03
- 1.0.4 — 2021-03-29
- 1.0.3 — 2021-02-15
- 1.0.2 — 2021-02-08
- 1.0.1 — 2021-01-28
- … 1 more at https://npm.io/package/@polygonjs/plugin-physics/versions

## README

# Polygonjs Physics Plugin

This adds several nodes to handle physics in the [Polygonjs webgl engine](https://polygonjs.com).

-   **Sop/PhysicsSolver**: computes the input geometries and attributes and solves the simulation at every frame
-   **Sop/PhysicsRbdAttributes**: creates attributes necessary for rigid body simulations
-   **Sop/PhysicsForceAttributes**: creates attributes to define forces

This is currently using Ammo from [https://github.com/giniedp/ammojs-typed](https://github.com/giniedp/ammojs-typed).

See [example scene](https://github.com/polygonjs/example-plugin-physics):

![scene with physics](https://github.com/polygonjs/example-plugin-physics/blob/main/doc/physics_examples.jpg?raw=true)

# Install

Import the plugin:

`yarn add @polygonjs/plugin-physics`

And register the plugin in the function `configurePolygonjs` in the file `PolyConfig.js` so that the physics nodes can be accessible in both the editor and your exported scene:

```js
import {polyPluginPhysics} from '@polygonjs/plugin-physics/dist/src/index';

export function configurePolygonjs(poly) {
	poly.registerPlugin(polyPluginPhysics);
}
```

---
_Source: https://npm.io/package/@polygonjs/plugin-physics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
