New IO structure, unexpexted error in C code
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -30,7 +26,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
tick-= bornTick;
|
||||
tick -= bornTick;
|
||||
center.Position = refOrigin.Position + MoveCenter(tick);
|
||||
beginPoint.Position = refOrigin.Position + MovBegin(tick);
|
||||
endPoint.Position = refOrigin.Position + MovEnd(tick);
|
||||
@@ -40,7 +36,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
return new Plain(this.center,this.beginPoint,this.endPoint);
|
||||
return new Plain(this.center, this.beginPoint, this.endPoint);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -34,7 +32,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
tick-=bornTick;
|
||||
tick -= bornTick;
|
||||
center.Position = refOrigin.Position + MoveCenter(tick);
|
||||
pointOnCircle.Position = refOrigin.Position + UpdateRadius(tick);
|
||||
pointOnPlain.Position = refOrigin.Position + UpdatePlain(tick);
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public delegate float ExpressionHandler
|
||||
(
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using StgSharp;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using StgSharp.Math;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 平面几何体。包含三角形,对称四边形,自由多边形等。最多可由16个点参数定义。
|
||||
/// </summary>
|
||||
public abstract class IPlainGeometry:INode<IPlainGeometry>
|
||||
public abstract class IPlainGeometry
|
||||
{
|
||||
protected readonly uint bornTick;
|
||||
internal readonly Point refOrigin;
|
||||
@@ -17,16 +12,16 @@ namespace StgSharp.Geometries
|
||||
public Point RefOrigin { get { return refOrigin; } }
|
||||
|
||||
public abstract Point RefPoint01
|
||||
{
|
||||
{
|
||||
get;
|
||||
}
|
||||
public abstract Point RefPoint02{ get; }
|
||||
public abstract Point RefPoint03{ get; }
|
||||
public abstract Point RefPoint02 { get; }
|
||||
public abstract Point RefPoint03 { get; }
|
||||
public uint BornTime => bornTick;
|
||||
|
||||
public IPlainGeometry(uint bornTime)
|
||||
{
|
||||
bornTick=bornTime;
|
||||
bornTick = bornTime;
|
||||
}
|
||||
|
||||
public IPlainGeometry(Counter<uint> MainTimer)
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
using Steamworks;
|
||||
using StgSharp;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Math;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Line:IPlainGeometry
|
||||
public class Line : IPlainGeometry
|
||||
{
|
||||
internal Point basePoint = default ;
|
||||
internal Point beginPoint = default ;
|
||||
internal Point basePoint = default;
|
||||
internal Point beginPoint = default;
|
||||
internal Point endPoint = default;
|
||||
internal GetLocationHandler movBegin;
|
||||
internal GetLocationHandler movEnd;
|
||||
@@ -29,11 +24,11 @@ namespace StgSharp.Geometries
|
||||
public Line() { }
|
||||
|
||||
//计算线起点的方法,通过对线的派生的重写实现功能
|
||||
public virtual vec3d MoveBeginPoint(uint tick)
|
||||
public virtual vec3d MoveBeginPoint(uint tick)
|
||||
=> movBegin.Invoke(tick);
|
||||
|
||||
//计算线重点的方法,通过对线的派生的重写实现功能
|
||||
public virtual vec3d MoveEndPoint(uint tick)
|
||||
public virtual vec3d MoveEndPoint(uint tick)
|
||||
=> movEnd.Invoke(tick);
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -10,7 +7,7 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
internal Point center;
|
||||
|
||||
public override sealed Point RefPoint01 => center;
|
||||
public sealed override Point RefPoint01 => center;
|
||||
public sealed override Point RefPoint02 => vertex01;
|
||||
public sealed override Point RefPoint03 => vertex02;
|
||||
|
||||
@@ -41,9 +38,9 @@ namespace StgSharp.Geometries
|
||||
throw new UnusedVertexException();
|
||||
}
|
||||
|
||||
internal override sealed void OnRender(uint tick)
|
||||
internal sealed override void OnRender(uint tick)
|
||||
{
|
||||
uint nowTick = ProgramTimeLine.tickCounter._value;
|
||||
uint nowTick = TimeLine.tickCounter._value;
|
||||
this.vertex01.Position = RefOrigin.Position + movVertex01Operation(nowTick);
|
||||
this.vertex02.Position = RefOrigin.Position + movVertex02Operation(nowTick);
|
||||
this.vertex03.Position = 2 * center.Position - vertex01.Position;
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -52,4 +49,5 @@ namespace StgSharp.Geometries
|
||||
plainParameter.Z = 1 / plainParameter.Z;
|
||||
}
|
||||
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
using StgSharp;
|
||||
using StgSharp.Math;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.SqlTypes;
|
||||
using System.Drawing;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public unsafe class Point : INode<Point>, INullable
|
||||
public unsafe class Point
|
||||
{
|
||||
internal vec3d* positionPtr;
|
||||
internal readonly bool isVertex;
|
||||
@@ -59,7 +54,6 @@ namespace StgSharp.Geometries
|
||||
|
||||
public bool IsVertex => isVertex;
|
||||
|
||||
bool INullable.IsNull { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Update the coordinate of the point. If this is a moving point,
|
||||
@@ -67,7 +61,7 @@ namespace StgSharp.Geometries
|
||||
/// please do not define any motion here, codes will be ignored by program
|
||||
/// </summary>
|
||||
/// <param name="tick">Time passes since the program begin, counted by frames</param>
|
||||
public virtual void Update(uint tick) {}
|
||||
public virtual void Update(uint tick) { }
|
||||
|
||||
public bool IsInGeometry(IPlainGeometry geo)
|
||||
{
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -58,7 +55,7 @@ namespace StgSharp.Geometries
|
||||
return new Plain(this.RefPoint01, this.RefPoint02, this.RefPoint03);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public virtual vec3d MovVertex01(uint tick) => movVertex01Operation.Invoke(tick);
|
||||
|
||||
public virtual vec3d MovVertex02(uint tick) => movVertex01Operation.Invoke(tick);
|
||||
@@ -70,7 +67,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
{
|
||||
uint nowTick = ProgramTimeLine.tickCounter._value;
|
||||
uint nowTick = TimeLine.tickCounter._value;
|
||||
this.vertex01.Position = RefOrigin.Position + movVertex01Operation(nowTick);
|
||||
this.vertex02.Position = RefOrigin.Position + movVertex02Operation(nowTick);
|
||||
this.vertex03.Position = RefOrigin.Position + movVertex03Operation(nowTick);
|
||||
|
||||
@@ -1 +1,12 @@
|
||||
using Steamworks;
using StgSharp.Control;
using StgSharp.Math;
using System;
using System.Collections.Generic;
using System.Numerics;
using System.Text;
namespace StgSharp.Geometries
{
public unsafe class Polygon5 : IPlainGeometry
{
internal Polygon5VertexArray vertexPtrAyyar;
internal Point _refOrigin;
internal readonly Point vertex1;
internal readonly Point vertex2;
internal readonly Point vertex3;
internal readonly Point vertex4;
internal readonly Point vertex5;
internal readonly int _vertexCount;
public override Point RefPoint01 => vertex1;
public override Point RefPoint02 => vertex2;
public override Point RefPoint03 => vertex3;
internal GetLocationHandler movP01Operation = default;
internal GetLocationHandler movP02Operation = default;
internal GetLocationHandler movP03Operation = default;
internal GetLocationHandler movP04Operation = default;
internal GetLocationHandler movP05Operation = default;
public GetLocationHandler MovP01Operation { get => movP01Operation; }
public GetLocationHandler MovP02Operation { get => movP02Operation; }
public GetLocationHandler MovP03Operation { get => movP03Operation; }
public GetLocationHandler MovP04Operation { get => movP04Operation; }
public GetLocationHandler MovP05Operation { get => movP05Operation; }
public unsafe Polygon5()
{
vertexPtrAyyar = internalIO.initPolygon5Vertex();
vertex1 = new Point(vertexPtrAyyar.vertex1);
vertex2 = new Point(vertexPtrAyyar.vertex2);
vertex3 = new Point(vertexPtrAyyar.vertex3);
vertex4 = new Point(vertexPtrAyyar.vertex4);
vertex5 = new Point(vertexPtrAyyar.vertex5);
}
public virtual vec3d movPoint01(uint tick)=> movP01Operation.Invoke(ProgramTimeLine.tickCounter._value);
public virtual vec3d movPoint02(uint tick)=> movP02Operation.Invoke(ProgramTimeLine.tickCounter._value);
public virtual vec3d movPoint03(uint tick)=> movP03Operation.Invoke(ProgramTimeLine.tickCounter._value);
public virtual vec3d movPoint04(uint tick)=> movP04Operation.Invoke(ProgramTimeLine.tickCounter._value);
public virtual vec3d movPoint05(uint tick)=> movP05Operation.Invoke(ProgramTimeLine.tickCounter._value);
internal override void OnRender(uint tick)
{
uint nowTick = tick - BornTime;
vertex1.Position = RefOrigin.Position + movPoint01(nowTick);
vertex2.Position = RefOrigin.Position + movPoint02(nowTick);
vertex3.Position = RefOrigin.Position + movPoint03(nowTick);
vertex4.Position = RefOrigin.Position + movPoint04(nowTick);
vertex5.Position = RefOrigin.Position + movPoint05(nowTick);
}
public override Line[] GetAllSides()
{
return new Line[5]
{
new Line(vertex1,vertex2),
new Line(vertex2,vertex3),
new Line(vertex3,vertex4),
new Line(vertex4,vertex5),
new Line(vertex5,vertex1)
};
}
public override Plain GetPlain()
{
return new Plain(vertex1,vertex2,vertex3);
}
}
}
|
||||
using StgSharp.Control;
using StgSharp.Math;
namespace StgSharp.Geometries
{
public unsafe class Polygon5 : IPlainGeometry
{
internal Polygon5VertexArray vertexPtrAyyar;
internal Point _refOrigin;
internal readonly Point vertex1;
internal readonly Point vertex2;
internal readonly Point vertex3;
internal readonly Point vertex4;
internal readonly Point vertex5;
internal readonly int _vertexCount;
public override Point RefPoint01 => vertex1;
public override Point RefPoint02 => vertex2;
public override Point RefPoint03 => vertex3;
internal GetLocationHandler movP01Operation = default;
internal GetLocationHandler movP02Operation = default;
internal GetLocationHandler movP03Operation = default;
internal GetLocationHandler movP04Operation = default;
internal GetLocationHandler movP05Operation = default;
public GetLocationHandler MovP01Operation { get => movP01Operation; }
public GetLocationHandler MovP02Operation { get => movP02Operation; }
public GetLocationHandler MovP03Operation { get => movP03Operation; }
public GetLocationHandler MovP04Operation { get => movP04Operation; }
public GetLocationHandler MovP05Operation { get => movP05Operation; }
public unsafe Polygon5()
{
vertexPtrAyyar = internalIO.initPolygon5Vertex();
vertex1 = new Point(vertexPtrAyyar.vertex1);
vertex2 = new Point(vertexPtrAyyar.vertex2);
vertex3 = new Point(vertexPtrAyyar.vertex3);
vertex4 = new Point(vertexPtrAyyar.vertex4);
vertex5 = new Point(vertexPtrAyyar.vertex5);
}
public virtual vec3d movPoint01(uint tick) => movP01Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movPoint02(uint tick) => movP02Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movPoint03(uint tick) => movP03Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movPoint04(uint tick) => movP04Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
public virtual vec3d movPoint05(uint tick) => movP05Operation.Invoke(TimeLine.tickCounter._value);
|
||||
|
||||
|
||||
internal override void OnRender(uint tick)
{
uint nowTick = tick - BornTime;
vertex1.Position = RefOrigin.Position + movPoint01(nowTick);
vertex2.Position = RefOrigin.Position + movPoint02(nowTick);
vertex3.Position = RefOrigin.Position + movPoint03(nowTick);
vertex4.Position = RefOrigin.Position + movPoint04(nowTick);
vertex5.Position = RefOrigin.Position + movPoint05(nowTick);
}
public override Line[] GetAllSides()
{
return new Line[5]
{
new Line(vertex1,vertex2),
new Line(vertex2,vertex3),
new Line(vertex3,vertex4),
new Line(vertex4,vertex5),
new Line(vertex5,vertex1)
};
}
public override Plain GetPlain()
{
return new Plain(vertex1, vertex2, vertex3);
}
}
}
|
||||
@@ -1,10 +1,5 @@
|
||||
using Steamworks;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -42,32 +37,32 @@ namespace StgSharp.Geometries
|
||||
|
||||
public virtual vec3d movPoint01(uint tick)
|
||||
{
|
||||
return movP01Operation.Invoke(ProgramTimeLine.tickCounter._value);
|
||||
return movP01Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint02(uint tick)
|
||||
{
|
||||
return movP02Operation.Invoke(ProgramTimeLine.tickCounter._value);
|
||||
return movP02Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint03(uint tick)
|
||||
{
|
||||
return movP03Operation.Invoke(ProgramTimeLine.tickCounter._value);
|
||||
return movP03Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint04(uint tick)
|
||||
{
|
||||
return movP04Operation.Invoke(ProgramTimeLine.tickCounter._value);
|
||||
return movP04Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint05(uint tick)
|
||||
{
|
||||
return movP05Operation.Invoke(ProgramTimeLine.tickCounter._value);
|
||||
return movP05Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint06(uint tick)
|
||||
{
|
||||
return movP06Operation.Invoke(ProgramTimeLine.tickCounter._value);
|
||||
return movP06Operation.Invoke(TimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
internal override void OnRender(uint tick)
|
||||
@@ -96,7 +91,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
return new Plain(vertex1,vertex2,vertex3);
|
||||
return new Plain(vertex1, vertex2, vertex3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using StgSharp.Math;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -10,13 +6,13 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
internal Point center;
|
||||
|
||||
public override sealed Point RefPoint01=>center;
|
||||
public sealed override Point RefPoint01 => center;
|
||||
|
||||
public override sealed Point RefPoint02 => vertex01;
|
||||
public sealed override Point RefPoint02 => vertex01;
|
||||
|
||||
public sealed override Point RefPoint03 => vertex02;
|
||||
|
||||
public override sealed Point RefPoint03 => vertex02;
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 计算中心点相对于参考原点的位移
|
||||
@@ -35,9 +31,9 @@ namespace StgSharp.Geometries
|
||||
return this.center.Position * 2 - this.vertex02.Position;
|
||||
}
|
||||
|
||||
internal override sealed void OnRender(uint tick)
|
||||
internal sealed override void OnRender(uint tick)
|
||||
{
|
||||
tick-=bornTick;
|
||||
tick -= bornTick;
|
||||
this.MovCenter(tick);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
@@ -9,7 +6,7 @@ namespace StgSharp.Geometries
|
||||
/// <summary>
|
||||
/// A square
|
||||
/// </summary>
|
||||
public class Square:Rectangle
|
||||
public class Square : Rectangle
|
||||
{
|
||||
public sealed override vec3d MovVertex02(uint tick)
|
||||
{
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
using StgSharp;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
|
||||
|
||||
public unsafe class Triangle :IPlainGeometry
|
||||
|
||||
public unsafe class Triangle : IPlainGeometry
|
||||
{
|
||||
internal triangleVertexArray vertexArray;
|
||||
|
||||
@@ -21,9 +16,9 @@ namespace StgSharp.Geometries
|
||||
internal GetLocationHandler movVertex02Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal GetLocationHandler movVertex03Opearion = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
|
||||
public override sealed Point RefPoint01 => vertex1;
|
||||
public override sealed Point RefPoint02 => vertex2;
|
||||
public override sealed Point RefPoint03 => vertex3;
|
||||
public sealed override Point RefPoint01 => vertex1;
|
||||
public sealed override Point RefPoint02 => vertex2;
|
||||
public sealed override Point RefPoint03 => vertex3;
|
||||
|
||||
public GetLocationHandler MovVertex01Operation => this.movVertex01Opearion;
|
||||
public GetLocationHandler MovVertex02Operation => this.movVertex02Opearion;
|
||||
@@ -48,9 +43,9 @@ namespace StgSharp.Geometries
|
||||
vertexArray.vertex3Ptr = this.vertex1.positionPtr;
|
||||
|
||||
/**/
|
||||
ProgramTimeLine._currentPool._pointContainer.Add(vertex1);
|
||||
ProgramTimeLine._currentPool._pointContainer.Add(vertex2);
|
||||
ProgramTimeLine._currentPool._pointContainer.Add(vertex3);
|
||||
TimeLine._currentPool._pointContainer.Add(vertex1);
|
||||
TimeLine._currentPool._pointContainer.Add(vertex2);
|
||||
TimeLine._currentPool._pointContainer.Add(vertex3);
|
||||
/**/
|
||||
|
||||
|
||||
@@ -67,7 +62,7 @@ namespace StgSharp.Geometries
|
||||
vertex1.Position = vertex01;
|
||||
}
|
||||
|
||||
internal override sealed void OnRender(uint tick)
|
||||
internal sealed override void OnRender(uint tick)
|
||||
{
|
||||
tick -= this.bornTick;
|
||||
vertex1.Position = RefOrigin.Position + MovVertex01(tick);
|
||||
@@ -89,7 +84,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
public override Plain GetPlain()
|
||||
{
|
||||
return new Plain(this.vertex1,this.vertex2,this.vertex3);
|
||||
return new Plain(this.vertex1, this.vertex2, this.vertex3);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user