This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setupPhysicsWorld(){ | |
| let collisionConfiguration = new Ammo.btDefaultCollisionConfiguration(), | |
| dispatcher = new Ammo.btCollisionDispatcher(collisionConfiguration), | |
| overlappingPairCache = new Ammo.btDbvtBroadphase(), | |
| solver = new Ammo.btSequentialImpulseConstraintSolver(); | |
| physicsWorld = new Ammo.btDiscreteDynamicsWorld(dispatcher, overlappingPairCache, solver, collisionConfiguration); | |
| physicsWorld.setGravity(new Ammo.btVector3(0, -10, 0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>JS 3D Physics</title> | |
| <style> | |
| body { margin: 0; } | |
| </style> | |
| </head> | |
| <body> | |
| <script src="js/three.js"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function isGenerator(obj) { | |
| return 'function' == typeof obj.next && 'function' == typeof obj.throw; | |
| } | |
| function isGeneratorFunction(obj) { | |
| var constructor = obj.constructor; | |
| if (!constructor) return false; | |
| if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true; | |
| return isGenerator(constructor.prototype); |
NewerOlder