summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3d-webgl/material.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3d-webgl/material.js')
-rw-r--r--o3d/samples/o3d-webgl/material.js47
1 files changed, 20 insertions, 27 deletions
diff --git a/o3d/samples/o3d-webgl/material.js b/o3d/samples/o3d-webgl/material.js
index a7d6d3f..7dd1c8c 100644
--- a/o3d/samples/o3d-webgl/material.js
+++ b/o3d/samples/o3d-webgl/material.js
@@ -44,34 +44,27 @@
*/
o3d.Material = function(opt_state, opt_effect, opt_draw_list) {
o3d.ParamObject.call(this);
- this.state = opt_state;
- this.effect = opt_effect;
- this.drawList = opt_draw_list;
-};
-o3d.inherit('Material', 'ParamObject');
-
+ /**
+ * The State for this material.
+ * @type {o3d.State}
+ */
+ this.state = opt_state || null;
-/**
- * The Effect for this material.
- * @type {o3d.Effect}
- */
-o3d.Material.prototype.effect = null;
-
-
-
-/**
- * The State for this material.
- * @type {o3d.State}
- */
-o3d.Material.prototype.state = null;
-
-
-
-/**
- * The DrawList this material will render on.
- * @type {o3d.DrawList}
- */
-o3d.Material.prototype.drawList = null;
+ /**
+ * The Effect for this material.
+ * @type {o3d.Effect}
+ */
+ this.effect = opt_effect || null;
+ /**
+ * The DrawList this material will render on.
+ * @type {o3d.DrawList}
+ */
+ this.drawList = opt_draw_list || null;
+};
+o3d.inherit('Material', 'ParamObject');
+o3d.ParamObject.setUpO3DParam_(o3d.Material, 'effect', 'ParamEffect');
+o3d.ParamObject.setUpO3DParam_(o3d.Material, 'state', 'ParamState');
+o3d.ParamObject.setUpO3DParam_(o3d.Material, 'drawList', 'ParamDrawList');