|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { EffectComposer, Matrix4, Object3D, OutlinePass, RenderPass, Scene, Vector2, Vector3, WebGLRenderer, SMAAPass } from 'three';
|
|
|
|
|
import { EffectComposer, Matrix4, Object3D, OutlinePass, RenderPass, Scene, SMAAPass, Vector2, Vector3, WebGLRenderer } from 'three';
|
|
|
|
|
import * as xaop from 'xaop';
|
|
|
|
|
import { end } from 'xaop';
|
|
|
|
|
import { app } from '../ApplicationServices/Application';
|
|
|
|
@ -7,12 +7,12 @@ import { Database } from '../DatabaseServices/Database';
|
|
|
|
|
import { Entity } from '../DatabaseServices/Entity';
|
|
|
|
|
import { GenerateRaycaster } from '../Editor/PointPick';
|
|
|
|
|
import { CheckFilter } from '../Editor/SelectFilter';
|
|
|
|
|
import { cZeroVec, GetBox, GetBoxArr } from '../Geometry/GeUtils';
|
|
|
|
|
import { userConfig } from '../Editor/UserConfig';
|
|
|
|
|
import { cZeroVec, GetBox, GetBoxArr, isPerpendicularityTo } from '../Geometry/GeUtils';
|
|
|
|
|
import { PlaneExt } from '../Geometry/Plane';
|
|
|
|
|
import { CameraUpdate } from './CameraUpdate';
|
|
|
|
|
import { GripScene } from './GripScene';
|
|
|
|
|
import { PreViewer } from './PreViewer';
|
|
|
|
|
import { userConfig } from '../Editor/UserConfig';
|
|
|
|
|
|
|
|
|
|
//导入其他js模块
|
|
|
|
|
require("three-CopyShader");
|
|
|
|
@ -186,13 +186,18 @@ export class Viewer
|
|
|
|
|
this.m_Render.render(this.Scene, this.Camera);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScreenToWorld(pt: Vector3, planNormal?: Vector3, constant?: number | Vector3)
|
|
|
|
|
ScreenToWorld(pt: Vector3, planNormal?: Vector3, constant?: Vector3)
|
|
|
|
|
{
|
|
|
|
|
if (!constant)
|
|
|
|
|
constant = new Vector3().setFromMatrixColumn(app.m_Editor.UCSMatrix, 3);
|
|
|
|
|
if (!planNormal)
|
|
|
|
|
planNormal = new Vector3().setFromMatrixColumn(app.m_Editor.UCSMatrix, 2);
|
|
|
|
|
|
|
|
|
|
if (isPerpendicularityTo(this.m_CameraCtrl.Direction, planNormal))
|
|
|
|
|
planNormal = this.m_CameraCtrl.Direction;
|
|
|
|
|
|
|
|
|
|
//变换和求交点
|
|
|
|
|
let plan = new PlaneExt(
|
|
|
|
|
(planNormal === undefined) ? new Vector3().setFromMatrixColumn(app.m_Editor.UCSMatrix, 2) : planNormal,
|
|
|
|
|
(constant === undefined) ? new Vector3().setFromMatrixColumn(app.m_Editor.UCSMatrix, 3) : constant
|
|
|
|
|
);
|
|
|
|
|
let plan = new PlaneExt(planNormal, constant);
|
|
|
|
|
let raycaster = GenerateRaycaster(pt, this);
|
|
|
|
|
plan.intersectRay(raycaster.ray, pt, true);
|
|
|
|
|
return pt;
|
|
|
|
|