# oimophysics

> A lightweight 3D physics engine.

Latest version **1.2.2** (published 2020-03-02) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install oimophysics
pnpm add oimophysics
yarn add oimophysics
bun add oimophysics
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2020-03-02 |
| First published | 2020-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 960 |
| Author | saharan |
| Maintainers | oleksiimaksymovvbt |
| Keywords | oimo, physics, oimophysics, oimo.js |

## Links

- npm: https://www.npmjs.com/package/oimophysics
- Repository: https://github.com/saharan/OimoPhysics
- Homepage: https://github.com/saharan/OimoPhysics#readme
- Issues: https://github.com/saharan/OimoPhysics/issues
- npm.io page: https://npm.io/package/oimophysics

## Recent versions

- 1.2.2 (latest) — 2020-03-02
- 1.2.1 — 2020-03-01

## README

OimoPhysics 1.2.5
---

A lightweight 3D physics engine.

![License: MIT](https://img.shields.io/badge/License-MIT-green.svg) [![npm version](https://badge.fury.io/js/oimophysics.svg)](https://badge.fury.io/js/oimophysics)

## [API Documentation](https://saharan.github.io/OimoPhysics/)

## Demos
<a href="https://el-ement.com/etc/oimo/demos/"><img src="https://el-ement.com/etc/oimo/demos/thumbnail.png"></a>
* Press `E` or `Q` to change demos
* Click or tap texts on the left to control

## Platforms
* Written in Haxe
* Exported as JavaScript (see [bin/js/](./bin/js))
	* Public classes and methods are exposed through `window.OIMO`.
	* e.g. `new OIMO.Vec3(1, 2, 3)` to create an instance of `Vec3` class.
* Exported as JavaScript (module) with TypeScript Declaration (see [package.json](./package.json) and [bin/js_modules](./bin/js_modules))

## Features
* Rigid body with motion types
	* Dynamic
	* Static
	* Kinematic
* Fast collision detection with bounding volume hierarchy (BVH)
* Contacts with friction and restitution
* Collision geometries
	* Sphere
	* Box
	* Cylinder
	* Cone
	* Capsule
	* Convex hull
* Joints with springs, limits and motors
	* Spherical (a.k.a. ball and socket, point to point)
	* Revolute (a.k.a. hinge)
	* Cylindrical
	* Prismatic (a.k.a. slider)
	* Universal
	* Ragdoll (a.k.a. cone twist, character)
	* Generic (a.k.a. 6-DoF joint)
* Breakable joints
* Constraint solvers
	* Direct block MLCP solver
	* Projected Gauss-Seidel solver
* Sleepings with island splittings
* Rotation limits
* Collision event callbacks
* Collision filterings
* Collision queries
	* AABB query
	* Ray casting
	* Convex casting

## Compilations
Haxe 4.3.4 or later is required.
* Use `build-js.hxml` to compile for JavaScript library.
* Use `build-js-demos.hxml` to compile JavaScript demos.
* Use `build-doc.hxml` to generate API documentation. [dox](https://github.com/HaxeFoundation/dox) is required.
* Use `build-js-ts.hxml` to compile for JavaScript (modules) library with TypeScript declarations. Requires `hxtsdgen` library. Check comments in that file.

## License
The MIT License

---

### Old Version
* Written in ActionScript 3.0
* Supports spheres and boxes as collision shapes
* Supports various joints (ball and socket, distance, hinge, prismatic, etc...)
* Fast and stable collision solver
* Available in [old/](./old) directory

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