MeshDepthMaterial.js 998 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /**
  2. * @author mr.doob / http://mrdoob.com/
  3. *
  4. * parameters = {
  5. * near: <float>,
  6. * far: <float>,
  7. * opacity: <float>,
  8. * blending: THREE.NormalBlending
  9. * }
  10. */
  11. THREE.MeshDepthMaterial = function ( parameters ) {
  12. this.near = 1;
  13. this.far = 1000;
  14. this.opacity = 1;
  15. this.shading = THREE.SmoothShading;
  16. this.blending = THREE.NormalBlending;
  17. this.wireframe = false;
  18. this.wireframe_linewidth = 1;
  19. this.wireframe_linecap = 'round';
  20. this.wireframe_linejoin = 'round';
  21. if ( parameters ) {
  22. if ( parameters.near !== undefined ) this.near = parameters.near;
  23. if ( parameters.far !== undefined ) this.far = parameters.far;
  24. if ( parameters.opacity !== undefined ) this.opacity = parameters.opacity;
  25. if ( parameters.blending !== undefined ) this.blending = parameters.blending;
  26. }
  27. this.__2near = 2 * this.near;
  28. this.__farPlusNear = this.far + this.near;
  29. this.__farMinusNear = this.far - this.near;
  30. this.toString = function () {
  31. return 'THREE.MeshDepthMaterial';
  32. };
  33. }