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
-
Install Ammo.js
npm install kripken/ammo.js --save
-
Import the package into your component file
// @ts-ignore
import { default as Ammo } from 'ammo.js/builds/ammo';
Ammo();
- Load the physics plugin
const gravityVector = new Vector3(0, 0, 0);
const physicsPlugin = new AmmoJSPlugin(false);
scene.enablePhysics(gravityVector, physicsPlugin);
3 Likes