提交 24479355 编写于 作者: M Mr.doob

Line: renamed type property to mode.

上级 79b32004
......@@ -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 ++ ) {
......
......@@ -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 );
......
......@@ -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 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册