Daily update on 20230413 by nitload youmu
This commit is contained in:
@@ -43,21 +43,21 @@ namespace StgSharp.Geometries
|
||||
_center._position = _basePoint._position + MoveCenter(tick);
|
||||
}
|
||||
|
||||
internal sealed override void CalcVec02(vec2d vec, uint tick)
|
||||
internal sealed override void CalcVec02(vec3d vec, uint tick)
|
||||
{
|
||||
_radius._position = vec + UpdateRadius(tick);
|
||||
|
||||
}
|
||||
internal sealed override void CalcVec03(StgSharp.Math.vec2d vec, uint tick)
|
||||
internal sealed override void CalcVec03(vec3d vec, uint tick)
|
||||
{
|
||||
_angle._position = vec + UpdateAngle(tick);
|
||||
}
|
||||
|
||||
public virtual vec2d MoveCenter(uint tick) => default;
|
||||
public virtual vec3d MoveCenter(uint tick) => default;
|
||||
|
||||
public virtual vec2d UpdateRadius(uint tick) => default;
|
||||
public virtual vec3d UpdateRadius(uint tick) => default;
|
||||
|
||||
public virtual vec2d UpdateAngle(uint tick) => default;
|
||||
public virtual vec3d UpdateAngle(uint tick) => default;
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,6 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public abstract class IGeometry:INode<IGeometry>
|
||||
{
|
||||
internal ContainerNode<IGeometry> _id;
|
||||
private readonly uint bornTick;
|
||||
|
||||
public abstract Point BasePoint { get; }
|
||||
@@ -28,27 +27,13 @@ namespace StgSharp.Geometries
|
||||
}
|
||||
|
||||
internal abstract void CalcVec01(uint tick);
|
||||
internal abstract void CalcVec02(vec2d vec, uint tick);
|
||||
internal abstract void CalcVec03(vec2d vec, uint tick);
|
||||
internal abstract void CalcVec02(vec3d vec, uint tick);
|
||||
internal abstract void CalcVec03(vec3d vec, uint tick);
|
||||
internal abstract void OnRender(uint tick);
|
||||
|
||||
public abstract RenderMode renderMode { get; }
|
||||
public abstract float SetArrayX();
|
||||
public abstract float SetArrayY();
|
||||
|
||||
ContainerNode<IGeometry> INode<IGeometry>.ID => _id;
|
||||
|
||||
void INode<IGeometry>.setID(ContainerNode<IGeometry> id)
|
||||
{
|
||||
if (_id != default)
|
||||
{
|
||||
throw new ArgumentException("Cannot set id twice");
|
||||
}
|
||||
else
|
||||
{
|
||||
_id = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,23 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public abstract class IGeometryCombination:LinkedList<IGeometry>
|
||||
{
|
||||
internal readonly uint _bornTick;
|
||||
|
||||
internal abstract void toSimpleGeometry();
|
||||
|
||||
public IGeometryCombination(uint bornTime)
|
||||
{
|
||||
_bornTick = bornTime;
|
||||
}
|
||||
|
||||
public IGeometryCombination(Counter<uint> timer)
|
||||
{
|
||||
_bornTick = timer._value;
|
||||
}
|
||||
|
||||
public IGeometryCombination()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,19 +50,19 @@ namespace StgSharp.Geometries
|
||||
_beginPoint._position = _basePoint._position + MoveBeginPoint(tick);
|
||||
}
|
||||
|
||||
internal sealed override void CalcVec02(vec2d vec, uint tick)
|
||||
internal sealed override void CalcVec02(vec3d vec, uint tick)
|
||||
{
|
||||
_endPoint._position = vec + MoveEndPoint(tick);
|
||||
}
|
||||
|
||||
internal sealed override void CalcVec03(vec2d vec, uint tick)
|
||||
internal sealed override void CalcVec03(vec3d vec, uint tick)
|
||||
{
|
||||
throw new ArgumentException("Lines do not need the third parameter to define!");
|
||||
}
|
||||
|
||||
public virtual vec2d MoveBeginPoint(uint tick) => default;
|
||||
public virtual vec3d MoveBeginPoint(uint tick) => default;
|
||||
|
||||
public virtual vec2d MoveEndPoint(uint tick) => default;
|
||||
public virtual vec3d MoveEndPoint(uint tick) => default;
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
|
||||
@@ -11,17 +11,8 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public class Point: INode<Point>
|
||||
{
|
||||
internal StgSharp.ContainerNode<Point> _id;
|
||||
|
||||
internal vec2d _position;
|
||||
|
||||
internal GetLocationHandler getXHandler;
|
||||
internal GetLocationHandler getYHandler;
|
||||
|
||||
ContainerNode<Point> INode<Point>.ID
|
||||
{
|
||||
get { return this._id; }
|
||||
}
|
||||
internal vec3d _position;
|
||||
|
||||
public float X
|
||||
{
|
||||
@@ -33,21 +24,7 @@ namespace StgSharp.Geometries
|
||||
get { return this._position.Y; }
|
||||
}
|
||||
|
||||
void INode<Point>.setID(ContainerNode<Point> id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
_id = id;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new ArgumentException("Cannot set id twice!");
|
||||
}
|
||||
}
|
||||
public void Update() => new NotImplementedException();
|
||||
|
||||
public void OnRender()
|
||||
{
|
||||
this.getXHandler.Invoke(this._position, Control.GameTimeLine.tickCounter);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Polygon : IGeometryCombination
|
||||
{
|
||||
internal Point[] pointsArray;
|
||||
|
||||
public Polygon(uint bornTime) : base(bornTime)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Polygon(int pointNum)
|
||||
{
|
||||
pointsArray = new Point[pointNum];
|
||||
this.toSimpleGeometry();
|
||||
}
|
||||
|
||||
public Polygon(Point[] pointsArray)
|
||||
{
|
||||
PointsArray = pointsArray;
|
||||
this.toSimpleGeometry();
|
||||
}
|
||||
|
||||
internal override void toSimpleGeometry()
|
||||
{
|
||||
Point begin = pointsArray[0];
|
||||
for (int i = 1; i <= pointsArray.Length; i++)
|
||||
{
|
||||
Triangle a = new Triangle(this._bornTick);
|
||||
this.Add(a);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Point[] PointsArray
|
||||
{
|
||||
get { return pointsArray; }
|
||||
set { pointsArray = value; }
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -67,12 +67,12 @@ namespace StgSharp.Geometries
|
||||
_center._position = _basePoint._position + MovCenter(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec02(vec2d vec, uint tick)
|
||||
internal override void CalcVec02(vec3d vec, uint tick)
|
||||
{
|
||||
_centerToCorner1._position = vec + UpdateCTC1(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec03(vec2d vec, uint tick)
|
||||
internal override void CalcVec03(vec3d vec, uint tick)
|
||||
{
|
||||
_centerToCorner2._position = vec + UpdateCTC2(tick);
|
||||
if (_centerToCorner1._position.GetLength()
|
||||
@@ -83,10 +83,10 @@ namespace StgSharp.Geometries
|
||||
}
|
||||
}
|
||||
|
||||
public virtual vec2d MovCenter(uint tick)=>default(vec2d);
|
||||
public virtual vec3d MovCenter(uint tick)=>default(vec3d);
|
||||
|
||||
public virtual vec2d UpdateCTC1(uint tick) => default(vec2d);
|
||||
public virtual vec3d UpdateCTC1(uint tick) => default(vec3d);
|
||||
|
||||
public virtual vec2d UpdateCTC2(uint tick) => default(vec2d);
|
||||
public virtual vec3d UpdateCTC2(uint tick) => default(vec3d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,21 +41,21 @@ namespace StgSharp.Geometries
|
||||
_beginPoint._position = _basePoint._position+ MovBegin(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec02(vec2d vec, uint tick)
|
||||
internal override void CalcVec02(vec3d vec, uint tick)
|
||||
{
|
||||
_line1._position = vec + CalcSide1(tick);
|
||||
}
|
||||
|
||||
internal override void CalcVec03(vec2d vec, uint tick)
|
||||
internal override void CalcVec03(vec3d vec, uint tick)
|
||||
{
|
||||
_line2._position = vec + CalcSide2(tick);
|
||||
}
|
||||
|
||||
public virtual vec2d MovBegin(uint tick) => default(vec2d);
|
||||
public virtual vec3d MovBegin(uint tick) => default(vec3d);
|
||||
|
||||
public virtual vec2d CalcSide1(uint tick)=> default(vec2d);
|
||||
public virtual vec3d CalcSide1(uint tick)=> default(vec3d);
|
||||
|
||||
public virtual vec2d CalcSide2(uint tick) => default(vec2d);
|
||||
public virtual vec3d CalcSide2(uint tick) => default(vec3d);
|
||||
|
||||
internal override sealed void OnRender(uint tick)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user