Punn Posted September 27, 2015 Share Posted September 27, 2015 Compilation errorn.addMesh is not a function The second link does not work. Quote Link to comment Share on other sites More sharing options...
jerome Posted September 27, 2015 Share Posted September 27, 2015 http://www.babylonjs-playground.com/#1PGAPW#31 I guess the subdivisions parameter in CreateCylinder() was missing line21 Quote Link to comment Share on other sites More sharing options...
Ahiru Posted September 27, 2015 Author Share Posted September 27, 2015 Hmm ... but it worked before?? Quote Link to comment Share on other sites More sharing options...
jerome Posted September 27, 2015 Share Posted September 27, 2015 WellI'm implementing the options parameter for CreateCylinder in order to add the per face texture feature for instance (maybe per ring texture then)This method had a check in the code on its signature to keep the retro-compatibility with a very old signature without the subdivisions paramater.I just couldn't keep this retro-compatibility working with the new signature (the optionable one) so I had a talk with DK to know if we could break this old support : https://github.com/BabylonJS/Babylon.js/blob/master/dist/preview%20release/what's%20new.md The goal of options parameter is to simplify the work for the user by making all the parameters optional. SoCreateCylinder('cyl', {}, scene);should create a default cylinderIf you want to specify only one parameter, you will do :CreateCylinder('cyl', {subdivisions: 4}, scene);Obviously, the current signature with the subdivisions parameter will still work. In other words : subdivisions is no longer optional in the current signature, but is optional in the optionable signature. Quote Link to comment Share on other sites More sharing options...
Wingnut Posted September 27, 2015 Share Posted September 27, 2015 We got a backward compat break? Cooooool! I love those. Let's do createSphere, too, then. Size first, then subdivs. (reverse params) I've been bothering DK about this for 2 years now... it's such fun. heh. C'mon, let's go! If folks need to update 25000 BJS scenes for broken cylinder syntax, let's make folks fix their spheres, too. 70% of all playgrounds will flop, I predict. Besides, DK is going to write us a JS code processor... that looks through scene files and finds the line numbers that folks need to edit... to change to the newest BJS. Yeah, let's clean house! Make the big move! BJS 3.0... lots of things work differently, and ya'll cope. Cuz... this is the world of power dev on the bleeding edge. It's a hard-hat and steel-toed boots construction zone... expect to get dirty and bloody. Ok, what the heck is the subject here? Oh yeah, n.addMesh failure (or a lack of n)... caused by a missing (S)ubdivs parameter which used to be optional, but is now required. BABYLON.Mesh.CreateCylinder("mycyl", 4, 0, 4, 4, S, scene); Yeah, that's the subject... I think. Quote Link to comment Share on other sites More sharing options...
jerome Posted September 27, 2015 Share Posted September 27, 2015 Once the CreateCylinder() is OK (seems to be a bug) with both signatures : current one + optionable one, I will try to re-make the subdivisions parameter optional.Not sure it will be feasable however. I'll check once the method is really OK with these two signatures.Remember we are in an alpha version, things aren't frozen. At its time, adding an optional parameter before the scene parameter in the signature wasn't maybe the best idea (need to test : if this parameter is an instance of Scene then consider the former one is subdivisions else do this, etc ... ) and this is the reason why the options parameter is provided :- to add simple feature extensibility to the mesh- to give to the user the ability to specify only what he needs since everything will be set by default to build a mesh : less code The CreateSphere() method won't be changed because it has currently no optional parameter.Optional parameters aren't a problem actually, but their position in the signature.The real problem comes only from the strange CreateCylinder() signature what has an optional parameter (subdivisions) before a mandatory one (scene) Quote Link to comment Share on other sites More sharing options...
jerome Posted September 28, 2015 Share Posted September 28, 2015 Be happy I think I solved the backward compat problem : CreateCylinder subdivisions should keep optional in the current signature.It works well now on my local compilation. Waiting for the PR. Quote Link to comment Share on other sites More sharing options...
jerome Posted September 28, 2015 Share Posted September 28, 2015 Backward compatibily on CreateCylinder() restored (sweat and blood in the TS multi-signature muds and github hell : DK will curse me to push such chaotic PR)ANDdiameterTop = 0 working backANDnew optionable signature working together pfffewww Wingnut and Ahiru 2 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 28, 2015 Share Posted September 28, 2015 Well done everything is validated 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.