diff options
Diffstat (limited to 'js/lib/rdge/materials/twist-material.js')
-rw-r--r-- | js/lib/rdge/materials/twist-material.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/js/lib/rdge/materials/twist-material.js b/js/lib/rdge/materials/twist-material.js index db179289..9e2c124a 100644 --- a/js/lib/rdge/materials/twist-material.js +++ b/js/lib/rdge/materials/twist-material.js | |||
@@ -33,16 +33,17 @@ var TwistMaterial = function TwistMaterial() { | |||
33 | /////////////////////////////////////////////////////////////////////// | 33 | /////////////////////////////////////////////////////////////////////// |
34 | // duplcate method requirde | 34 | // duplcate method requirde |
35 | this.dup = function (world) { | 35 | this.dup = function (world) { |
36 | // allocate a new uber material | 36 | // get the current values; |
37 | var newMat = new TwistMaterial(); | ||
38 | |||
39 | // copy over the current values; | ||
40 | var propNames = [], propValues = [], propTypes = [], propLabels = []; | 37 | var propNames = [], propValues = [], propTypes = [], propLabels = []; |
41 | this.getAllProperties(propNames, propValues, propTypes, propLabels); | 38 | this.getAllProperties(propNames, propValues, propTypes, propLabels); |
39 | |||
40 | // allocate a new material | ||
41 | var newMat = new TwistMaterial(); | ||
42 | |||
43 | // copy over the current values; | ||
42 | var n = propNames.length; | 44 | var n = propNames.length; |
43 | for (var i = 0; i < n; i++) { | 45 | for (var i = 0; i < n; i++) |
44 | newMat.setProperty(propNames[i], propValues[i]); | 46 | newMat.setProperty(propNames[i], propValues[i]); |
45 | } | ||
46 | 47 | ||
47 | return newMat; | 48 | return newMat; |
48 | }; | 49 | }; |