Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/objects/Line.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class Line extends Object3D {
const a = index.getX( i );
const b = index.getX( i + 1 );

const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, a, b );
const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, a, b, i );

if ( intersect ) {

Expand All @@ -134,7 +134,7 @@ class Line extends Object3D {
const a = index.getX( end - 1 );
const b = index.getX( start );

const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, a, b );
const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, a, b, end - 1 );

if ( intersect ) {

Expand All @@ -151,7 +151,7 @@ class Line extends Object3D {

for ( let i = start, l = end - 1; i < l; i += step ) {

const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, i, i + 1 );
const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, i, i + 1, i );

if ( intersect ) {

Expand All @@ -163,7 +163,7 @@ class Line extends Object3D {

if ( this.isLineLoop ) {

const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, end - 1, start );
const intersect = checkIntersection( this, raycaster, _ray, localThresholdSq, end - 1, start, end - 1 );

if ( intersect ) {

Expand Down Expand Up @@ -210,7 +210,7 @@ class Line extends Object3D {

}

function checkIntersection( object, raycaster, ray, thresholdSq, a, b ) {
function checkIntersection( object, raycaster, ray, thresholdSq, a, b, i ) {

const positionAttribute = object.geometry.attributes.position;

Expand All @@ -233,7 +233,7 @@ function checkIntersection( object, raycaster, ray, thresholdSq, a, b ) {
// What do we want? intersection point on the ray or on the segment??
// point: raycaster.ray.at( distance ),
point: _intersectPointOnSegment.clone().applyMatrix4( object.matrixWorld ),
index: a,
index: i,
face: null,
faceIndex: null,
barycoord: null,
Expand Down