diff --git a/examples/js/renderers/Projector.js b/examples/js/renderers/Projector.js index b0f60ad59324d9c76d6ce7ed6ca418d438393813..3127178d9f6632c3933de93b17e8faa00310b9cc 100644 --- a/examples/js/renderers/Projector.js +++ b/examples/js/renderers/Projector.js @@ -646,7 +646,7 @@ THREE.Projector = function () { } else { - var step = object.type === THREE.LinePieces ? 2 : 1; + var step = object.mode === THREE.LinePieces ? 2 : 1; for ( var i = 0, l = ( positions.length / 3 ) - 1; i < l; i += step ) { @@ -670,7 +670,7 @@ THREE.Projector = function () { v1.positionScreen.copy( vertices[ 0 ] ).applyMatrix4( _modelViewProjectionMatrix ); // Handle LineStrip and LinePieces - var step = object.type === THREE.LinePieces ? 2 : 1; + var step = object.mode === THREE.LinePieces ? 2 : 1; for ( var v = 1, vl = vertices.length; v < vl; v ++ ) { diff --git a/src/objects/Line.js b/src/objects/Line.js index b5ebe197510e844f69d38423ef07bf803287e0b0..3f3ba031171728c8e4af1451adea9996aed9cd57 100644 --- a/src/objects/Line.js +++ b/src/objects/Line.js @@ -2,7 +2,7 @@ * @author mrdoob / http://mrdoob.com/ */ -THREE.Line = function ( geometry, material, type ) { +THREE.Line = function ( geometry, material, mode ) { THREE.Object3D.call( this ); @@ -11,7 +11,7 @@ THREE.Line = function ( geometry, material, type ) { this.geometry = geometry !== undefined ? geometry : new THREE.Geometry(); this.material = material !== undefined ? material : new THREE.LineBasicMaterial( { color: Math.random() * 0xffffff } ); - this.type = ( type !== undefined ) ? type : THREE.LineStrip; + this.mode = ( mode !== undefined ) ? mode : THREE.LineStrip; }; @@ -57,7 +57,7 @@ THREE.Line.prototype.raycast = ( function () { var nbVertices = vertices.length; var interSegment = new THREE.Vector3(); var interRay = new THREE.Vector3(); - var step = this.type === THREE.LineStrip ? 1 : 2; + var step = this.mode === THREE.LineStrip ? 1 : 2; for ( var i = 0; i < nbVertices - 1; i = i + step ) { @@ -91,7 +91,7 @@ THREE.Line.prototype.raycast = ( function () { THREE.Line.prototype.clone = function ( object ) { - if ( object === undefined ) object = new THREE.Line( this.geometry, this.material, this.type ); + if ( object === undefined ) object = new THREE.Line( this.geometry, this.material, this.mode ); THREE.Object3D.prototype.clone.call( this, object ); diff --git a/src/renderers/WebGLRenderer.js b/src/renderers/WebGLRenderer.js index f3d62ccd0b7cf6528673bee8b1920848c7105910..03ffcab96d66f2d9d8e684ced7ae77db9cbe1207 100644 --- a/src/renderers/WebGLRenderer.js +++ b/src/renderers/WebGLRenderer.js @@ -2768,7 +2768,7 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( object instanceof THREE.Line ) { - var mode = ( object.type === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; + var mode = ( object.mode === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; setLineWidth( material.linewidth ); @@ -3067,7 +3067,7 @@ THREE.WebGLRenderer = function ( parameters ) { } else if ( object instanceof THREE.Line ) { - var mode = ( object.type === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; + var mode = ( object.mode === THREE.LineStrip ) ? _gl.LINE_STRIP : _gl.LINES; setLineWidth( material.linewidth );