diff options
| author | Yann Granjon <[email protected]> | 2013-06-05 16:13:15 +0200 |
|---|---|---|
| committer | Yann Granjon <[email protected]> | 2013-06-05 16:13:15 +0200 |
| commit | 1ef133c52d12daf3fdad1d979e5a71cb39fa0d2e (patch) | |
| tree | 31e2cd5c6b0497f58762a63e3536dab76654324a /js/three-extend.js | |
| download | Chess3D-1ef133c52d12daf3fdad1d979e5a71cb39fa0d2e.tar.xz Chess3D-1ef133c52d12daf3fdad1d979e5a71cb39fa0d2e.zip | |
Initial Commit
Diffstat (limited to 'js/three-extend.js')
| -rw-r--r-- | js/three-extend.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/js/three-extend.js b/js/three-extend.js new file mode 100644 index 0000000..ae11d4c --- /dev/null +++ b/js/three-extend.js @@ -0,0 +1,27 @@ +// ECMAScript 5 strict mode +/* jshint globalstrict: true*/ +/* global SHADOW,onOBJLoaded,THREE,console,BLACK,WHITE,WIREFRAME */ + +/* + * few extension or modification to some three.js functionnality + * often to avoid some repetitive tasks + */ + +"use strict"; +(function () { + var clone = THREE.Texture.prototype.clone; + THREE.Texture.prototype.clone = function( texture ) { + var newTexture = clone.call(this,texture); + // The purpose of all this is to automagically switch this + // property to true after cloning. + // Since it originally doesn't do it by default + newTexture.needsUpdate = true; + return newTexture; + }; + + THREE.Texture.prototype.tile = function( factor ) { + // because I do that a lot (: + this.wrapS = this.wrapT = THREE.RepeatWrapping; + this.repeat.set(factor,factor); + }; +})();
\ No newline at end of file |
