修复面域复制进来后显示错误的问题

pull/746/head
ChenX 5 years ago
parent 8e3f64850f
commit 4a1a56d038

@ -129,6 +129,29 @@ export class Region extends Entity
this._ShapeManager.ShapeList.forEach(s => s.ApplyMatrix(m)); this._ShapeManager.ShapeList.forEach(s => s.ApplyMatrix(m));
return super.ApplyMatrix(m); return super.ApplyMatrix(m);
} }
get Position()
{
return super.Position;
}
set Position(pt: Vector3)
{
this.WriteAllObjectRecord();
let moveX = pt.x - this._Matrix.elements[12];
let moveY = pt.y - this._Matrix.elements[13];
let moveZ = pt.z - this._Matrix.elements[14];
this._Matrix.setPosition(pt);
this._SpaceOCS.elements[12] += moveX;
this._SpaceOCS.elements[13] += moveY;
this._SpaceOCS.elements[14] += moveZ;
let m = new Matrix4().setPosition(moveX, moveY, moveZ);
for (let s of this.ShapeManager.ShapeList)
s.ApplyMatrix(m);
this.Update(UpdateDraw.Matrix);
}
protected ApplyScaleMatrix(m: Matrix4): this protected ApplyScaleMatrix(m: Matrix4): this
{ {
this.WriteAllObjectRecord(); this.WriteAllObjectRecord();
@ -201,7 +224,7 @@ export class Region extends Entity
//多形状面域,需把geo移动到相对 //多形状面域,需把geo移动到相对
let geometry = new ShapeGeometry(shape.Shape, 60);//60 可以优化. let geometry = new ShapeGeometry(shape.Shape, 60);//60 可以优化.
let diffMat = this.OCSInv.clone().multiply(shape.Outline.Curve.OCS); let diffMat = this.OCSInv.clone().multiply(shape.Outline.Curve.OCSNoClone);
geometry.applyMatrix4(diffMat); geometry.applyMatrix4(diffMat);
ScaleUV(geometry); ScaleUV(geometry);
if (type === RenderType.Wireframe) if (type === RenderType.Wireframe)

Loading…
Cancel
Save