Mr.doob 4 vuotta sitten
vanhempi
commit
86b43b4c17
2 muutettua tiedostoa jossa 10 lisäystä ja 10 poistoa
  1. 6 6
      src/objects/Line.js
  2. 4 4
      src/objects/Points.js

+ 6 - 6
src/objects/Line.js

@@ -134,7 +134,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			const index = geometry.index;
 			const attributes = geometry.attributes;
-			const positionAttr = attributes.position;
+			const positionAttribute = attributes.position;
 
 			if ( index !== null ) {
 
@@ -145,8 +145,8 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
 					const a = indices[ i ];
 					const b = indices[ i + 1 ];
 
-					vStart.fromBufferAttribute( positionAttr, a );
-					vEnd.fromBufferAttribute( positionAttr, b );
+					vStart.fromBufferAttribute( positionAttribute, a );
+					vEnd.fromBufferAttribute( positionAttribute, b );
 
 					const distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
 
@@ -175,10 +175,10 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			} else {
 
-				for ( let i = 0, l = positionAttr.count - 1; i < l; i += step ) {
+				for ( let i = 0, l = positionAttribute.count - 1; i < l; i += step ) {
 
-					vStart.fromBufferAttribute( positionAttr, i );
-					vEnd.fromBufferAttribute( positionAttr, i + 1 );
+					vStart.fromBufferAttribute( positionAttribute, i );
+					vEnd.fromBufferAttribute( positionAttribute, i + 1 );
 
 					const distSq = _ray.distanceSqToSegment( vStart, vEnd, interRay, interSegment );
 

+ 4 - 4
src/objects/Points.js

@@ -69,7 +69,7 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			const index = geometry.index;
 			const attributes = geometry.attributes;
-			const positionAttr = attributes.position;
+			const positionAttribute = attributes.position;
 
 			if ( index !== null ) {
 
@@ -79,7 +79,7 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 					const a = indices[ i ];
 
-					_position.fromBufferAttribute( attributes.position, a );
+					_position.fromBufferAttribute( positionAttribute, a );
 
 					testPoint( _position, a, localThresholdSq, matrixWorld, raycaster, intersects, this );
 
@@ -87,9 +87,9 @@ Points.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			} else {
 
-				for ( let i = 0, l = positionAttr.count; i < l; i ++ ) {
+				for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
 
-					_position.fromBufferAttribute( attributes.position, i );
+					_position.fromBufferAttribute( positionAttribute, i );
 
 					testPoint( _position, i, localThresholdSq, matrixWorld, raycaster, intersects, this );