Fog.js 442 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { Color } from '../math/Color.js';
  2. class Fog {
  3. constructor( color, near = 1, far = 1000 ) {
  4. this.isFog = true;
  5. this.name = '';
  6. this.color = new Color( color );
  7. this.near = near;
  8. this.far = far;
  9. }
  10. clone() {
  11. return new Fog( this.color, this.near, this.far );
  12. }
  13. toJSON( /* meta */ ) {
  14. return {
  15. type: 'Fog',
  16. color: this.color.getHex(),
  17. near: this.near,
  18. far: this.far
  19. };
  20. }
  21. }
  22. export { Fog };
粤ICP备19079148号