JustMeSander Posted July 29, 2016 Share Posted July 29, 2016 This worked for me! (typescript) it requires https://github.com/stackgl/headless-gl Bit hackish but it works also with collision. GLOBAL.window = {}; GLOBAL.window.addEventListener = () => {}; GLOBAL.navigator = {}; GLOBAL.document = {}; GLOBAL.document.addEventListener = () => {}; GLOBAL.window.setTimeout = setTimeout; export class HTMLElement { } var gl = require('gl')(10, 10, {}) var engine = new BABYLON.Engine({ getContext: function() { return gl; }, addEventListener: () => {} }); var scene = new BABYLON.Scene(engine); var scene.collisionsEnabled = true; var camera = new BABYLON.FreeCamera('camera', BABYLON.Vector3.Zero(), scene); var ground = BABYLON.Mesh.CreateGround('ground', 10, 10, 20, this.scene); engine.runRenderLoop(function() { scene.render(); }); adam, jsdream, ozRocker and 1 other 4 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.