FogExp2.js 594 B

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