|
@@ -89,6 +89,7 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
const geometry = this.geometry;
|
|
|
const matrixWorld = this.matrixWorld;
|
|
|
const threshold = raycaster.params.Line.threshold;
|
|
|
+ const drawRange = geometry.drawRange;
|
|
|
|
|
|
// Checking boundingSphere distance to ray
|
|
|
|
|
@@ -122,7 +123,10 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
if ( index !== null ) {
|
|
|
|
|
|
- for ( let i = 0, l = index.count - 1; i < l; i += step ) {
|
|
|
+ const start = Math.max( 0, drawRange.start );
|
|
|
+ const end = Math.min( index.count, ( drawRange.start + drawRange.count ) );
|
|
|
+
|
|
|
+ for ( let i = start, l = end - 1; i < l; i += step ) {
|
|
|
|
|
|
const a = index.getX( i );
|
|
|
const b = index.getX( i + 1 );
|
|
@@ -157,7 +161,10 @@ Line.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
} else {
|
|
|
|
|
|
- for ( let i = 0, l = positionAttribute.count - 1; i < l; i += step ) {
|
|
|
+ const start = Math.max( 0, drawRange.start );
|
|
|
+ const end = Math.min( positionAttribute.count, ( drawRange.start + drawRange.count ) );
|
|
|
+
|
|
|
+ for ( let i = start, l = end - 1; i < l; i += step ) {
|
|
|
|
|
|
vStart.fromBufferAttribute( positionAttribute, i );
|
|
|
vEnd.fromBufferAttribute( positionAttribute, i + 1 );
|