Quantcast
Channel: Babylon.js
Viewing all articles
Browse latest Browse all 388

Problem with serialise for light.range

$
0
0

Hello,
 
When one does not inform the property range to all light and that it serializes the scene. you get a number => 1.7976931348623157e+308.
If I information this value "light.range = 1.8"  for example, it works well, the serialized value is correct but not the default value.
 
see line 1 in the console of playground :
 
{"autoClear":true,"clearColor":[0.2,0.2,0.3],"ambientColor":[0,0,0],"gravity":[0,-9.807,0],"lights":[{"name":"light1","id":"light1","tags":null,"type":3,"direction":[0,1,0],"groundColor":[0,0,0],"intensity":0.7,"range":1.7976931348623157e+308,"diffuse":
 
http://www.babylonjs-playground.com/#2EAMX1#3
 
Je pense que le fix serait:
 
this.range = parseFloat(Number.MAX_VALUE);
 
Ou directement mettre une valeur par défaut qui semble être 1.8 à chaque fois quand on arrondit tout sur 1.797...
 
this.range = 1.8;


Viewing all articles
Browse latest Browse all 388

Trending Articles