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.Text;
|
||||
@@ -8,71 +7,37 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public class Circle : IPlainGeometry
|
||||
{
|
||||
internal Point _baseCenter;
|
||||
internal Point _center;
|
||||
internal Point _pointOnCircle;
|
||||
internal Point _pointOnPlain;
|
||||
internal RenderMode _renderMode;
|
||||
internal readonly uint bornTick;
|
||||
internal Point center;
|
||||
internal Point pointOnCircle;
|
||||
internal Point pointOnPlain;
|
||||
internal GetLocationHandler movCenterOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal GetLocationHandler movBeginOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal GetLocationHandler movEndOperation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
|
||||
public override Point RefOrigin => _baseCenter;
|
||||
|
||||
public override Point RefPoint01 => _center;
|
||||
public override Point RefPoint01 => center;
|
||||
|
||||
public override Point RefPoint02 => _pointOnCircle;
|
||||
public override Point RefPoint02 => pointOnCircle;
|
||||
|
||||
public override Point RefPoint03 => _pointOnPlain;
|
||||
public override Point RefPoint03 => pointOnPlain;
|
||||
|
||||
public override RenderMode renderMode => _renderMode;
|
||||
public virtual vec3d MoveCenter(uint tick) => movCenterOperation.Invoke(tick);
|
||||
|
||||
public Circle(uint bornTime) : base(bornTime)
|
||||
{
|
||||
bornTick = bornTime;
|
||||
}
|
||||
public virtual vec3d UpdateRadius(uint tick) => movBeginOperation.Invoke(tick);
|
||||
|
||||
public Circle(Counter<uint> tickCounter) : base(tickCounter)
|
||||
{
|
||||
bornTick = tickCounter._value;
|
||||
}
|
||||
|
||||
public virtual vec3d MoveCenter(uint tick) => default;
|
||||
|
||||
public virtual vec3d UpdateRadius(uint tick) => default;
|
||||
|
||||
public virtual vec3d UpdatePlain(uint tick) => default;
|
||||
|
||||
public override float SetArrayX()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override float SetArrayY()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public virtual vec3d UpdatePlain(uint tick) => movEndOperation.Invoke(tick);
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
return new Plain(_center,_pointOnCircle,_pointOnPlain);
|
||||
return new Plain(center, pointOnCircle, pointOnPlain);
|
||||
}
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
tick-=bornTick;
|
||||
_center._position = MoveCenter(tick);
|
||||
switch (_renderMode)
|
||||
{
|
||||
case RenderMode.BasePoint:
|
||||
_pointOnCircle._position = _baseCenter._position + UpdateRadius(tick);
|
||||
_pointOnPlain._position = _baseCenter._position + UpdatePlain(tick);
|
||||
break;
|
||||
case RenderMode.RefPoint:
|
||||
_pointOnCircle._position = _center._position + UpdateRadius(tick);
|
||||
_pointOnPlain._position = _center._position + UpdatePlain(tick);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
center._position = refOrigin._position + MoveCenter(tick);
|
||||
pointOnCircle._position = refOrigin._position + UpdateRadius(tick);
|
||||
pointOnPlain._position = refOrigin._position + UpdatePlain(tick);
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
|
||||
Reference in New Issue
Block a user