NasimiAsl Posted May 1, 2016 Share Posted May 1, 2016 how can change BoundingBox Size (manual) i make a mesh and change a vertex position when i move camera ( camera not see bounding box ) the mesh is hidden ? Quote Link to comment Share on other sites More sharing options...
adam Posted May 1, 2016 Share Posted May 1, 2016 Did you try refreshBoundingInfo() ? Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 1, 2016 Author Share Posted May 1, 2016 i dont want recalculate BondingBox I wanna Set it Custom Quote Link to comment Share on other sites More sharing options...
adam Posted May 1, 2016 Share Posted May 1, 2016 create a new BoundingBox(min, max) BoundingInfo(min, max)? You can try setting the minimum and maximum of the existing bounding box, but I'm thinking that probably won't work. Quote Link to comment Share on other sites More sharing options...
jerome Posted May 1, 2016 Share Posted May 1, 2016 I'm afraid this is the only way : creating a new one BoundingBox you can't change the current one. Quote Link to comment Share on other sites More sharing options...
adam Posted May 1, 2016 Share Posted May 1, 2016 You can also just set alwaysSelectAsActiveMesh of the mesh to true if performance is not an issue and you don't need the bounding box for anything else. Quote Link to comment Share on other sites More sharing options...
jerome Posted May 1, 2016 Share Posted May 1, 2016 If you want to set it to your own size, check this out : https://github.com/BabylonJS/Babylon.js/blob/master/src/Particles/babylon.solidParticleSystem.ts#L746 Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted May 1, 2016 Author Share Posted May 1, 2016 thanks @jerome hi i use this mesh._boundingInfo = new BoundingInfo(new Vector3(-5000, -5000, -5000), new Vector3(5000, 5000, 5000)); but don't change anything but this solve my problem mesh.alwaysSelectAsActiveMesh = true; Quote Link to comment Share on other sites More sharing options...
jerome Posted May 1, 2016 Share Posted May 1, 2016 as far as I know, the bounding box is recomputed each time the world matrix changes, so setting a new created bounding box manually should be done at the right moment 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.