diff options
Diffstat (limited to 'js/lib/rdge/materials')
-rw-r--r-- | js/lib/rdge/materials/flag-material.js | 6 | ||||
-rwxr-xr-x | js/lib/rdge/materials/material.js | 5 | ||||
-rw-r--r-- | js/lib/rdge/materials/twist-vert-material.js | 1 |
3 files changed, 12 insertions, 0 deletions
diff --git a/js/lib/rdge/materials/flag-material.js b/js/lib/rdge/materials/flag-material.js index 77991a8c..8d4d1ee3 100644 --- a/js/lib/rdge/materials/flag-material.js +++ b/js/lib/rdge/materials/flag-material.js | |||
@@ -23,6 +23,8 @@ var FlagMaterial = function FlagMaterial() { | |||
23 | this._defaultWaveWidth = 1.0; | 23 | this._defaultWaveWidth = 1.0; |
24 | this._defaultWaveHeight = 1.0; | 24 | this._defaultWaveHeight = 1.0; |
25 | 25 | ||
26 | this._hasVertexDeformation = true; | ||
27 | |||
26 | /////////////////////////////////////////////////////////////////////// | 28 | /////////////////////////////////////////////////////////////////////// |
27 | // Properties | 29 | // Properties |
28 | /////////////////////////////////////////////////////////////////////// | 30 | /////////////////////////////////////////////////////////////////////// |
@@ -37,6 +39,10 @@ var FlagMaterial = function FlagMaterial() { | |||
37 | this._propValues[ this._propNames[1] ] = this._defaultWaveWidth; | 39 | this._propValues[ this._propNames[1] ] = this._defaultWaveWidth; |
38 | this._propValues[ this._propNames[2] ] = this._defaultWaveHeight; | 40 | this._propValues[ this._propNames[2] ] = this._defaultWaveHeight; |
39 | 41 | ||
42 | // a material can be animated or not. default is not. | ||
43 | // Any material needing continuous rendering should override this method | ||
44 | this.isAnimated = function() { return true; }; | ||
45 | |||
40 | /////////////////////////////////////////////////////////////////////// | 46 | /////////////////////////////////////////////////////////////////////// |
41 | // Methods | 47 | // Methods |
42 | /////////////////////////////////////////////////////////////////////// | 48 | /////////////////////////////////////////////////////////////////////// |
diff --git a/js/lib/rdge/materials/material.js b/js/lib/rdge/materials/material.js index 13251ce8..a81ca18f 100755 --- a/js/lib/rdge/materials/material.js +++ b/js/lib/rdge/materials/material.js | |||
@@ -38,6 +38,11 @@ var Material = function GLMaterial( world ) { | |||
38 | this._shader = null; | 38 | this._shader = null; |
39 | this._materialNode = null; | 39 | this._materialNode = null; |
40 | 40 | ||
41 | // vertex deformation variables | ||
42 | this._hasVertexDeformation = false; | ||
43 | this._vertexDeformationRange = [0, 0, 1, 1]; // (xMin, yMin, xMax, yMax) | ||
44 | this._vertexDeformationTolerance = 0.02; | ||
45 | |||
41 | /////////////////////////////////////////////////////////////////////// | 46 | /////////////////////////////////////////////////////////////////////// |
42 | // Property Accessors | 47 | // Property Accessors |
43 | /////////////////////////////////////////////////////////////////////// | 48 | /////////////////////////////////////////////////////////////////////// |
diff --git a/js/lib/rdge/materials/twist-vert-material.js b/js/lib/rdge/materials/twist-vert-material.js index 2d2cdcc5..802690a2 100644 --- a/js/lib/rdge/materials/twist-vert-material.js +++ b/js/lib/rdge/materials/twist-vert-material.js | |||
@@ -36,6 +36,7 @@ function TwistVertMaterial() | |||
36 | this.getShaderName = function() { return this._shaderName; } | 36 | this.getShaderName = function() { return this._shaderName; } |
37 | 37 | ||
38 | this.isAnimated = function() { return true; } | 38 | this.isAnimated = function() { return true; } |
39 | |||
39 | this.hasVertexDeformation = function() { return this._hasVertexDeformation; } | 40 | this.hasVertexDeformation = function() { return this._hasVertexDeformation; } |
40 | this._hasVertexDeformation = true; | 41 | this._hasVertexDeformation = true; |
41 | this._vertexDeformationTolerance = 0.02; // should be a property | 42 | this._vertexDeformationTolerance = 0.02; // should be a property |