Jump to content

Internal usage of the names of the objects (meshes, lights...)


Pierre Bonjour
 Share

Recommended Posts

Hello,

I have a small experience in WebGL but I am totally new to Babylon.js, I hope I am not loosing your time with a basic question that has already been answered...

Many functions of the framework ask for a name as first parameter : like for example "sphere1" in BABYLON.Mesh.CreateSphere("sphere1", 16, 2, scene);

Sometimes, like in the babylon playground in example 17 (called Actions), all omni lights have the same name "omni" :

    var light1 = new BABYLON.PointLight("omni", new BABYLON.Vector3(0, 50, 0), scene);
    var light2 = new BABYLON.PointLight("omni", new BABYLON.Vector3(0, 50, 0), scene);
    var light3 = new BABYLON.PointLight("omni", new BABYLON.Vector3(0, 50, 0), scene);

It looks like these names are not used afterwards in our code, are they used internally ? When I use the same name for all my objects it looks like it doesn't change anything, but I haven't made extensive testing, do you know what it is really used for internally ?

For example in the particule module, all particules have a different name ?

Thank you very much for your answer, and once more I hope I am not asking a question that has already been answered many times...

Link to comment
Share on other sites

Hello Temechon,

Thank you so much for your answer !

If I understand correctly it means that the name is not important if I don't plan on using it later ! Ok perfect thats convenient because I was afraid that the names were used to cache what has been drawn in order not to rebuilt it from scratch when the same name is detected or things like that, that would require a new name for each new object !

Have a great week-end !

 

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