Wingnut Posted June 15, 2015 Share Posted June 15, 2015 Hi gang! Hey, does anyone know the reasoning/purpose behind mesh.getEmittedParticleSystems() and mesh.getHierarchyEmittedParticleSystems()? I understand WHAT they do, but who needs this? Why? Does anyone know? These two functions "feel" dirty to me... like they don't belong. Does anyone else feel this? Should I care about this feeling? I don't know if the same mesh can be used for multiple VLS/godray emitters, but if so, then we should have parallel functions like... mesh.getEmittedVLSSystems() and mesh.getHierarchyEmittedVLSSystems(), yes? And what about clones and instances? mesh.getClones() and mesh.getHierarchyClones() and... mesh.getInstances() and mesh.getHierarchyInstances() There may be even more funcs that could be in-parallel, too. Thinkin'. I'm thinkin' we should say goodbye to those "list which particleSystems I am an emitter-for" functions. They don't feel right. Thoughts, anyone? thx Addenda: mesh.getChildren() is in the same flavor, eh? Do we need a mesh.getHierarchyChildren() ... so we can find the grand-children and great-grand-children? hmm. Returned in arrays of arrays of arrays, maintaining its heirarchy? I'm scared! I've never liked methods that go out asking everymesh "which of you has referred to me somehow?". Feels back-referenc-ish, whatever that means. It feels like the user should write those "searchers" in his/her code, and they should not be part of the framework code. Or it belongs in Tools, or something. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 16, 2015 Share Posted June 16, 2015 I can't just remember why I added these functions Quote Link to comment Share on other sites More sharing options...
gryff Posted July 6, 2015 Share Posted July 6, 2015 mesh.getInstances() and mesh.getHierarchyInstances() When I try mesh.getInstances(), I get an error message of this type : mesh.getInstances is not a function. I looked in the docs for "getInstances" - found nothing. So, am I correct in assuming there is no such function of this type that will allow me to get instanced meshes?? cheers, gryff Quote Link to comment Share on other sites More sharing options...
gryff Posted July 6, 2015 Share Posted July 6, 2015 Ok , I solved it with this type of code:var theInstances = mesh.instances; cheers, gryff Quote Link to comment Share on other sites More sharing options...
Wingnut Posted July 6, 2015 Author Share Posted July 6, 2015 http://playground.babylonjs.com/#21ST7D line 35... sphere.getInstances()... working fine! Why couldn't you find it? What's wrong with you?! I'm just having fun, of course. I created a getInstances() in line 3, as everyone can plainly see. (I'm entertained by the little things, ya know?) Alright G! Ya found mesh.instances property... well done. That'll work. When I mentioned mesh.getClones() and mesh.getHierarchyClones() and mesh.getInstances() and mesh.getHierarchyInstances(), I was sort of saying "Why aren't they there? Where are they?" Yep, we (I) didn't consider the possibility of it being a good ol' fashioned property and not having a getter function. Sorry for leading you on a wild goose chase with my comment. I was dreaming and speculating. gryff 1 Quote Link to comment Share on other sites More sharing options...
gryff Posted July 6, 2015 Share Posted July 6, 2015 No big deal Wingy - you keep dreaming, speculating and making playground demos - can only improve BJS As you will see from my two posts, I found an answer within a few minutes - and all by myself cheers, gryff Wingnut 1 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.