daily update on 20230418 by nitload youmu.
rewrite of geometry is completed. ready for release of ver0.1.0
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using StgSharp.Linear;
|
||||
using StgSharp.Math;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
@@ -10,73 +9,38 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public class Arc : IPlainGeometry
|
||||
{
|
||||
internal Point _basePoint;
|
||||
internal Point _center;
|
||||
internal Point _beginPoint;
|
||||
internal Point _endPoint;
|
||||
internal RenderMode _renderMode;
|
||||
internal readonly uint bornTick;
|
||||
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 Arc(uint bornTime) : base(bornTime)
|
||||
{
|
||||
bornTick = bornTime;
|
||||
}
|
||||
public override Point RefPoint01 => center;
|
||||
|
||||
public Arc(Counter<uint> tickCounter) : base(tickCounter)
|
||||
{
|
||||
bornTick = tickCounter._value;
|
||||
}
|
||||
public override Point RefPoint02 => beginPoint;
|
||||
|
||||
public override Point RefOrigin => _basePoint;
|
||||
public override Point RefPoint03 => endPoint;
|
||||
|
||||
public override Point RefPoint01 => _center;
|
||||
public virtual vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
|
||||
|
||||
public override Point RefPoint02 => _beginPoint;
|
||||
public virtual vec3d MovBegin(uint tick) => movBeginOperation.Invoke(tick);
|
||||
|
||||
public override Point RefPoint03 => _endPoint;
|
||||
|
||||
public override RenderMode renderMode => _renderMode;
|
||||
|
||||
public virtual vec3d MoveCenter(uint tick) => default;
|
||||
|
||||
public virtual vec3d UpdateRadius(uint tick) => default;
|
||||
|
||||
public virtual vec3d UpdateAngle(uint tick) => default;
|
||||
public virtual vec3d MovEnd(uint tick) => movEndOperation.Invoke(tick);
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
tick-=bornTick;
|
||||
_center._position = _basePoint._position + MoveCenter(tick);
|
||||
switch (_renderMode)
|
||||
{
|
||||
case RenderMode.BasePoint:
|
||||
_beginPoint._position = _basePoint._position + UpdateRadius(tick);
|
||||
_endPoint._position = _basePoint._position + UpdateAngle(tick);
|
||||
break;
|
||||
case RenderMode.RefPoint:
|
||||
_beginPoint._position = _center._position + UpdateRadius(tick);
|
||||
_endPoint._position = _center._position + UpdateAngle(tick);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override float SetArrayX()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override float SetArrayY()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
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);
|
||||
return new Plain(this.center,this.beginPoint,this.endPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user