FogExp2.js 590 B

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