1

I have a server running Node.js. For that server I have used Box2d lib to simulated 2D physics. Looks like

npm install box2d

installs this: https://github.com/jadell/box2dnode But this is very obsolete and does not coincide with original Box2d API which was written in C++.

In this question people advice to use https://github.com/kripken/box2d.js but I am new to Node.js and I don't know how to use Box2D with Node. I have wrote

const Box2D = require('./js/box2d/Box2D_v2.3.1_min.js');

but his does not recognize b2Vec2 type in here:

let gravity = new Box2D.b2Vec2(0, -9.81); 

What is the correct way to use Kripek's box2d with Node.JS?

Narek
  • 38,779
  • 79
  • 233
  • 389

1 Answers1

-1

you might want to look at https://www.npmjs.com/package/box2d on how to use it

Michel Vorwieger
  • 692
  • 5
  • 14
  • No this is for the version you get when you write `npm install box2d` but this version is shity. I want this version as advised in stackoverflow https://github.com/kripken/box2d.js – Narek Apr 15 '19 at 13:08