Browse Source

Added missing MeshDepthMaterial.js

alteredq 14 years ago
parent
commit
b6e42d54d9
4 changed files with 41 additions and 2 deletions
  1. 0 1
      build/Three.js
  2. 0 1
      build/ThreeDebug.js
  3. 40 0
      src/materials/MeshDepthMaterial.js
  4. 1 0
      src/renderers/CanvasRenderer.js

File diff suppressed because it is too large
+ 0 - 1
build/Three.js


File diff suppressed because it is too large
+ 0 - 1
build/ThreeDebug.js


+ 40 - 0
src/materials/MeshDepthMaterial.js

@@ -0,0 +1,40 @@
+/**
+ * @author mr.doob / http://mrdoob.com/
+ *
+ * parameters = {
+ *  near: <float>,
+ *  far: <float>,
+ *  wireframe: <boolean>,
+ *  wireframe_linewidth: <float>
+ * } 
+ */
+
+THREE.MeshDepthMaterial = function ( parameters ) {
+
+	this.near = 1;
+	this.far = 1000;
+	this.opacity = 1;
+	this.wireframe = false;
+	this.wireframe_linewidth = 1;
+
+	if ( parameters ) {
+
+		if ( parameters.near !== undefined ) this.near = parameters.near;
+		if ( parameters.far !== undefined ) this.far = parameters.far;
+		if ( parameters.opacity !== undefined ) this.opacity  = parameters.opacity;
+		if ( parameters.wireframe !== undefined ) this.wireframe = parameters.wireframe;
+		if ( parameters.wireframe_linewidth !== undefined ) this.wireframe_linewidth = parameters.wireframe_linewidth;
+
+	}
+
+	this.__2near = 2 * this.near;
+	this.__farPlusNear = this.far + this.near;
+	this.__farMinusNear = this.far - this.near;
+
+	this.toString = function () {
+
+		return 'THREE.MeshDepthMaterial';
+
+	};
+
+}

+ 1 - 0
src/renderers/CanvasRenderer.js

@@ -722,6 +722,7 @@ THREE.CanvasRenderer = function () {
 		_context.moveTo( x0, y0 );
 		_context.lineTo( x1, y1 );
 		_context.lineTo( x2, y2 );
+		_context.lineTo( x0, y0 );
 		_context.closePath();
 
 		x1 -= x0;

Some files were not shown because too many files changed in this diff