未验证 提交 b098ddd2 编写于 作者: L linbingquan 提交者: GitHub

Use ES6 default parameters. (#21545)

上级 2916db98
......@@ -2,14 +2,14 @@ import { Color } from '../math/Color.js';
class Fog {
constructor( color, near, far ) {
constructor( color, near = 1, far = 1000 ) {
this.name = '';
this.color = new Color( color );
this.near = ( near !== undefined ) ? near : 1;
this.far = ( far !== undefined ) ? far : 1000;
this.near = near;
this.far = far;
}
......
......@@ -2,12 +2,12 @@ import { Color } from '../math/Color.js';
class FogExp2 {
constructor( color, density ) {
constructor( color, density = 0.00025 ) {
this.name = '';
this.color = new Color( color );
this.density = ( density !== undefined ) ? density : 0.00025;
this.density = density;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册