daily upsate on 20230517 by nitload youmu
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal static unsafe partial class IO
|
||||
{
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initTriangle")]
|
||||
internal static unsafe extern triangleVertexArray initTriangleVertex();
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initPolygon4")]
|
||||
internal static unsafe extern Polygon4VertexArray initPolygon4Vertex();
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initPolygon5")]
|
||||
internal static unsafe extern Polygon5VertexArray initPolygon5Vertex();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Control.IO
|
||||
{
|
||||
public static partial class IO
|
||||
{
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initWindow")]
|
||||
public static extern void Window(int width, int height);
|
||||
}
|
||||
}
|
||||
@@ -10,13 +10,13 @@ namespace StgSharp.Control
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct GraphicIO
|
||||
public struct GraphicIOPack
|
||||
{
|
||||
public InitWindow initWindowPtr = default;
|
||||
|
||||
|
||||
|
||||
public GraphicIO()
|
||||
public GraphicIOPack()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct Polygon4VertexArray
|
||||
{
|
||||
internal vec3d* vertex1;
|
||||
internal vec3d* vertex2;
|
||||
internal vec3d* vertex3;
|
||||
internal vec3d* vertex4;
|
||||
|
||||
triangleVertexOrder triangleVertexOrder1;
|
||||
triangleVertexOrder triangleVertexOrder2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct Polygon5VertexArray
|
||||
{
|
||||
internal vec3d* vertex1;
|
||||
internal vec3d* vertex2;
|
||||
internal vec3d* vertex3;
|
||||
internal vec3d* vertex4;
|
||||
internal vec3d* vertex5;
|
||||
|
||||
triangleVertexOrder triangleVertexOrder1;
|
||||
triangleVertexOrder triangleVertexOrder2;
|
||||
triangleVertexOrder triangleVertexOrder3;
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,18 @@ using System.Text;
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public unsafe struct triangleVertexArray
|
||||
internal unsafe struct triangleVertexArray
|
||||
{
|
||||
public vec3d* vertex1Ptr;
|
||||
internal vec3d* vertex1Ptr;
|
||||
internal vec3d* vertex2Ptr;
|
||||
internal vec3d* vertex3Ptr;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal unsafe struct triangleVertexOrder
|
||||
{
|
||||
int vertex1;
|
||||
int vertex2;
|
||||
int vertex3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,35 +11,35 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public unsafe class Point : INode<Point>
|
||||
{
|
||||
internal vec3d* postionPtr;
|
||||
internal vec3d* positionPtr;
|
||||
|
||||
internal Point(vec3d* ptr)
|
||||
{
|
||||
postionPtr = ptr;
|
||||
positionPtr = ptr;
|
||||
}
|
||||
|
||||
public vec3d Position
|
||||
{
|
||||
get { return (*this.postionPtr); }
|
||||
set { (*this.postionPtr) = value; }
|
||||
get { return *positionPtr; }
|
||||
set { *positionPtr = value; }
|
||||
}
|
||||
|
||||
public float X
|
||||
{
|
||||
get { return (*this.postionPtr).X; }
|
||||
set { (*this.postionPtr).X = value; }
|
||||
get { return (*this.positionPtr).X; }
|
||||
set { (*this.positionPtr).X = value; }
|
||||
}
|
||||
|
||||
public float Y
|
||||
{
|
||||
get { return (*this.postionPtr).Y; }
|
||||
set { (*this.postionPtr).Y = value; }
|
||||
get { return (*this.positionPtr).Y; }
|
||||
set { (*this.positionPtr).Y = value; }
|
||||
}
|
||||
|
||||
public float Z
|
||||
{
|
||||
get { return (*this.postionPtr).Z; }
|
||||
set { (*this.postionPtr).Z = value; }
|
||||
get { return (*this.positionPtr).Z; }
|
||||
set { (*this.positionPtr).Z = value; }
|
||||
}
|
||||
|
||||
internal readonly bool isVertex;
|
||||
@@ -61,7 +61,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
public bool IsOnPlain(IPlainGeometry geo)
|
||||
{
|
||||
return (*this.postionPtr) * geo.GetPlain().plainParameter == 1;
|
||||
return (*this.positionPtr) * geo.GetPlain().plainParameter == 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,10 +8,12 @@ namespace StgSharp.Geometries
|
||||
{
|
||||
public class Polygon4 : IPlainGeometry
|
||||
{
|
||||
internal Point vertex01;
|
||||
internal Point vertex02;
|
||||
internal Point vertex03;
|
||||
internal Point vertex04;
|
||||
internal Polygon4VertexArray vertexPtrArray;
|
||||
|
||||
internal readonly Point vertex01;
|
||||
internal readonly Point vertex02;
|
||||
internal readonly Point vertex03;
|
||||
internal readonly Point vertex04;
|
||||
|
||||
internal readonly GetLocationHandler movVertex01Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
internal readonly GetLocationHandler movVertex02Operation = new GetLocationHandler(GeometryOperation.DefualtMotion);
|
||||
@@ -29,6 +31,15 @@ namespace StgSharp.Geometries
|
||||
public GetLocationHandler MovVertex03Operaion { get { return movVertex03Operation; } }
|
||||
public GetLocationHandler MovVertex04Operaion { get { return movVertex04Operation; } }
|
||||
|
||||
public unsafe Polygon4()
|
||||
{
|
||||
vertexPtrArray = IO.initPolygon4Vertex();
|
||||
vertex01 = new Point(vertexPtrArray.vertex1);
|
||||
vertex02 = new Point(vertexPtrArray.vertex2);
|
||||
vertex03 = new Point(vertexPtrArray.vertex3);
|
||||
vertex04 = new Point(vertexPtrArray.vertex4);
|
||||
}
|
||||
|
||||
public override Line[] GetAllSides()
|
||||
{
|
||||
Line[] sides = new Line[4]
|
||||
@@ -39,11 +50,6 @@ namespace StgSharp.Geometries
|
||||
new Line(vertex04, vertex01)
|
||||
};
|
||||
|
||||
sides[0] = new Line(vertex01,vertex02);
|
||||
sides[1] = new Line(vertex02,vertex03);
|
||||
sides[2] = new Line(vertex03,vertex04);
|
||||
sides[3] = new Line(vertex04,vertex01);
|
||||
|
||||
return sides;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,92 +1 @@
|
||||
using Steamworks;
|
||||
using StgSharp.Control;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Numerics;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Geometries
|
||||
{
|
||||
public class Polygon5 : IPlainGeometry
|
||||
{
|
||||
internal Point _refOrigin;
|
||||
internal Point vertex1;
|
||||
internal Point vertex2;
|
||||
internal Point vertex3;
|
||||
internal Point vertex4;
|
||||
internal 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 virtual vec3d movPoint01(uint tick)
|
||||
{
|
||||
return movP01Operation.Invoke(GameTimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint02(uint tick)
|
||||
{
|
||||
return movP02Operation.Invoke(GameTimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint03(uint tick)
|
||||
{
|
||||
return movP03Operation.Invoke(GameTimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint04(uint tick)
|
||||
{
|
||||
return movP04Operation.Invoke(GameTimeLine.tickCounter._value);
|
||||
}
|
||||
|
||||
public virtual vec3d movPoint05(uint tick)
|
||||
{
|
||||
return movP05Operation.Invoke(GameTimeLine.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 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 = IO.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(GameTimeLine.tickCounter._value);
public virtual vec3d movPoint02(uint tick)=> movP02Operation.Invoke(GameTimeLine.tickCounter._value);
public virtual vec3d movPoint03(uint tick)=> movP03Operation.Invoke(GameTimeLine.tickCounter._value);
public virtual vec3d movPoint04(uint tick)=> movP04Operation.Invoke(GameTimeLine.tickCounter._value);
public virtual vec3d movPoint05(uint tick)=> movP05Operation.Invoke(GameTimeLine.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);
}
}
}
|
||||
@@ -11,7 +11,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
public unsafe class Triangle :IPlainGeometry
|
||||
{
|
||||
public triangleVertexArray vertexArray;
|
||||
internal triangleVertexArray vertexArray;
|
||||
|
||||
internal Point vertex1;
|
||||
internal Point vertex2;
|
||||
@@ -36,10 +36,10 @@ namespace StgSharp.Geometries
|
||||
|
||||
public Triangle()
|
||||
{
|
||||
this.vertexArray = GeometryIO.initTriangleVertex();
|
||||
this.vertex1.Position = *vertexArray.vertex1Ptr;
|
||||
this.vertex2.Position = *vertexArray.vertex2Ptr;
|
||||
this.vertex3.Position = *vertexArray.vertex3Ptr;
|
||||
this.vertexArray = IO.initTriangleVertex();
|
||||
this.vertex1 = new Point(vertexArray.vertex1Ptr);
|
||||
this.vertex2 = new Point(vertexArray.vertex2Ptr);
|
||||
this.vertex3 = new Point(vertexArray.vertex3Ptr);
|
||||
}
|
||||
|
||||
internal override sealed void OnRender(uint tick)
|
||||
|
||||
@@ -24,8 +24,5 @@ namespace StgSharp
|
||||
[DllImport(glPackageName, EntryPoint = "initPackage")]
|
||||
internal static extern GraphicIO InitPackage();
|
||||
/**/
|
||||
|
||||
[DllImport(glPackageName, EntryPoint = "initWindow")]
|
||||
public static extern void Window(int width,int height);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
using StgSharp.Geometries;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal static unsafe class GeometryIO
|
||||
{
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initTriangle")]
|
||||
internal static unsafe extern triangleVertexArray initTriangleVertex();
|
||||
}
|
||||
}
|
||||
@@ -134,5 +134,10 @@ namespace StgSharp.Math
|
||||
{
|
||||
return new float[3] { vec.X, vec.Y, vec.Y };
|
||||
}
|
||||
|
||||
public static implicit operator vec3d(float[] floatArray)
|
||||
{
|
||||
return new vec3d(floatArray[0], floatArray[1], floatArray[2]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
e1462487ad425beae2b2fdc45a1ba680192e338c
|
||||
57908071039ce5d71dc705d28cfaa6c0724c9204
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user