Files
stgsharp/源代码/StgSharp/Geometries/Arc.cs
T
Nitload 906becc265 daily update on 20230418 by nitload youmu.
rewrite of geometry is completed.
ready for release of ver0.1.0
2023-04-18 01:59:26 +08:00

47 lines
1.6 KiB
C#

using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Text;
namespace StgSharp.Geometries
{
public class Arc : IPlainGeometry
{
internal Point center;
internal Point beginPoint;
internal Point endPoint;
internal GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal GetLocationHandler movBeginOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
internal GetLocationHandler movEndOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
public override Point RefPoint01 => center;
public override Point RefPoint02 => beginPoint;
public override Point RefPoint03 => endPoint;
public virtual vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
public virtual vec3d MovBegin(uint tick) => movBeginOperation.Invoke(tick);
public virtual vec3d MovEnd(uint tick) => movEndOperation.Invoke(tick);
internal override void OnRender(uint tick)
{
tick-= bornTick;
center._position = refOrigin._position + MoveCenter(tick);
beginPoint._position = refOrigin._position + MovBegin(tick);
endPoint._position = refOrigin._position + MovEnd(tick);
}
public override Line[] GetAllSides() => throw new NotImplementedException();
public override Plain GetPlain()
{
return new Plain(this.center,this.beginPoint,this.endPoint);
}
}
}