@@ -119,7 +119,7 @@ class Line extends Object3D {
119
119
const a = index . getX ( i ) ;
120
120
const b = index . getX ( i + 1 ) ;
121
121
122
- const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , a , b ) ;
122
+ const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , a , b , i ) ;
123
123
124
124
if ( intersect ) {
125
125
@@ -134,7 +134,7 @@ class Line extends Object3D {
134
134
const a = index . getX ( end - 1 ) ;
135
135
const b = index . getX ( start ) ;
136
136
137
- const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , a , b ) ;
137
+ const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , a , b , end - 1 ) ;
138
138
139
139
if ( intersect ) {
140
140
@@ -151,7 +151,7 @@ class Line extends Object3D {
151
151
152
152
for ( let i = start , l = end - 1 ; i < l ; i += step ) {
153
153
154
- const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , i , i + 1 ) ;
154
+ const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , i , i + 1 , i ) ;
155
155
156
156
if ( intersect ) {
157
157
@@ -163,7 +163,7 @@ class Line extends Object3D {
163
163
164
164
if ( this . isLineLoop ) {
165
165
166
- const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , end - 1 , start ) ;
166
+ const intersect = checkIntersection ( this , raycaster , _ray , localThresholdSq , end - 1 , start , end - 1 ) ;
167
167
168
168
if ( intersect ) {
169
169
@@ -210,7 +210,7 @@ class Line extends Object3D {
210
210
211
211
}
212
212
213
- function checkIntersection ( object , raycaster , ray , thresholdSq , a , b ) {
213
+ function checkIntersection ( object , raycaster , ray , thresholdSq , a , b , i ) {
214
214
215
215
const positionAttribute = object . geometry . attributes . position ;
216
216
@@ -233,7 +233,7 @@ function checkIntersection( object, raycaster, ray, thresholdSq, a, b ) {
233
233
// What do we want? intersection point on the ray or on the segment??
234
234
// point: raycaster.ray.at( distance ),
235
235
point : _intersectPointOnSegment . clone ( ) . applyMatrix4 ( object . matrixWorld ) ,
236
- index : a ,
236
+ index : i ,
237
237
face : null ,
238
238
faceIndex : null ,
239
239
barycoord : null ,
0 commit comments