aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/twist-vert-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/twist-vert-material.js')
-rw-r--r--js/lib/rdge/materials/twist-vert-material.js44
1 files changed, 41 insertions, 3 deletions
diff --git a/js/lib/rdge/materials/twist-vert-material.js b/js/lib/rdge/materials/twist-vert-material.js
index 7c2dae5e..e0324e69 100644
--- a/js/lib/rdge/materials/twist-vert-material.js
+++ b/js/lib/rdge/materials/twist-vert-material.js
@@ -1,7 +1,31 @@
1/* <copyright> 1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/> 2Copyright (c) 2012, Motorola Mobility, Inc
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> 3All Rights Reserved.
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4BSD License.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8
9 - Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in the
13 documentation and/or other materials provided with the distribution.
14 - Neither the name of Motorola Mobility nor the names of its contributors
15 may be used to endorse or promote products derived from this software
16 without specific prior written permission.
17
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28POSSIBILITY OF SUCH DAMAGE.
5</copyright> */ 29</copyright> */
6 30
7var Material = require("js/lib/rdge/materials/material").Material; 31var Material = require("js/lib/rdge/materials/material").Material;
@@ -81,6 +105,20 @@ var TwistVertMaterial = function TwistVertMaterial()
81 this.setShaderValues(); 105 this.setShaderValues();
82 }; 106 };
83 107
108 this.resetToDefault = function()
109 {
110 this._propValues[this._propNames[0]] = 0.0;
111 this._propValues[this._propNames[1]] = 1.0;
112 this._propValues[this._propNames[2]] = 2.0 * Math.PI;
113 this._propValues[this._propNames[3]] = this._speed;
114 this._propValues[this._propNames[4]] = this._tex0.slice();
115 this._propValues[this._propNames[5]] = this._tex1.slice();
116
117 var nProps = this._propNames.length;
118 for (var i=0; i<nProps; i++)
119 this.setProperty( this._propNames[i], this._propValues[this._propNames[i]] );
120 };
121
84 this.update = function (time) 122 this.update = function (time)
85 { 123 {
86 if (this._shader && this._shader.twistMe) 124 if (this._shader && this._shader.twistMe)