|
|
|
@ -128,3 +128,28 @@ test('最近点', () =>
|
|
|
|
|
expect(l.GetClosestPointTo(new Vector3(-5, 0, 0), false)/*?*/).toMatchSnapshot();//0,0,0.
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
test('拉伸直线的夹点', () =>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
let line = new Line(new Vector3(0, 0, 0), new Vector3(10, 0, 0));
|
|
|
|
|
|
|
|
|
|
//测试拉伸一个参数
|
|
|
|
|
line.MoveStretchPoints([0], new Vector3(0, 5, 0));
|
|
|
|
|
|
|
|
|
|
expect(line.StartPoint.toArray()).toMatchObject([0, 5, 0]);
|
|
|
|
|
|
|
|
|
|
//测试同时拉伸2个点的情况下
|
|
|
|
|
line.MoveStretchPoints([0, 1], new Vector3(0, 5, 0));
|
|
|
|
|
|
|
|
|
|
expect(line.StartPoint /*?*/).toMatchSnapshot();
|
|
|
|
|
expect(line.EndPoint /*?*/).toMatchSnapshot();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
line.MoveStretchPoints([1], new Vector3(5, 0, 0));
|
|
|
|
|
|
|
|
|
|
expect(line.StartPoint).toMatchSnapshot();
|
|
|
|
|
expect(line.EndPoint).toMatchSnapshot();
|
|
|
|
|
});
|
|
|
|
|