Newer
Older
HuangJiPC / public / static / three / src / scenes / Fog.js
@zhangdeliang zhangdeliang on 21 Jun 442 bytes update
import { Color } from '../math/Color.js';

class Fog {

	constructor( color, near = 1, far = 1000 ) {

		this.isFog = true;

		this.name = '';

		this.color = new Color( color );

		this.near = near;
		this.far = far;

	}

	clone() {

		return new Fog( this.color, this.near, this.far );

	}

	toJSON( /* meta */ ) {

		return {
			type: 'Fog',
			color: this.color.getHex(),
			near: this.near,
			far: this.far
		};

	}

}

export { Fog };