Examples: Modularize usage of cannon.js.
@@ -0,0 +1,12 @@
+import {
+ Mesh,
+ Vector3
+} from '../../../src/Three';
+
+export class CannonPhysics {
+ constructor();
+ addMesh( mesh: Mesh, mass: number ): void;
+ setMeshPosition( mesh: Mesh, position: Vector3, index: number ): void;
+}
@@ -1,3 +1,5 @@
+import CANNON from "../libs/cannon.module.min.js";
/**
* @author mrdoob / http://mrdoob.com/
*/
@@ -12,7 +12,6 @@
<a href="https://threejs.org" target="_blank" rel="noopener">three.js</a> physics - cannon.js instancing
</div>
- <script src="./js/libs/cannon.js"></script>
<script type="module">
import * as THREE from '../build/three.module.js';