优化:更多的时间切片提高操作流畅性

pull/803/head
ChenX 5 years ago
parent 510d4716a2
commit 2d3053f92d

@ -104,7 +104,7 @@ export class BoardMoveTool
if (obj.visible) if (obj.visible)
{ {
i++; i++;
if (i > 50) if (i > 30)
{ {
let now = performance.now(); let now = performance.now();
let r = now - start; let r = now - start;
@ -140,6 +140,7 @@ export class BoardMoveTool
derv.applyMatrix4(brRot); derv.applyMatrix4(brRot);
p.setZ(br.Thickness * 0.5); p.setZ(br.Thickness * 0.5);
p.applyMatrix4(brOCS); p.applyMatrix4(brOCS);
await Sleep(1);
let intersection = this.RayPoint(p, derv, brsObject); let intersection = this.RayPoint(p, derv, brsObject);
if (intersection) if (intersection)
@ -173,6 +174,7 @@ export class BoardMoveTool
{ {
let p = new Vector3(br.Width * 0.5, br.Height * y, br.Thickness).applyMatrix4(brOCS); let p = new Vector3(br.Width * 0.5, br.Height * y, br.Thickness).applyMatrix4(brOCS);
centerP = centerP ?? p; centerP = centerP ?? p;
await Sleep(1);
let intersection = this.RayPoint(p, brNormal, brsObject); let intersection = this.RayPoint(p, brNormal, brsObject);
if (intersection) if (intersection)
{ {
@ -202,6 +204,7 @@ export class BoardMoveTool
{ {
let p = new Vector3(br.Width * 0.5, br.Height * y, 0).applyMatrix4(brOCS); let p = new Vector3(br.Width * 0.5, br.Height * y, 0).applyMatrix4(brOCS);
centerP = centerP ?? p; centerP = centerP ?? p;
await Sleep(1);
let intersection = this.RayPoint(p, brNormal2, brsObject); let intersection = this.RayPoint(p, brNormal2, brsObject);
if (intersection) if (intersection)
{ {

@ -437,6 +437,7 @@ export class Viewer
this._Scene.add(l.DrawObject); this._Scene.add(l.DrawObject);
this.UpdateRender(); this.UpdateRender();
await Sleep(1);
//预构建板件 //预构建板件
i = 0; i = 0;
for (let br of brs) for (let br of brs)

Loading…
Cancel
Save