Use ammo.js.
Then use btBoxShape, btSphereShape, and btConvexHullShape to define your collision shape.
Some of my code as example:
addShape(shape: any, x: number, y: number, z: number, mass: number, rotation: number, rad?: number): Ammo.btRigidBody {
this._transform.setIdentity();
this._transform.setOrigin(new Ammo.btVector3(x, y, z));
let inertia = new Ammo.btVector3(0, 0, 0);
if (mass != 0) shape.calculateLocalInertia(mass, inertia);
let motion = new Ammo.btDefaultMotionState(this._transform, this._identity);
let info = new Ammo.btRigidBodyConstructionInfo(mass, motion, shape, inertia);
let body = new Ammo.btRigidBody(info);
body.setUserIndex(this._bodyIndex++);
if (rad) { // sphere
body.setRestitution(0.9);
body.setFriction(0.9);
body.setDamping(0.1, 0.1);
body.setActivationState(4); //Ammo.btCollisionObject.DISABLE_DEACTIVATION);
}
else {
body.setRestitution(0.1);
body.setFriction(0.5);
}
if (rotation != 0) {
this._quaternion.setEulerZYX(rotation * 0.0174533, 0, 0); // y, x, z / yaw, pitch, roll
this._transform.setRotation(this._quaternion);
body.setCenterOfMassTransform(this._transform);
}
this._world.addRigidBody(body);
return body;
}