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?