daily update on 20230301 by nitload youmu, file struct cahnged and more vec func added

This commit is contained in:
Nitload
2023-03-02 01:30:46 +08:00
parent d09105c9c1
commit bb71567e51
594 changed files with 368 additions and 2601 deletions
@@ -0,0 +1,43 @@
using StgSharp_Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Geometry
{
internal unsafe class Circle:Geometry
{
private Point _center;
public Point Center
{
get { return _center; }
set { _center = value; }
}
private float _radius;
public float Radius
{
get { return _radius; }
set { _radius = value; }
}
public Circle(Point center,float radius)
{
this._center = center;
this._radius = radius;
}
public void BindPoint(float angle,int number,GeometryContainer geoItemPool)
{
for (int i = 1; i <= number; i++)
{
}
}
}
}
@@ -0,0 +1,41 @@
using StgSharp_Geometry;
using StgSharp_Logic;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Geometry
{
internal class Geometry:LinkedTarget
{
public new LinkedTarget Previous
{
get { return this.Previous; }
set
{
if (value is Geometry)
{
this.Previous = value;
}
}
}
public new LinkedTarget Next
{
get { return this.Next; }
set
{
if (value is Geometry)
{
this.Next = value;
}
}
}
public virtual void Add()
{ }
}
}
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Geometry
{
internal class Line
{
private Point _beginPoint;
public Point BeginPoint
{
get { return _beginPoint; }
set { _beginPoint = value; }
}
private Point _endingPoint;
public Point EndingPoint
{
get { return _endingPoint; }
set { _endingPoint = value; }
}
public Line(Point begin,Point end)
{
_beginPoint= begin;
_endingPoint= end;
}
}
}
@@ -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>
@@ -0,0 +1,44 @@
using StgSharp_Logic;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Geometry
{
internal class Point:LinkedTarget
{
private float _x;
public float X
{
get { return _x; }
set { _x = value; }
}
private float _y;
public float Y
{
get { return _y; }
set { _y = value; }
}
public new LinkedTarget Next
{
get { return this.Next; }
set
{
if (value is Point)
{
this.Next = value;
}
}
}
public virtual void OnRender()
{ }
}
}
@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Geometry
{
internal unsafe class PointOnCircle : Point
{
private Circle _bindedItem;
public Circle geometryItem
{
get { return _bindedItem; }
set { _bindedItem = value; }
}
private float _angle;
public float Angle
{
get { return _angle; }
set { _angle = value; }
}
private float[] _angularVelocity;
private readonly uint beginTick;
private readonly uint* nowtick;
public PointOnCircle(Circle c, float p, float angle, uint counts,uint* gameTick)
{
_bindedItem = c;
_angle = (angle + counts * (360.0f / counts))*(float)(2*Math.PI/360);
nowtick = gameTick;
beginTick = *gameTick;
}
public void AddRotation(float[] aFunc)
{
if (aFunc.Length==10)
{
_angularVelocity=aFunc;
}
else
{
throw new Exception("Parameters are too much or too few!");
}
}
public override void OnRender()
{
if (_angularVelocity!=null)
{
uint a = *nowtick - beginTick;
float deltaAngle = 0;
for (int i = 0; i < 10; i++)
{
deltaAngle += _angularVelocity[i];
deltaAngle *= a;
}
_angle+=deltaAngle;
}
this.X = (float)(_bindedItem.Center.X + _bindedItem.Radius * Math.Cos(_angle));
this.Y = (float)(_bindedItem.Center.X + _bindedItem.Radius * Math.Sin(_angle));
}
}
}
@@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
namespace StgSharp_Geometry
{
internal class PointOnLine : Point
{
private Point _beginPoint;
public Point BeginPoint
{
get { return _beginPoint; }
set { _beginPoint = value; }
}
private Point _endPoint;
public Point EndPoint
{
get { return _endPoint; }
set { _endPoint = value; }
}
private float _angle;
public float Angle
{
get { return _angle; }
set { _angle = value; }
}
private float rate;
public PointOnLine(Point beginPoint,Point endPoint,float rate,int number)
{
_beginPoint = beginPoint;
_endPoint = endPoint;
_angle = (float)(Math.Atan2(endPoint.Y-beginPoint.Y,endPoint.X-beginPoint.Y));
rate = rate * number;
this.Y = beginPoint.Y + rate * (endPoint.Y - beginPoint.Y);
this.X = beginPoint.X + rate * (endPoint.X - beginPoint.X);
}
public override void OnRender()
{
_angle = (float)(Math.Atan2(_endPoint.Y - _beginPoint.Y, _endPoint.X - _beginPoint.Y));
this.Y = _beginPoint.Y + rate * (_endPoint.Y - _beginPoint.Y);
this.X = _beginPoint.X + rate * (_endPoint.X - _beginPoint.X);
}
}
}
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("StgSharp Geometry")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StgSharp Geometry")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("00b490aa-9fbb-4a9a-9293-d3ce79895d25")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{00B490AA-9FBB-4A9A-9293-D3CE79895D25}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>StgSharp_Geometry</RootNamespace>
<AssemblyName>StgSharp_Geometry</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<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" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Circle.cs" />
<Compile Include="Geometry.cs" />
<Compile Include="Line.cs" />
<Compile Include="PointOnLine.cs" />
<Compile Include="PointOnCircle.cs" />
<Compile Include="Point.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="OpenTK.dll.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\StgSharp_Logic\StgSharp_Logic.csproj">
<Project>{ae7f3290-9ab4-4b54-aab1-4ddcba20f89d}</Project>
<Name>StgSharp_Logic</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="OpenTK" version="3.3.3" targetFramework="net472" />
</packages>