DataTexture.js 795 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @author alteredq / http://alteredqualia.com/
  3. */
  4. THREE.DataTexture = function ( data, width, height, format, mapping, wrapS, wrapT, magFilter, minFilter ) {
  5. THREE.Texture.call( this, null, mapping, wrapS, wrapT, magFilter, minFilter );
  6. this.image = { data: data, width: width, height: height };
  7. this.format = format !== undefined ? format : THREE.RGBAFormat;
  8. };
  9. THREE.DataTexture.prototype = new THREE.Texture();
  10. THREE.DataTexture.prototype.constructor = THREE.DataTexture;
  11. THREE.DataTexture.prototype.clone = function () {
  12. var clonedTexture = new THREE.DataTexture( this.data.slice( 0 ), this.mapping, this.wrapS, this.wrapT, this.magFilter, this.minFilter );
  13. clonedTexture.offset.copy( this.offset );
  14. clonedTexture.repeat.copy( this.repeat );
  15. return clonedTexture;
  16. };