From aad3d0382c498f6a39e5dbf5c9682e18127df353 Mon Sep 17 00:00:00 2001 From: bonmas14 Date: Sun, 1 Oct 2023 17:14:41 +0300 Subject: Добавьте файлы проекта. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RayRoom.sln | 25 +++++++++++++++++++++++++ RayRoom/Class1.cs | 7 +++++++ RayRoom/Core/AudioSimulator.cs | 10 ++++++++++ RayRoom/Core/Ray.cs | 11 +++++++++++ RayRoom/Core/Settings.cs | 28 ++++++++++++++++++++++++++++ RayRoom/Platform/AVXSummator.cs | 30 ++++++++++++++++++++++++++++++ RayRoom/Platform/IRaySummator.cs | 10 ++++++++++ RayRoom/RayRoom.csproj | 9 +++++++++ 8 files changed, 130 insertions(+) create mode 100644 RayRoom.sln create mode 100644 RayRoom/Class1.cs create mode 100644 RayRoom/Core/AudioSimulator.cs create mode 100644 RayRoom/Core/Ray.cs create mode 100644 RayRoom/Core/Settings.cs create mode 100644 RayRoom/Platform/AVXSummator.cs create mode 100644 RayRoom/Platform/IRaySummator.cs create mode 100644 RayRoom/RayRoom.csproj diff --git a/RayRoom.sln b/RayRoom.sln new file mode 100644 index 0000000..5dd8ab3 --- /dev/null +++ b/RayRoom.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.7.34031.279 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RayRoom", "RayRoom\RayRoom.csproj", "{230DBE77-7C79-48AB-80F9-7ACBA8654F9E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {230DBE77-7C79-48AB-80F9-7ACBA8654F9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {230DBE77-7C79-48AB-80F9-7ACBA8654F9E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {230DBE77-7C79-48AB-80F9-7ACBA8654F9E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {230DBE77-7C79-48AB-80F9-7ACBA8654F9E}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F82657D8-1694-4965-A4B5-C59E885B895D} + EndGlobalSection +EndGlobal diff --git a/RayRoom/Class1.cs b/RayRoom/Class1.cs new file mode 100644 index 0000000..7c8766e --- /dev/null +++ b/RayRoom/Class1.cs @@ -0,0 +1,7 @@ +namespace RayRoom +{ + public class Class1 + { + + } +} \ No newline at end of file diff --git a/RayRoom/Core/AudioSimulator.cs b/RayRoom/Core/AudioSimulator.cs new file mode 100644 index 0000000..0451c0e --- /dev/null +++ b/RayRoom/Core/AudioSimulator.cs @@ -0,0 +1,10 @@ +using System; + +namespace RayRoom.Core +{ + public class AudioSimulator + { + private Settings simulationSettings; + + } +} diff --git a/RayRoom/Core/Ray.cs b/RayRoom/Core/Ray.cs new file mode 100644 index 0000000..0c2edcc --- /dev/null +++ b/RayRoom/Core/Ray.cs @@ -0,0 +1,11 @@ +using System.Numerics; + +namespace RayRoom.Core +{ + public class Ray + { + public readonly Vector2 position; + public readonly Vector2 direction; + public readonly float length; + } +} \ No newline at end of file diff --git a/RayRoom/Core/Settings.cs b/RayRoom/Core/Settings.cs new file mode 100644 index 0000000..7ca0b45 --- /dev/null +++ b/RayRoom/Core/Settings.cs @@ -0,0 +1,28 @@ +using System; + +namespace RayRoom.Core +{ + public struct Settings + { + public readonly int frequency; + public readonly int maxRayReflections; + public readonly int maxDiffusionRays; + + public readonly float fadeFactorPerMeter; //qurve + public readonly float speedOfSoundMetersPerSec; + + public static Settings GetDefault() + { + return new Settings(441000, 10, 15, 0.001f, 330); + } + + public Settings(int frequency, int maxRayReflections, int maxDiffusionRays, float fadeFactorPerMeter, float speedOfSoundMetersPerSec) + { + this.frequency = frequency; + this.maxRayReflections = maxRayReflections; + this.maxDiffusionRays = maxDiffusionRays; + this.fadeFactorPerMeter = fadeFactorPerMeter; + this.speedOfSoundMetersPerSec = speedOfSoundMetersPerSec; + } + } +} diff --git a/RayRoom/Platform/AVXSummator.cs b/RayRoom/Platform/AVXSummator.cs new file mode 100644 index 0000000..17db989 --- /dev/null +++ b/RayRoom/Platform/AVXSummator.cs @@ -0,0 +1,30 @@ +using RayRoom.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.Intrinsics; +using System.Runtime.Intrinsics.X86; +using System.Text; +using System.Threading.Tasks; + +namespace RayRoom.Platform +{ + internal class AVXSummator : IRaySummator + { + private float[] buffer; + + public AVXSummator() + { + buffer = new float[2048]; + + } + + public float[] SumRays(Ray[] rays, float[] data) + { + if (!Avx.IsSupported) + throw new NotSupportedException("Avx is not supported"); + + throw new NotImplementedException("Avx is not implemented"); + } + } +} diff --git a/RayRoom/Platform/IRaySummator.cs b/RayRoom/Platform/IRaySummator.cs new file mode 100644 index 0000000..177b327 --- /dev/null +++ b/RayRoom/Platform/IRaySummator.cs @@ -0,0 +1,10 @@ +using System; +using RayRoom.Core; + +namespace RayRoom.Platform +{ + internal interface IRaySummator + { + float[] SumRays(Ray[] rays, float[] data); + } +} diff --git a/RayRoom/RayRoom.csproj b/RayRoom/RayRoom.csproj new file mode 100644 index 0000000..132c02c --- /dev/null +++ b/RayRoom/RayRoom.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + -- cgit v1.2.3-70-g09d2