How can I use Ammo.js with Create-React-App?

Feel free to give advice.
I have a solution that I’m going provide in a follow up post.

Steps I took to get Ammo.js running with Create-React-App

  1. Install Ammo.js
    npm install kripken/ammo.js --save

  2. Import the package into your component file

// @ts-ignore
import { default as Ammo } from 'ammo.js/builds/ammo';
Ammo();
  1. Load the physics plugin
const gravityVector = new Vector3(0, 0, 0);
const physicsPlugin = new AmmoJSPlugin(false);
scene.enablePhysics(gravityVector, physicsPlugin);
2 Likes