andrej3579 Posted November 15, 2015 Share Posted November 15, 2015 Hello! I have a problem with using map made in Blender. Everything is working when I am using a map made out of just one plane with textures. But when I use this one, which consists of different objects and multiple textures, it shows a this._world is undefined error. Everything works just fine when using Sandbox. I really don`t understand what is the problem. You can access the file here: https://www.dropbox.com/s/6od5tp9ppg06o42/Blender.zip?dl=0 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 15, 2015 Share Posted November 15, 2015 Hello and welcome! If this works with the sandbox then you have an issue in your code:) can you reproduce it in the playground? Quote Link to comment Share on other sites More sharing options...
gryff Posted November 15, 2015 Share Posted November 15, 2015 Welcome to the BJS forum Andre I downloaded your file and it does work in the sandbox. So I tested it on my local server using the very simplest of code in the body of my HTML file:<script> if (BABYLON.Engine.isSupported()) { var canvas = document.getElementById("renderCanvas"); var engine = new BABYLON.Engine(canvas, true); BABYLON.SceneLoader.Load("", "RealMap11.babylon", engine, function (newScene) { // Wait for textures and shaders to be ready newScene.executeWhenReady(function () { var myCamera2 = newScene.getCameraByName("Camera"); myCamera2.speed = .2; myCamera2.checkCollisions = true; newScene.activeCamera = myCamera2; // Attach camera to canvas inputs newScene.activeCamera.attachControl(canvas); // Once the scene is loaded, just register a render loop to render it engine.runRenderLoop(function() { newScene.render(); }); }); }, function (progress) { // To do: give progress feedback to user }); } // Resize window.addEventListener("resize", function () { engine.resize(); }); </script> When I try to run it I get this error: ReferenceError: OIMO is not defined This suggests to me that BJS is looking for oimo.js to handle physics operations. Is it included along with babylon.js in your HTML page header ? Looking at your .babylon file it does contain code like this:{"name":"Plane","id":"Plane","materialId":"RealMap11.Multimaterial#1","billboardMode":0,"position":[0,0,0],"rotation":[0,0,0],"scaling":[1,1,1],"isVisible":true,"freezeWorldMatrix":false,"isEnabled":true,"useFlatShading":false,"checkCollisions":true,"receiveShadows":false,"physicsImpostor":8,"physicsMass":0,"physicsFriction":0.5,"physicsRestitution":0 .....I'm not sure of the current level of supoort for physics functionality that gets exported from Blender. Maybe JCPalmer and others can provide more info. cheers, gryff Quote Link to comment Share on other sites More sharing options...
gryff Posted November 15, 2015 Share Posted November 15, 2015 Andre, I added a script reference to Oimo.js in the head tag of my basic simple HTML file like this:<script src ="../Oimo.js"></script>and your scene now works fine RealMap cheers, gryff Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 15, 2015 Share Posted November 15, 2015 Even with collisons already... nice...and it looks pretty cool. Reminds me of the micro machines game... ah... good times. Quote Link to comment Share on other sites More sharing options...
andrej3579 Posted November 15, 2015 Author Share Posted November 15, 2015 Woow so simple...its working! Thank you all for your help! Thanks iiceman, I appreciate it! I have imported physics as a mesh, and now mesh to mesh collision is not working as my character can walk through objects. Could anyone give me some further advice on what could be the problem? Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 15, 2015 Share Posted November 15, 2015 Since collisions with the camera worked just fine in gryffs link the only thing I could think of would be that you didn't set "checkCollisions = true" on your character.. But that's just a wild guess. Maybe try your setup first in the playground without any imported meshes, just the plain old primitive shapes like spheres and boxes. If you can show a problem in the playground it's much easier to find a solution. Quote Link to comment Share on other sites More sharing options...
andrej3579 Posted November 16, 2015 Author Share Posted November 16, 2015 Thank you for your help! I put primitive plane on the same position as an imported object and its working. But is there any way to do it without putting invisible primitive boxes or planes around all imported objects in my map? 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.