aboutsummaryrefslogtreecommitdiff
path: root/js/three-extend.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/three-extend.js')
-rw-r--r--js/three-extend.js27
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