提交 78b653e5 编写于 作者: S stephomi

We do the line-picking in local space.

上级 000ae09e
......@@ -353,20 +353,20 @@
for ( var i = 0; i < nbVertices - 1; i = i + step ) {
localRay.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment );
interSegment.applyMatrix4( object.matrixWorld );
interRay.applyMatrix4( object.matrixWorld );
var distSq = localRay.distanceSqToSegment( vertices[ i ], vertices[ i + 1 ], interRay, interSegment );
if ( interRay.distanceToSquared( interSegment ) <= precisionSq ) {
if ( distSq <= precisionSq ) {
var distance = raycaster.ray.origin.distanceTo( interRay );
var distance = localRay.origin.distanceTo( interRay );
if ( raycaster.near <= distance && distance <= raycaster.far ) {
intersects.push( {
distance: distance,
point: interSegment.clone(),
// What do we want? intersection point on the ray or on the segment??
// point: raycaster.ray.at( distance ),
point: interSegment.clone().applyMatrix4( object.matrixWorld ),
face: null,
faceIndex: null,
object: object
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册