SceneLoader fails to load data, if upVector of a camera is different than 0,1,0


this is a minor bug which I noticed in Babylon.js v4.2.0-rc.3 when trying to import .babylon file containing a camera with a non-standard upVector.

Here is a minimal example

If you check the console, you would notice 2 errors

 Unable to load from data:{...}: loadAssets of unknown

 Cannot read property 'm' of undefined
     at Function.e.TransformCoordinatesFromFloatsToRef (babylon.js:1)

If you change upVector value in line #116 from -1 to 1, the error is gone.

I haven’t check that in detail, but if feels like this code fails due to this condition

because this._upToYMatrix is unset. Most likely ArcRotateCamera.setMatUp() is not called when importing data from file.

You’re right, this PR will fix the problem: