Skip to content

Commit

Permalink
Fix raytracing of LineSegments2 when the mesh has a transformation ap…
Browse files Browse the repository at this point in the history
…plied. (#24405)

Co-authored-by: mloeppky <[email protected]>
  • Loading branch information
MixMasterMitch and mloeppky authored Nov 29, 2022
1 parent 71ef8b9 commit fbace95
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions examples/jsm/lines/LineSegments2.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,15 @@ function getWorldSpaceHalfWidth( camera, distance, resolution ) {

function raycastWorldUnits( lineSegments, intersects ) {

const matrixWorld = lineSegments.matrixWorld;

for ( let i = 0, l = _instanceStart.count; i < l; i ++ ) {

_line.start.fromBufferAttribute( _instanceStart, i );
_line.end.fromBufferAttribute( _instanceEnd, i );

_line.applyMatrix4( matrixWorld );

const pointOnLine = new Vector3();
const point = new Vector3();

Expand Down

0 comments on commit fbace95

Please sign in to comment.