MeshDepthMaterial.js 966 B

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