From b8be58814d40997170c0cdacb387ba77ab96253a Mon Sep 17 00:00:00 2001 From: ChenX Date: Thu, 14 Jun 2018 17:40:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=B3=A8=E9=87=8A=20?= =?UTF-8?q?=E9=87=8D=E6=9E=84=E5=90=8D=E7=A7=B0=E4=B8=BACameraUpdate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Geometry/Matrix2.ts | 11 +++++++++++ .../{CameraControl.ts => CameraUpdate.ts} | 2 +- src/GraphicsSystem/PreViewer.ts | 7 +++---- src/GraphicsSystem/Viewer.ts | 8 +++----- 4 files changed, 18 insertions(+), 10 deletions(-) rename src/GraphicsSystem/{CameraControl.ts => CameraUpdate.ts} (99%) diff --git a/src/Geometry/Matrix2.ts b/src/Geometry/Matrix2.ts index 960cb1f5c..a6b7c0379 100644 --- a/src/Geometry/Matrix2.ts +++ b/src/Geometry/Matrix2.ts @@ -3,6 +3,17 @@ import { Vector2, Vector3 } from "three"; export class Matrix2 { private el = [1, 0, 0, 1]; + + /** + * 设置矩阵的行列 + * + * @param {number} n11 x1 i.x + * @param {number} n12 y1 i.y + * @param {number} n21 x2 j.x + * @param {number} n22 y2 j.y + * @returns + * @memberof Matrix2 + */ set(n11: number, n12: number, n21: number, n22: number) { let te = this.el; diff --git a/src/GraphicsSystem/CameraControl.ts b/src/GraphicsSystem/CameraUpdate.ts similarity index 99% rename from src/GraphicsSystem/CameraControl.ts rename to src/GraphicsSystem/CameraUpdate.ts index 93a31591e..fba645d6d 100644 --- a/src/GraphicsSystem/CameraControl.ts +++ b/src/GraphicsSystem/CameraUpdate.ts @@ -12,7 +12,7 @@ import { Orbit } from '../Geometry/Orbit'; * @export * @class ViewCameraManage */ -export class CameraControl +export class CameraUpdate { private m_CurCamera: THREE.Camera; private m_CameraArray: Map = new Map(); diff --git a/src/GraphicsSystem/PreViewer.ts b/src/GraphicsSystem/PreViewer.ts index dea29ca3e..fa938313b 100644 --- a/src/GraphicsSystem/PreViewer.ts +++ b/src/GraphicsSystem/PreViewer.ts @@ -1,7 +1,6 @@ import * as THREE from 'three'; - import { app } from '../ApplicationServices/Application'; -import { CameraControl } from './CameraControl'; +import { CameraUpdate } from './CameraUpdate'; export class PreViewer { @@ -11,7 +10,7 @@ export class PreViewer //场景 private m_Scene = new THREE.Scene(); //相机控制 - protected m_Camera: CameraControl; + protected m_Camera: CameraUpdate; //线材质 m_LineMaterial: THREE.LineBasicMaterial = new THREE.LineBasicMaterial({ color: 0xffffff }); m_SnapMaterial: THREE.LineBasicMaterial = new THREE.LineBasicMaterial({ color: 0x008B00 }); @@ -97,7 +96,7 @@ export class PreViewer //-------------------------初始化代码------------------------- private InitCamera() { - this.m_Camera = new CameraControl(); + this.m_Camera = new CameraUpdate(); this.m_Camera.ViewHeight = 1; this.m_Camera.SetSize(1, 1); this.m_Camera.Update(); diff --git a/src/GraphicsSystem/Viewer.ts b/src/GraphicsSystem/Viewer.ts index 6e31093ab..2a728c3ca 100644 --- a/src/GraphicsSystem/Viewer.ts +++ b/src/GraphicsSystem/Viewer.ts @@ -1,17 +1,15 @@ import * as THREE from 'three'; +import { Vector3 } from 'three'; import * as xaop from 'xaop'; import { end } from 'xaop'; - -import { db } from '../ApplicationServices/Application'; import { Database } from '../DatabaseServices/Database'; import { Entity } from '../DatabaseServices/Entity'; import { cZeroVec, GetBox, GetBoxArr } from '../Geometry/GeUtils'; import { PlaneExt } from '../Geometry/Plane'; -import { CameraControl } from './CameraControl'; +import { CameraUpdate } from './CameraUpdate'; import { RenderType } from './Enum'; import { GripScene } from './GripScene'; import { PreViewer } from './PreViewer'; -import { Vector3 } from 'three'; //导入其他js模块 require("three-CopyShader"); @@ -29,7 +27,7 @@ export class Viewer { m_bNeedUpdate: boolean = true; //相机类 - m_CameraCtrl: CameraControl = new CameraControl(); + m_CameraCtrl: CameraUpdate = new CameraUpdate(); //变换控制 m_LookTarget: THREE.Vector3 = new THREE.Vector3();