修正 选择`LineSegment`时错误的问题.

pull/294/MERGE
ChenX 5 years ago
parent 89ce45f48e
commit 407bc8fb14

@ -1,4 +1,4 @@
import { BufferGeometry, Face3, Frustum, Geometry, Matrix4, Object3D, PerspectiveCamera, Vector3, Line3 } from 'three';
import { BufferGeometry, Face3, Frustum, Geometry, Line3, LineSegments, Matrix4, Object3D, PerspectiveCamera, Vector3 } from 'three';
import { GetEntity, IsEntity } from '../Common/Utils';
import { Entity } from '../DatabaseServices/Entity';
import { IViewer } from '../GraphicsSystem/IView';
@ -110,7 +110,7 @@ export class SelectSetBase
{
let pts: Array<Vector3> = [];
let faces: Array<Face3> = [];
this.GetGeometrVerticesAndFaces(obj, pts, faces)
this.GetGeometrVerticesAndFaces(obj, pts, faces);
return { pts, faces };
}
private GetGeometrVerticesAndFaces(obj: Object3D, pts: Vector3[], faces: Face3[])
@ -191,9 +191,10 @@ export class SelectSetBase
screenPts.push(p);
}
if (faces.length == 0)
if (faces.length === 0)
{
for (let index = 0; index < pts.length - 1; index++)
let add = (obj instanceof LineSegments) ? 2 : 1;
for (let index = 0; index < pts.length - 1; index += add)
{
if (this.IntersectLineBase(index, index + 1, screenPts, pts))
return true;

Loading…
Cancel
Save