Browse Source

Merge pull request #19686 from Mugen87/dev49

Examples: Modularize usage of cannon.js.
Mr.doob 5 years ago
parent
commit
5f7c3c61e7

File diff suppressed because it is too large
+ 23 - 0
examples/jsm/libs/cannon.module.min.js


+ 12 - 0
examples/jsm/physics/CannonPhysics.d.ts

@@ -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;
+
+}

+ 2 - 0
examples/jsm/physics/CannonPhysics.js

@@ -1,3 +1,5 @@
+import CANNON from "../libs/cannon.module.min.js";
+
 /**
  * @author mrdoob / http://mrdoob.com/
  */

+ 0 - 1
examples/physics_cannon_instancing.html

@@ -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';

Some files were not shown because too many files changed in this diff