Deltakosh 4315 Report post 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) 9 Gijs, Kesshi, meteoritool and 6 others reacted to this Quote Share this post Link to post Share on other sites
Dad72 916 Report post Posted November 13, 2017 I'm not sure this is the right PG. he presents the particle editor. Quote Share this post Link to post Share on other sites
Deltakosh 4315 Report post Posted November 13, 2017 Woot Fixed Quote Share this post Link to post Share on other sites
Dad72 916 Report post Posted November 13, 2017 Cool function. thanks for the TransformNode 1 Deltakosh reacted to this Quote Share this post Link to post Share on other sites
Wingnut 2301 Report post 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). 1 Deltakosh reacted to this Quote Share this post Link to post Share on other sites
inteja 68 Report post 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 Share this post Link to post Share on other sites
Deltakosh 4315 Report post 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 :)) 1 inteja reacted to this Quote Share this post Link to post Share on other sites
inteja 68 Report post Posted November 13, 2017 OK no worries All good. 1 Deltakosh reacted to this Quote Share this post Link to post Share on other sites
Kesshi 89 Report post 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 Share this post Link to post Share on other sites
Deltakosh 4315 Report post 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 1 Kesshi reacted to this Quote Share this post Link to post Share on other sites
Kesshi 89 Report post 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 Share this post Link to post Share on other sites
Deltakosh 4315 Report post Posted November 21, 2017 good idea Will add it Quote Share this post Link to post Share on other sites
Art Vandelay 1 Report post 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 Share this post Link to post Share on other sites
Deltakosh 4315 Report post 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 Share this post Link to post Share on other sites
Art Vandelay 1 Report post Posted December 6, 2017 Thanks @Deltakosh. How about getting the center of a transformNode? Quote Share this post Link to post Share on other sites
Deltakosh 4315 Report post Posted December 6, 2017 The transformNode can be seen as a point so this is not possible to get a center Quote Share this post Link to post Share on other sites
Pryme8 735 Report post 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 Share this post Link to post Share on other sites