Kilombo Posted June 26, 2015 Share Posted June 26, 2015 Good morning everyone, I'm trying to return a mesh from one object to the main scope, something like.unit.prototype.getMesh = function(){ return this.mesh;}.....main scope:unit1 = new unit();..all the operations with the unit (load mesh, etc...)..console.log (unit1.getMesh());Problem is.... this doesn't work, returns undefined, but... if I put a console.log(this.mesh) on the getMesh method, I do get the mesh on the console. Strange..... The problem is.. I do need to return the mesh, because I need to test the intersection between that mesh and another one. Ideas anyone? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
Kilombo Posted June 26, 2015 Author Share Posted June 26, 2015 Forget it.. it's solved, it was something related to how javascript works. Javascript was actually trying to do getMesh() before the mesh was loaded, solved with a if (typeof !== undefined). But I still have a problem. The Blender imported meshes don't seem to have _boundinginfo. So i'm not beeing able to test the intersection. Is this a bug, or I really have to parent a new bounding box to the mesh? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 26, 2015 Share Posted June 26, 2015 It should have a bounding box...The loader takes care of it for you:https://github.com/BabylonJS/Babylon.js/blob/master/src/Loading/Plugins/babylon.babylonFileLoader.ts#L714 Quote Link to comment Share on other sites More sharing options...
Kilombo Posted June 26, 2015 Author Share Posted June 26, 2015 It should have a bounding box...The loader takes care of it for you:https://github.com/BabylonJS/Babylon.js/blob/master/src/Loading/Plugins/babylon.babylonFileLoader.ts#L714It has I wasn't doing right, I already posted another question about this. I'm not beeing able to put the intersect working with moveWithCollisions, something is missing, i'm doing something wrong, i just can't figure it out yet.Thanks anyway Delta. 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.