SolidCatuar Posted June 26, 2014 Share Posted June 26, 2014 Hello again After several hours of unsuccessful attempts, I noticed that the babylonjs behavior was not the same that the javascript behavior.For exemple :http://www.babylonjs.com/playground/#1A6PNC#2The value of a.x is now 1 and the value of c is 0.Knowing that babylonjs is a javascript library it seems strange to change the language logic. So, is there an explanation for this choice ? Moreover, but there is no link with my precedent question, where can I find an html version of babylonjs 11 ? It would be useful for jsFiddle. Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted June 26, 2014 Share Posted June 26, 2014 a and b are references to an object, a BABYLON.Vector3, not primitive ints like c and d. When you assign b = a, changes to b are seen in a, because they both refer to the same object. This is how javascript works. Not sure what you are talking about regarding an html babylonjs. Do not know what jsFiddle is. gwenael 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 27, 2014 Share Posted June 27, 2014 JCPalmer is right, the code here is perfectly ok. When you change a property of an object you change it for all reference. This is not the same thing as changing a value Quote Link to comment Share on other sites More sharing options...
SolidCatuar Posted June 27, 2014 Author Share Posted June 27, 2014 Ok thanks !It's nice to be fixed, I'm a beginner who has spend several hours to behold that the falsity this code was due to that programming feature Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 27, 2014 Share Posted June 27, 2014 This is always good to learn things gwenael 1 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.