import { Vector3 } from 'three'; import { getLoocAtUpVec } from './../../src/Geometry/GeUtils'; import { rotateLine } from "./../../src/Common/CurveUtils"; test('getLoocAtUpVec', () => { //俯视图 0,1,0 expect(getLoocAtUpVec(new Vector3(0, 0, 1)) /*?*/).toMatchSnapshot(); //仰视图 expect(getLoocAtUpVec(new Vector3(0, 0, -1)) /*?*/).toMatchSnapshot(); //左视图 expect(getLoocAtUpVec(new Vector3(-1, 0, 0)) /*?*/).toMatchSnapshot(); //右视图 expect(getLoocAtUpVec(new Vector3(1, 0, 0)) /*?*/).toMatchSnapshot(); //前视图 expect(getLoocAtUpVec(new Vector3(0, 1, 0)) /*?*/).toMatchSnapshot(); }); test('should behave...', () => { let v = new Vector3(1, 0, 0); rotateLine(v, 0.5); expect(v).toMatchSnapshot(); rotateLine(v, -0.5); expect(v).toMatchSnapshot(); });