daily update on 20230521 by nitload youmu, problem on coloring
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using StgSharp.Geometries;
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
public static unsafe partial class Geometry
|
||||
{
|
||||
public static unsafe Triangle InitTriagnle<T>(
|
||||
vec3d vertex1,
|
||||
vec3d vertex2,
|
||||
vec3d vertex3
|
||||
)where T:Triangle
|
||||
{
|
||||
Triangle t = new Triangle();
|
||||
|
||||
|
||||
return t;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@ using System.Text;
|
||||
|
||||
namespace StgSharp
|
||||
{
|
||||
internal static unsafe partial class IO
|
||||
public static unsafe partial class internalIO
|
||||
{
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initTriangle")]
|
||||
internal static unsafe extern triangleVertexArray initTriangleVertex();
|
||||
@@ -16,5 +16,14 @@ namespace StgSharp
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initPolygon5")]
|
||||
internal static unsafe extern Polygon5VertexArray initPolygon5Vertex();
|
||||
|
||||
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "inputTriangle")]
|
||||
internal static unsafe extern void internalLoadTriangle(triangleVertexArray triangle);
|
||||
|
||||
public static unsafe void LoadTriangle(Triangle t)
|
||||
{
|
||||
internalLoadTriangle(t.vertexArray);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
using System;
|
||||
using StgSharp.Graphics;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Control.IO
|
||||
namespace StgSharp
|
||||
{
|
||||
public static partial class IO
|
||||
public static partial class internalIO
|
||||
{
|
||||
[DllImport("StgSharpGraphics.dll", EntryPoint = "initWindow")]
|
||||
public static extern void Window(int width, int height);
|
||||
public static extern void Window(Window win);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
public unsafe Polygon4()
|
||||
{
|
||||
vertexPtrArray = IO.initPolygon4Vertex();
|
||||
vertexPtrArray = internalIO.initPolygon4Vertex();
|
||||
vertex01 = new Point(vertexPtrArray.vertex1);
|
||||
vertex02 = new Point(vertexPtrArray.vertex2);
|
||||
vertex03 = new Point(vertexPtrArray.vertex3);
|
||||
|
||||
@@ -1 +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 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);
}
}
}
|
||||
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(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);
}
}
}
|
||||
@@ -36,7 +36,7 @@ namespace StgSharp.Geometries
|
||||
|
||||
public Triangle()
|
||||
{
|
||||
this.vertexArray = IO.initTriangleVertex();
|
||||
this.vertexArray = internalIO.initTriangleVertex();
|
||||
this.vertex1 = new Point(vertexArray.vertex1Ptr);
|
||||
this.vertex2 = new Point(vertexArray.vertex2Ptr);
|
||||
this.vertex3 = new Point(vertexArray.vertex3Ptr);
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
using StgSharp.Math;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
|
||||
namespace StgSharp.Graphics
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Window
|
||||
{
|
||||
public int width;
|
||||
public int height;
|
||||
public vec4d windowColor;
|
||||
public string name;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
|
||||
57908071039ce5d71dc705d28cfaa6c0724c9204
|
||||
a4558088b0c5bcb83216471530b205191f8c14aa
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user