Daily update on 20221113 by nitload youmu

This commit is contained in:
Nitload
2022-11-14 00:29:01 +08:00
parent 849f7582f8
commit 63a5fa5562
36 changed files with 251 additions and 122 deletions
@@ -33,6 +33,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="OpenTK, Version=3.3.3.0, Culture=neutral, PublicKeyToken=bad199fe84eb3df4, processorArchitecture=MSIL">
<HintPath>..\packages\OpenTK.3.3.3\lib\net20\OpenTK.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@@ -48,6 +51,8 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Stg_Sharp\StgSharp.csproj">
@@ -0,0 +1,25 @@
<configuration>
<dllmap os="linux" dll="opengl32.dll" target="libGL.so.1"/>
<dllmap os="linux" dll="glu32.dll" target="libGLU.so.1"/>
<dllmap os="linux" dll="openal32.dll" target="libopenal.so.1"/>
<dllmap os="linux" dll="alut.dll" target="libalut.so.0"/>
<dllmap os="linux" dll="opencl.dll" target="libOpenCL.so"/>
<dllmap os="linux" dll="libX11" target="libX11.so.6"/>
<dllmap os="linux" dll="libXi" target="libXi.so.6"/>
<dllmap os="linux" dll="SDL2.dll" target="libSDL2-2.0.so.0"/>
<dllmap os="osx" dll="opengl32.dll" target="/System/Library/Frameworks/OpenGL.framework/OpenGL"/>
<dllmap os="osx" dll="openal32.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="alut.dll" target="/System/Library/Frameworks/OpenAL.framework/OpenAL" />
<dllmap os="osx" dll="libGLES.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv1_CM.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="libGLESv2.dll" target="/System/Library/Frameworks/OpenGLES.framework/OpenGLES" />
<dllmap os="osx" dll="opencl.dll" target="/System/Library/Frameworks/OpenCL.framework/OpenCL"/>
<dllmap os="osx" dll="SDL2.dll" target="libSDL2.dylib"/>
<!-- XQuartz compatibility (X11 on Mac) -->
<dllmap os="osx" dll="libGL.so.1" target="/usr/X11/lib/libGL.dylib"/>
<dllmap os="osx" dll="libX11" target="/usr/X11/lib/libX11.dylib"/>
<dllmap os="osx" dll="libXcursor.so.1" target="/usr/X11/lib/libXcursor.dylib"/>
<dllmap os="osx" dll="libXi" target="/usr/X11/lib/libXi.dylib"/>
<dllmap os="osx" dll="libXinerama" target="/usr/X11/lib/libXinerama.dylib"/>
<dllmap os="osx" dll="libXrandr.so.2" target="/usr/X11/lib/libXrandr.dylib"/>
</configuration>
@@ -1,4 +1,11 @@
using StgSharp;
using OpenTK;
using OpenTK.Graphics.ES10;
using OpenTK.Graphics.ES11;
using OpenTK.Graphics.ES20;
using OpenTK.Graphics.ES30;
using OpenTK.Graphics.OpenGL;
using OpenTK.Graphics.OpenGL4;
using StgSharp;
using StgSharp.Geometry;
using System;
using System.Collections.Generic;
@@ -11,21 +18,10 @@ namespace Debug
{
internal class Program
{
static void Main(string[] args)
{
MyClass a1=new MyClass();
MyClass b1 = a1;
b1.MyProperty = 15;
Console.WriteLine(a1.MyProperty);
}
}
public class MyClass
{
public int MyProperty { get; set; }
}
}
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.3.3" targetFramework="net472" />
</packages>
@@ -1,35 +0,0 @@
using StgSharp.Geometry;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Control
{
public class Bind
{
public void Simple(IPoint p, IGeometry g)
{
if (g!=null)
{
g.Bind(p);
}
}
/// <summary>
/// 将点绑定在
/// </summary>
/// <param name="p">绑定的点</param>
/// <param name="c">被限定的圆</param>
public void Complex(IPoint p, Circle c)
{
c._bindPoint = p;
}
public void Complex(IPoint p, Line l)
{
l.EndingPoint = p;
}
}
}
@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
public delegate void ComplexOperationHandler();
}
@@ -5,22 +5,17 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Control
{
static public class Create
static public partial class Create
{
private static LinkedObject cache;
public static void Geometry(Point center, float radius, float angle, int num)
{
}
/// <summary>
/// 创建一个子弹并将其绑定在一个指定的点上
/// </summary>
@@ -73,10 +68,6 @@ namespace StgSharp.Control
}
/// <summary>
/// 创建一个简单点,并设置其速度和初始角度
/// </summary>
@@ -93,9 +84,63 @@ namespace StgSharp.Control
Pool.pointContainer.Add(p);
}
/// <summary>
/// 通过圆心与半径定义一个圆
/// </summary>
/// <param name="c"></param>
/// <param name="r"></param>
public static void Circle(Point c, float r)
{
Circle o = new Circle(c,r,Pool.tickCounter);
Pool.geometryContainer.Add(o);
}
/// <summary>
/// 通过圆心和圆上一点定义一个圆
/// </summary>
/// <param name="c"></param>
/// <param name="s"></param>
public static void Circle(Point c, Point s)
{
Circle o = new Circle(c, s,Pool.tickCounter);
Pool.geometryContainer.Add(o);
}
/// <summary>
/// 通过起点和终点定义一条直线
/// </summary>
/// <param name="b"></param>
/// <param name="e"></param>
public static void Line(Point b, Point e)
{
Line l = new Line(b,e);
Pool.geometryContainer.Add(l);
}
/// <summary>
/// 创建一组傅里叶展开式定义的圆阵列
/// </summary>
/// <param name="c"></param>
/// <param name="radiuses"></param>
/// <param name="angles"></param>
/// <param name="rv"></param>
public static void Fourier(Point c, float[] radiuses, float[] angles, float[] rotateFunc)
{
Point o;
Circle circle;
int length = radiuses.Length;
for (int i = 0; i<length; i++)
{
circle = new Circle(c,radiuses[i],Pool.tickCounter);
float[] f = new float[10];
f[10]=rotateFunc[i];
circle.RadiusFunc = f;
o = new PointOnCircle(circle, angles[i],1);
Pool.geometryContainer.Add(circle);
Pool.pointContainer.Add(o);
}
}
}
}
@@ -1,5 +1,5 @@
using StgSharp.Entity;
using StgSharp.Geometry;
using StgSharp.Entities;
using StgSharp.Geometries;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -26,21 +26,25 @@ namespace StgSharp.Control
internal static Logic.LinkedList<LinkedObject> rightCollector
= new Logic.LinkedList<LinkedObject>(collectCounter);
internal static Bullet bulletCache;
internal static Counter<uint> bulletCounter
=new Counter<uint>();
internal static Logic.LinkedList<Bullet> bulletContainer
= new Logic.LinkedList<Bullet>(bulletCounter);
internal static Entity entityCache;
internal static Counter<uint> entityCounter
=new Counter<uint>();
internal static Logic.LinkedList<Entity.Entity> entityContainer
= new Logic.LinkedList<Entity.Entity>(entityCounter);
internal static Logic.LinkedList<Entity> entityContainer
= new Logic.LinkedList<Entity>(entityCounter);
internal static Geometries.Geometry geometryCache;
internal static Counter<uint> gemoetryCounter
=new Counter<uint>();
internal static Logic.LinkedList<Geometry.Geometry> geometryContainer
= new Logic.LinkedList<Geometry.Geometry>(gemoetryCounter);
internal static Logic.LinkedList<Geometries.Geometry> geometryContainer
= new Logic.LinkedList<Geometries.Geometry>(gemoetryCounter);
internal static Point pointCache;
internal static Counter<uint> pointCounter
=new Counter<uint>();
internal static Logic.LinkedList<Point> pointContainer
@@ -0,0 +1,15 @@
using StgSharp.Geometry;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Control
{
public class Set
{
}
}
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Entity
namespace StgSharp.Entities
{
public class Bullet : LinkedObject
{
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Entity
namespace StgSharp.Entities
{
internal class Enemy:LinkedObject
{
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Entity
namespace StgSharp.Entities
{
internal class Entity:LinkedObject
{
@@ -5,13 +5,13 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Entity
namespace StgSharp.Entities
{
internal unsafe class Launcher
{
private IPoint _location;
private Point _location;
public IPoint Location
public Point Location
{
get { return _location; }
set { _location = value; }
@@ -40,14 +40,13 @@ namespace StgSharp.Entity
set { _launchType = value; }
}
public Launcher(Bullet launchType, IPoint loc)
public Launcher(Bullet launchType, Point loc)
{
_launchType = launchType;
_location = loc;
}
public void Launch()
{
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Entity
namespace StgSharp.Entities
{
internal class Player
{
@@ -0,0 +1,46 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Entities
{
public class RenderedGeometry
{
internal Geometry.Geometry route;
public Geometry.Geometry Route
{
get { return route; }
set { route = value; }
}
internal float _rangeBegin;
internal float _rangeEnd;
public float Range
{
get { return _rangeBegin; }
set { _rangeBegin = value; }
}
public float RangeEnd
{
get { return _rangeEnd; }
set { _rangeEnd = value; }
}
public float[][] GetVertexArray()
{
int length = (int)(_rangeEnd - _rangeBegin);
float[][] result = new float[length][];
for (int i = 0; i < length; i++)
{
}
//计算点
return result;
}
}
}
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Entity
namespace StgSharp.Entities
{
internal class Reward:LinkedObject
{
@@ -77,6 +77,7 @@ namespace StgSharp.Entity
{
_player = player;
_v *= 2.0f;
//后期改为由行为包控制
}
@@ -1,4 +1,4 @@
using StgSharp.Entity;
using StgSharp.Entities;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
public unsafe class Circle :Geometry
{
@@ -53,6 +53,25 @@ namespace StgSharp.Geometry
set { _angle = value; }
}
public new float[] XExpression
{
get
{
//计算圆的参数方程的泰勒展开式
return _xExpression;
}
}
public new float[] YExpression
{
get
{
//计算圆的参数方程的泰勒展开式
return _yExpression;
}
}
private float[] _rotateFunc = new float[10];
private float[] RotateFunc
{
@@ -123,10 +142,12 @@ namespace StgSharp.Geometry
/// </summary>
/// <param name="c">作为圆心的点</param>
/// <param name="b">在圆周上的点</param>
public Circle(Point c,Point b)
public Circle(Point c,Point b,Counter<uint> tickCounter)
{
this._center = c;
this. _bindPoint = b;
this.tickCounter = tickCounter;
this.beginTick = tickCounter.Value;
}
public void SetMotion(float[] rFunc, float[] roFunc)
@@ -1,4 +1,4 @@
using StgSharp.Entity;
using StgSharp.Entities;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -6,27 +6,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
internal class FreeCurve : Geometry
{
private Point _center;
private float[] _xExpression;
private float[] _yExpression;
public float[] XExpression
{
get { return _xExpression; }
set { _xExpression = value; }
}
public float[] YExpression
{
get { return _yExpression; }
set { _yExpression = value; }
}
public Point Center
{
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
public class Geometry:LinkedObject
{
@@ -17,5 +17,22 @@ namespace StgSharp.Geometry
{
return g.Previous as Geometry;
}
internal float[] _xExpression;
internal float[] _yExpression;
public float[] XExpression
{
get { return _xExpression; }
set { _xExpression = value; }
}
public float[] YExpression
{
get { return _yExpression; }
set { _yExpression = value; }
}
}
}
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
public class Line:Geometry
{
@@ -5,7 +5,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
public class Point:LinkedObject
{
@@ -1,4 +1,4 @@
using StgSharp.Entity;
using StgSharp.Entities;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
internal class PointCommon : Point
{
@@ -1,4 +1,4 @@
using StgSharp.Entity;
using StgSharp.Entities;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
public class PointOnCircle :Point
{
@@ -1,4 +1,4 @@
using StgSharp.Entity;
using StgSharp.Entities;
using StgSharp.Logic;
using System;
using System.Collections.Generic;
@@ -6,7 +6,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp.Geometry
namespace StgSharp.Geometries
{
public class PointOnLine : Point
{
@@ -45,26 +45,27 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Control\Bind.cs" />
<Compile Include="Control\Set.cs" />
<Compile Include="Control\Pool.cs" />
<Compile Include="Control\Create.cs" />
<Compile Include="Entity\Entity.cs" />
<Compile Include="Entity\Reward.cs" />
<Compile Include="Entity\Enemy.cs" />
<Compile Include="Entities\RenderedGeometry.cs" />
<Compile Include="Entities\Entity.cs" />
<Compile Include="Entities\Reward.cs" />
<Compile Include="Entities\Enemy.cs" />
<Compile Include="Game\CoreInfo.cs" />
<Compile Include="Control\ComplexOperationHandler.cs" />
<Compile Include="Geometry\Geometry.cs" />
<Compile Include="Geometry\FreeCurve.cs" />
<Compile Include="Geometry\Point.cs" />
<Compile Include="Geometry\PointCommon.cs" />
<Compile Include="Geometries\Geometry.cs" />
<Compile Include="Geometries\FreeCurve.cs" />
<Compile Include="Geometries\Point.cs" />
<Compile Include="Geometries\PointCommon.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Entity\Bullet.cs" />
<Compile Include="Entity\Player.cs" />
<Compile Include="Entity\Launcher.cs" />
<Compile Include="Geometry\Circle.cs" />
<Compile Include="Geometry\PointOnLine.cs" />
<Compile Include="Geometry\PointOnCircle.cs" />
<Compile Include="Geometry\Line.cs" />
<Compile Include="Entities\Bullet.cs" />
<Compile Include="Entities\Player.cs" />
<Compile Include="Entities\Launcher.cs" />
<Compile Include="Geometries\Circle.cs" />
<Compile Include="Geometries\PointOnLine.cs" />
<Compile Include="Geometries\PointOnCircle.cs" />
<Compile Include="Geometries\Line.cs" />
<Compile Include="Logic\Counter.cs" />
<Compile Include="Logic\LinkedList.cs" />
<Compile Include="Logic\LinkedObject.cs" />
Binary file not shown.