SpriteMaterial.js 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /**
  2. * @author alteredq / http://alteredqualia.com/
  3. *
  4. * parameters = {
  5. * color: <hex>,
  6. * opacity: <float>,
  7. * map: new THREE.Texture( <Image> ),
  8. *
  9. * blending: THREE.NormalBlending,
  10. * depthTest: <bool>,
  11. * depthWrite: <bool>,
  12. *
  13. * uvOffset: new THREE.Vector2(),
  14. * uvScale: new THREE.Vector2(),
  15. *
  16. * fog: <bool>
  17. * }
  18. */
  19. THREE.SpriteMaterial = function ( parameters ) {
  20. THREE.Material.call( this );
  21. this.type = 'SpriteMaterial';
  22. this.color = new THREE.Color( 0xffffff );
  23. this.map = null;
  24. this.rotation = 0;
  25. this.fog = false;
  26. // set parameters
  27. this.setValues( parameters );
  28. };
  29. THREE.SpriteMaterial.prototype = Object.create( THREE.Material.prototype );
  30. THREE.SpriteMaterial.prototype.constructor = THREE.SpriteMaterial;
  31. THREE.SpriteMaterial.prototype.copy = function ( source ) {
  32. THREE.Material.prototype.copy.call( this, source );
  33. this.color.copy( source.color );
  34. this.map = source.map;
  35. this.rotation = source.rotation;
  36. this.fog = source.fog;
  37. return this;
  38. };
粤ICP备19079148号