修复:样条线拉伸错误

pull/1574/MERGE
ChenX 3 years ago
parent 13ed259ff2
commit 47305ebbdf

@ -35,14 +35,14 @@ export class Spline extends Curve
{
return this._PointList;
}
set Points(v: Vector3[])
set Points(pts: Vector3[])
{
if (v.length < 2) return;
if (pts.length < 2) return;
this.WriteAllObjectRecord();
let ocsInv = this.OCSInv;
this._PointList = v.map(p => p.clone().applyMatrix4(ocsInv));
this._PointList = pts.map(p => p.clone().applyMatrix4(ocsInv));
if (v.length > 2 && equalv3(this._PointList[0], arrayLast(this._PointList), 1e-3))
if (pts.length > 2 && equalv3(this._PointList[0], arrayLast(this._PointList), 1e-3))
{
this._PointList.pop();
this._ClosedMark = true;
@ -113,7 +113,7 @@ export class Spline extends Curve
GetGripPoints()
{
return this._PointList.map(p => p.clone().applyMatrix4(this.OCS));
return this._PointList.map(p => p.clone().applyMatrix4(this.OCSNoClone));
}
GetStretchPoints()
{
@ -121,7 +121,7 @@ export class Spline extends Curve
}
MoveGripPoints(indexList: Array<number>, vec: Vector3)
{
vec = vec.clone().applyMatrix4(this.OCSInv).setZ(0);
vec = vec.clone().applyMatrix4(this.OCSInv.setPosition(0, 0, 0)).setZ(0);
this.WriteAllObjectRecord();
for (let index of indexList)
this._PointList[index].add(vec);
@ -129,7 +129,7 @@ export class Spline extends Curve
}
MoveStretchPoints(indexList: Array<number>, vec: Vector3)
{
vec = vec.clone().applyMatrix4(this.OCSInv).setZ(0);
vec = vec.clone().applyMatrix4(this.OCSInv.setPosition(0, 0, 0)).setZ(0);
this.WriteAllObjectRecord();
for (let index of indexList)
this._PointList[index].add(vec);

Loading…
Cancel
Save