Browse Source

Merge pull request #5901 from genrich/line_raycast_add_index

Add line segment index which was intersected with raycast
Mr.doob 10 years ago
parent
commit
9c8ecef57c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/objects/Line.js

+ 4 - 0
src/objects/Line.js

@@ -100,6 +100,8 @@ THREE.Line.prototype.raycast = ( function () {
 							// What do we want? intersection point on the ray or on the segment??
 							// point: raycaster.ray.at( distance ),
 							point: interSegment.clone().applyMatrix4( this.matrixWorld ),
+							index: i,
+							offsetIndex: oi,
 							face: null,
 							faceIndex: null,
 							object: this
@@ -133,6 +135,7 @@ THREE.Line.prototype.raycast = ( function () {
 						// What do we want? intersection point on the ray or on the segment??
 						// point: raycaster.ray.at( distance ),
 						point: interSegment.clone().applyMatrix4( this.matrixWorld ),
+						index: i,
 						face: null,
 						faceIndex: null,
 						object: this
@@ -164,6 +167,7 @@ THREE.Line.prototype.raycast = ( function () {
 					// What do we want? intersection point on the ray or on the segment??
 					// point: raycaster.ray.at( distance ),
 					point: interSegment.clone().applyMatrix4( this.matrixWorld ),
+					index: i,
 					face: null,
 					faceIndex: null,
 					object: this