GameMonetize Posted November 13, 2017 Share Posted November 13, 2017 I know this was a big ask from the community so I'm glad to announce that we finally support TransformNode! They are node with position / scaling / rotation like any mesh but without all the rendering. So they are just here to add transformation to a hierarchy. Example: https://www.babylonjs-playground.com/#JT0HN4 @JohnKsorry my friend because this could require some update to the doc (even if by itself everything will keep working the same as before) inteja, Kesshi, JackFalcon and 6 others 9 Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 13, 2017 Share Posted November 13, 2017 I'm not sure this is the right PG. he presents the particle editor. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 13, 2017 Author Share Posted November 13, 2017 Woot Fixed Quote Link to comment Share on other sites More sharing options...
Dad72 Posted November 13, 2017 Share Posted November 13, 2017 Cool function. thanks for the TransformNode GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Wingnut Posted November 13, 2017 Share Posted November 13, 2017 " export class AbstractMesh extends TransformNode " mesh.transformManager = new BABYLON.TransformManager(scene); err... wait, no. But it looks like transformNode will be taking-over the rotation, position, and scaling duties... from abstractMesh. Work-load delegating! AbstractMesh was getting pooped-out too easily. Geritol costs are skyrocketing! heh. No sign of wedging transformNode into lights or cameras. Mesh only. Works for Quaternions, too! https://www.babylonjs-playground.com/#JT0HN4#1 PARTY! Looks like there might be physics plugin affects, too. (Wingy hides under his fridge.) (Wingy shakes transformNode's hand and welcomes him/her it to the framework). GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
inteja Posted November 13, 2017 Share Posted November 13, 2017 @Deltakosh why not more simply "Transform" instead of "TransformNode"? At least according to the Class documentation, "Transform" isn't currently in use and there doesn't seem to be much precedent for appending "Node" to other class names. Plus "Transform" has some nostalgia for me as it exists with almost identical functionality in VRML, X3D & Inventor. No big deal, just a suggestion. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 13, 2017 Author Share Posted November 13, 2017 Haha like the nostalgia aspect of it. I chose not to use Transform because several users use this term to identify matrices (And naming stuff sucks :)) inteja 1 Quote Link to comment Share on other sites More sharing options...
inteja Posted November 13, 2017 Share Posted November 13, 2017 OK no worries All good. GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Kesshi Posted November 20, 2017 Share Posted November 20, 2017 I have some ideas to improve it a bit. - (this more like a bug) dispose() does not remove the TransformNode from the Scene. transformNodes array - dispose() should also dispose all the children (meshes and other transform nodes) of the current node, just like the dispose function of AbstractMesh currently its a bit complicated to dispose a whole hierarchie if Meshes and TransformNodes are mixed - there should be a getChildTransformNodes() helper just like getChildMeshes() I could work on a PR if you want. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 20, 2017 Author Share Posted November 20, 2017 Hey! 1. dispose() does not remove the TransformNode from the Scene.: https://github.com/BabylonJS/Babylon.js/blob/master/src/babylon.scene.ts#L3850 2. dispose() should also dispose all the children: Excellent point! will fix it 3.getChildTransformNodes() helper just like getChildMeshes(): Yeah! WIll do it as well Kesshi 1 Quote Link to comment Share on other sites More sharing options...
Kesshi Posted November 21, 2017 Share Posted November 21, 2017 I found another issue. If i don't use TransformNodes i'm able to clone a mesh with all its children but if i have a TransformNode somewhere in my hierarchy this does not work. It would be nice if i could clone everything at once. See this playground: https://playground.babylonjs.com/#JXS29U#1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 21, 2017 Author Share Posted November 21, 2017 good idea Will add it Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted November 29, 2017 Share Posted November 29, 2017 Is there a way to check for an intersection of two TransformNodes? Or would you have to check every child node with every child node? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 4, 2017 Author Share Posted December 4, 2017 You will have to go through the hierarchy but you can also rely on this function to get a great approximate: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.abstractMesh.ts#L875 This requires an Abstractmesh Quote Link to comment Share on other sites More sharing options...
Art Vandelay Posted December 6, 2017 Share Posted December 6, 2017 Thanks @Deltakosh. How about getting the center of a transformNode? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 6, 2017 Author Share Posted December 6, 2017 The transformNode can be seen as a point so this is not possible to get a center Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted December 6, 2017 Share Posted December 6, 2017 3 hours ago, Deltakosh said: The transformNode can be seen as a point so this is not possible to get a center I gotcha... give me a few minutes. https://www.babylonjs-playground.com/#JT0HN4#5 this is broken but is how you would do it... I don't have time today to go back over it but this should get you in the right direction. (not sure why its not working in theory this should have done it, I must just be missing something small.) 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.