Jump to content

Argument to function modified, is it common in the framework ?


Recommended Posts

I had to spend a lot of time to understand where my working code got ... working no more.

It came out that this line:

var worldVector2 = BABYLON.Vector3.Unproject( screenVector2, ViewportWidth, ViewportHeight, wMCamera, vMScene, pMScene );

modifies the vector "screenVector2".


Reading the documentation it's not apparent, and seeing the function returns a Vector3 lend me to expect it to be the only result.

Instead the passed vector3 instance screenVector2 is modified too.


I think it should not behave like that .... is it for performance reasons or a bug ?
If it is not a bug, can the documentation report which params and how are modified ?

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.

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.


  • Recently Browsing   0 members

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