Skip to content

Commit

Permalink
Merge pull request #20375 from gkjohnson/patch-2
Browse files Browse the repository at this point in the history
LineSegements2: Add a "threshold" Raycaster param
  • Loading branch information
mrdoob authored Sep 29, 2020
2 parents 66b9fa3 + 706a375 commit 07d8167
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/js/lines/LineSegments2.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,16 @@ THREE.LineSegments2.prototype = Object.assign( Object.create( THREE.Mesh.prototy

}

var threshold = ( raycaster.params.Line2 !== undefined ) ? raycaster.params.Line2.threshold || 0 : 0;

var ray = raycaster.ray;
var camera = raycaster.camera;
var projectionMatrix = camera.projectionMatrix;

var geometry = this.geometry;
var material = this.material;
var resolution = material.resolution;
var lineWidth = material.linewidth;
var lineWidth = material.linewidth + threshold;

var instanceStart = geometry.attributes.instanceStart;
var instanceEnd = geometry.attributes.instanceEnd;
Expand Down
4 changes: 3 additions & 1 deletion examples/jsm/lines/LineSegments2.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ LineSegments2.prototype = Object.assign( Object.create( Mesh.prototype ), {

}

var threshold = ( raycaster.params.Line2 !== undefined ) ? raycaster.params.Line2.threshold || 0 : 0;

var ray = raycaster.ray;
var camera = raycaster.camera;
var projectionMatrix = camera.projectionMatrix;

var geometry = this.geometry;
var material = this.material;
var resolution = material.resolution;
var lineWidth = material.linewidth;
var lineWidth = material.linewidth + threshold;

var instanceStart = geometry.attributes.instanceStart;
var instanceEnd = geometry.attributes.instanceEnd;
Expand Down

0 comments on commit 07d8167

Please sign in to comment.