Fog.js 617 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { Color } from '../math/Color';
  2. /**
  3. * @author mrdoob / http://mrdoob.com/
  4. * @author alteredq / http://alteredqualia.com/
  5. */
  6. function Fog ( color, near, far ) {
  7. this.name = '';
  8. this.color = new Color( color );
  9. this.near = ( near !== undefined ) ? near : 1;
  10. this.far = ( far !== undefined ) ? far : 1000;
  11. }
  12. Fog.prototype.isFog = true;
  13. Fog.prototype.clone = function () {
  14. return new Fog( this.color.getHex(), this.near, this.far );
  15. };
  16. Fog.prototype.toJSON = function ( meta ) {
  17. return {
  18. type: 'Fog',
  19. color: this.color.getHex(),
  20. near: this.near,
  21. far: this.far
  22. };
  23. };
  24. export { Fog };
粤ICP备19079148号