Socket
Socket
Sign inDemoInstall

antikyth

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

antikyth

Bullet Physics 3 server for node.js. Designed for multiple realtime clients.


Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

Antikyth

Bullet Physics 3 server for node.js. Designed for multiple realtime clients.

Runs at native C++ speed in a dedicated process, so this is probably the fastest physics you can get for node. This is not an emscripten build, and does not run in the browser. If that's what you want, you're probably looking for ammo.js.

This also does not include any rendering, only the backend number crunching. If you want rendering, you probably want to plug this into a THREE.js frontend.

Install

npm install antikyth

Example

const Antikyth = require('.');

// initialize new physics engine

const engine = new Antikyth();

// initialize new world

const world = new Antikyth.World();
engine.add(world);

// add some bodies

const floor = new Antikyth.Plane({
  position: [0, 0, 0],
  dimensions: [0, 1, 0],
  mass: 0,
});
world.add(floor);

const box = new Antikyth.Box({
  position: [0, 2, 0],
  rotation: [Math.PI / 8, 0, 0, 1],
  dimensions: [1, 1, 1],
  mass: 1,
});
world.add(box);

// request engine updates at 60 FPS

setInterval(() => {
  engine.requestUpdate();
}, 1000 / 60);

// log updates to console

box.on('update', ({position: [px, py, pz], rotation: [rx, ry, rz, rw]}) => {
  console.log('box', px, py, pz);
});

// start running

engine.start();

FAQs

Package last updated on 14 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc