Jump to content

Strange behaviour of the ArcCamera


Ahiru
 Share

Recommended Posts

Well

I'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.

 

So

CreateCylinder('cyl', {}, scene);

should create a default cylinder

If 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.

Link to comment
Share on other sites

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.  :D

 

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.  :)

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...