diff --git a/.editorconfig b/.editorconfig
index 5e91147..c9e2b95 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -14,8 +14,10 @@ indent_size = 4
dotnet_diagnostic.IDE0005.severity = suggestion
# IDE0047: Parentheses can be removed
dotnet_diagnostic.IDE0047.severity = none
+# IDE0055: Fix formatting
+dotnet_diagnostic.IDE0055.severity = none
-[src/{FastNoiseLite,flecs-cs}/**]
+[src/{FastNoiseLite,ImGui.NET}/**]
# Suppress compiler and analyer warnings in dependencies.
dotnet_analyzer_diagnostic.severity = none
dotnet_diagnostic.IDE0005.severity = none
diff --git a/.gitmodules b/.gitmodules
index 8a9c26f..5d071b1 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,6 +1,6 @@
-[submodule "src/flecs-cs"]
- path = src/flecs-cs
- url = https://github.com/flecs-hub/flecs-cs
[submodule "src/FastNoiseLite"]
path = src/FastNoiseLite
url = https://github.com/Auburn/FastNoiseLite.git
+[submodule "src/gaemstone.ECS"]
+ path = src/gaemstone.ECS
+ url = https://git.mcft.net/copygirl/gaemstone.ECS.git
diff --git a/gaemstone.sln b/gaemstone.sln
index ff837b3..45da22d 100644
--- a/gaemstone.sln
+++ b/gaemstone.sln
@@ -1,48 +1,55 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30114.105
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{599B7E67-7F73-4301-A9C6-E8DF286A2625}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaemstone.Bloxel", "src\gaemstone.Bloxel\gaemstone.Bloxel.csproj", "{7A80D49C-6768-4803-9866-691C7AD80817}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaemstone.Client", "src\gaemstone.Client\gaemstone.Client.csproj", "{67B9B2D4-FCB7-4642-B584-A0186CAB2969}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaemstone", "src\gaemstone\gaemstone.csproj", "{7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Immersion", "src\Immersion\Immersion.csproj", "{4B9C20F6-0793-4E85-863A-2E14230A028F}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7A80D49C-6768-4803-9866-691C7AD80817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7A80D49C-6768-4803-9866-691C7AD80817}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7A80D49C-6768-4803-9866-691C7AD80817}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7A80D49C-6768-4803-9866-691C7AD80817}.Release|Any CPU.Build.0 = Release|Any CPU
- {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Release|Any CPU.Build.0 = Release|Any CPU
- {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Release|Any CPU.Build.0 = Release|Any CPU
- {4B9C20F6-0793-4E85-863A-2E14230A028F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {4B9C20F6-0793-4E85-863A-2E14230A028F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {4B9C20F6-0793-4E85-863A-2E14230A028F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {4B9C20F6-0793-4E85-863A-2E14230A028F}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {7A80D49C-6768-4803-9866-691C7AD80817} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
- {67B9B2D4-FCB7-4642-B584-A0186CAB2969} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
- {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
- {4B9C20F6-0793-4E85-863A-2E14230A028F} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30114.105
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{599B7E67-7F73-4301-A9C6-E8DF286A2625}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaemstone.Bloxel", "src\gaemstone.Bloxel\gaemstone.Bloxel.csproj", "{7A80D49C-6768-4803-9866-691C7AD80817}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaemstone.Client", "src\gaemstone.Client\gaemstone.Client.csproj", "{67B9B2D4-FCB7-4642-B584-A0186CAB2969}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaemstone.ECS", "src\gaemstone.ECS\gaemstone.ECS.csproj", "{EB4F82C0-1BDF-4404-84FB-F0A4E1E4DA67}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "gaemstone", "src\gaemstone\gaemstone.csproj", "{7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Immersion", "src\Immersion\Immersion.csproj", "{4B9C20F6-0793-4E85-863A-2E14230A028F}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7A80D49C-6768-4803-9866-691C7AD80817}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7A80D49C-6768-4803-9866-691C7AD80817}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7A80D49C-6768-4803-9866-691C7AD80817}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7A80D49C-6768-4803-9866-691C7AD80817}.Release|Any CPU.Build.0 = Release|Any CPU
+ {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {67B9B2D4-FCB7-4642-B584-A0186CAB2969}.Release|Any CPU.Build.0 = Release|Any CPU
+ {EB4F82C0-1BDF-4404-84FB-F0A4E1E4DA67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {EB4F82C0-1BDF-4404-84FB-F0A4E1E4DA67}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {EB4F82C0-1BDF-4404-84FB-F0A4E1E4DA67}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {EB4F82C0-1BDF-4404-84FB-F0A4E1E4DA67}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4B9C20F6-0793-4E85-863A-2E14230A028F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4B9C20F6-0793-4E85-863A-2E14230A028F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4B9C20F6-0793-4E85-863A-2E14230A028F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4B9C20F6-0793-4E85-863A-2E14230A028F}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {7A80D49C-6768-4803-9866-691C7AD80817} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
+ {67B9B2D4-FCB7-4642-B584-A0186CAB2969} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
+ {EB4F82C0-1BDF-4404-84FB-F0A4E1E4DA67} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
+ {7744A8A5-7D9A-474C-BC24-1CF0A8CB7EC0} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
+ {4B9C20F6-0793-4E85-863A-2E14230A028F} = {599B7E67-7F73-4301-A9C6-E8DF286A2625}
+ EndGlobalSection
+EndGlobal
diff --git a/src/Immersion/Immersion.csproj b/src/Immersion/Immersion.csproj
index f96793f..732fd8b 100644
--- a/src/Immersion/Immersion.csproj
+++ b/src/Immersion/Immersion.csproj
@@ -15,6 +15,7 @@
+
diff --git a/src/Immersion/ObserverTest.cs b/src/Immersion/ObserverTest.cs
index b2fceb0..48d1582 100644
--- a/src/Immersion/ObserverTest.cs
+++ b/src/Immersion/ObserverTest.cs
@@ -11,7 +11,7 @@ namespace Immersion;
public class ObserverTest
{
[Observer]
- [Expression("[in] Chunk, [none] (Mesh, *)")]
+ [Expression("[in] Chunk, [none] (MeshHandle, *)")]
public static void DoObserver(in Chunk chunk)
=> Console.WriteLine($"Chunk at {chunk.Position} now has a Mesh!");
}
diff --git a/src/Immersion/Program.cs b/src/Immersion/Program.cs
index d522861..3a234ea 100644
--- a/src/Immersion/Program.cs
+++ b/src/Immersion/Program.cs
@@ -1,12 +1,12 @@
using System;
using System.Diagnostics;
using System.Globalization;
+using System.Numerics;
using System.Threading;
+using gaemstone;
using gaemstone.Bloxel;
using gaemstone.ECS;
-using gaemstone.Flecs;
using gaemstone.Utility;
-using Silk.NET.Maths;
using Silk.NET.Windowing;
using static gaemstone.Bloxel.Components.CoreComponents;
using static gaemstone.Client.Components.CameraComponents;
@@ -20,9 +20,8 @@ var culture = CultureInfo.InvariantCulture;
Thread.CurrentThread.CurrentCulture = culture;
CultureInfo.DefaultThreadCurrentCulture = culture;
-FlecsAbortException.SetupHook();
var universe = new Universe();
-var game = universe.LookupOrThrow();
+var game = universe.LookupByTypeOrThrow();
universe.Modules.Register();
universe.Modules.Register();
@@ -43,6 +42,7 @@ universe.Modules.Register();
universe.Modules.Register();
universe.Modules.Register();
universe.Modules.Register();
+universe.Modules.Register();
universe.Modules.Register();
universe.Modules.Register();
@@ -51,6 +51,7 @@ universe.Modules.Register();
universe.Modules.Register();
universe.Modules.Register();
universe.Modules.Register();
+universe.Modules.Register();
universe.Modules.Register();
universe.Modules.Register();
@@ -60,7 +61,7 @@ game.Set(new GameWindow(window));
universe.New("MainCamera")
.Set(Camera.Default3D)
- .Set((GlobalTransform) Matrix4X4.CreateTranslation(0.0F, 2.0F, 0.0F))
+ .Set((GlobalTransform)Matrix4x4.CreateTranslation(0.0F, 2.0F, 0.0F))
.Set(new CameraController { MouseSensitivity = 12.0F })
.Build();
@@ -71,8 +72,8 @@ var entities = universe.New("Entities").Build();
var rnd = new Random();
for (var x = -12; x <= 12; x++)
for (var z = -12; z <= 12; z++) {
- var position = Matrix4X4.CreateTranslation(x * 2, 0.0F, z * 2);
- var rotation = Matrix4X4.CreateRotationY(rnd.NextFloat(MathF.PI * 2));
+ var position = Matrix4x4.CreateTranslation(x * 2, 0.0F, z * 2);
+ var rotation = Matrix4x4.CreateRotationY(rnd.NextFloat(MathF.PI * 2));
var (type, mesh) = rnd.Pick(("Heart", heartMesh), ("Sword", swordMesh));
entities.NewChild()
.Set((GlobalTransform)(rotation * position))
@@ -98,7 +99,7 @@ for (var cz = -sizeH; cz < sizeH; cz++) {
var pos = new ChunkPos(cx, cy - 2, cz);
var storage = new ChunkStoreBlocks();
chunks.NewChild()
- .Set((GlobalTransform)Matrix4X4.CreateTranslation(pos.GetOrigin()))
+ .Set((GlobalTransform)Matrix4x4.CreateTranslation(pos.GetOrigin()))
.Set(new Chunk(pos))
.Set(storage)
.Add(texture)
diff --git a/src/flecs-cs b/src/flecs-cs
deleted file mode 160000
index a204798..0000000
--- a/src/flecs-cs
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit a2047983917aa462a8c2f34d5315aea48502f4d8
diff --git a/src/gaemstone.Bloxel/BlockFacing.cs b/src/gaemstone.Bloxel/BlockFacing.cs
index 3982b1b..8957106 100644
--- a/src/gaemstone.Bloxel/BlockFacing.cs
+++ b/src/gaemstone.Bloxel/BlockFacing.cs
@@ -1,6 +1,6 @@
using System;
using System.Collections.Immutable;
-using Silk.NET.Maths;
+using System.Numerics;
namespace gaemstone.Bloxel;
@@ -47,14 +47,14 @@ public static class BlockFacingExtensions
public static BlockFacing GetOpposite(this BlockFacing self)
=> (BlockFacing)((int)self ^ 0b1);
- public static Vector3D ToVector3(this BlockFacing self)
+ public static Vector3 ToVector3(this BlockFacing self)
=> self switch {
- BlockFacing.East => Vector3D.UnitX,
- BlockFacing.West => -Vector3D.UnitX,
- BlockFacing.Up => Vector3D.UnitY,
- BlockFacing.Down => -Vector3D.UnitY,
- BlockFacing.South => Vector3D.UnitZ,
- BlockFacing.North => -Vector3D.UnitZ,
+ BlockFacing.East => Vector3.UnitX,
+ BlockFacing.West => -Vector3.UnitX,
+ BlockFacing.Up => Vector3.UnitY,
+ BlockFacing.Down => -Vector3.UnitY,
+ BlockFacing.South => Vector3.UnitZ,
+ BlockFacing.North => -Vector3.UnitZ,
_ => throw new ArgumentException(
$"'{self}' is not a valid BlockFacing", nameof(self))
};
diff --git a/src/gaemstone.Bloxel/BlockPos.cs b/src/gaemstone.Bloxel/BlockPos.cs
index cfb093e..ef42540 100644
--- a/src/gaemstone.Bloxel/BlockPos.cs
+++ b/src/gaemstone.Bloxel/BlockPos.cs
@@ -1,5 +1,5 @@
using System;
-using Silk.NET.Maths;
+using System.Numerics;
namespace gaemstone.Bloxel;
@@ -15,8 +15,8 @@ public readonly struct BlockPos
public BlockPos(int x, int y, int z) => (X, Y, Z) = (x, y, z);
public void Deconstruct(out int x, out int y, out int z) => (x, y, z) = (X, Y, Z);
- public Vector3D GetOrigin() => new(X, Y, Z);
- public Vector3D GetCenter() => new(X + 0.5f, Y + 0.5f, Z + 0.5f);
+ public Vector3 GetOrigin() => new(X, Y, Z);
+ public Vector3 GetCenter() => new(X + 0.5f, Y + 0.5f, Z + 0.5f);
public BlockPos Add(int x, int y, int z) => new(X + x, Y + y, Z + z);
@@ -70,6 +70,6 @@ public readonly struct BlockPos
public static class BlockPosExtensions
{
- public static BlockPos ToBlockPos(this Vector3D self)
+ public static BlockPos ToBlockPos(this Vector3 self)
=> new((int)MathF.Floor(self.X), (int)MathF.Floor(self.Y), (int)MathF.Floor(self.Z));
}
diff --git a/src/gaemstone.Bloxel/ChunkPos.cs b/src/gaemstone.Bloxel/ChunkPos.cs
index 1234afe..5e3e6b5 100644
--- a/src/gaemstone.Bloxel/ChunkPos.cs
+++ b/src/gaemstone.Bloxel/ChunkPos.cs
@@ -1,5 +1,5 @@
using System;
-using Silk.NET.Maths;
+using System.Numerics;
using static gaemstone.Bloxel.Constants;
namespace gaemstone.Bloxel;
@@ -16,9 +16,9 @@ public readonly struct ChunkPos
public ChunkPos(int x, int y, int z) => (X, Y, Z) = (x, y, z);
public void Deconstruct(out int x, out int y, out int z) => (x, y, z) = (X, Y, Z);
- public Vector3D GetOrigin() => new(
+ public Vector3 GetOrigin() => new(
X << ChunkBitShift, Y << ChunkBitShift, Z << ChunkBitShift);
- public Vector3D GetCenter() => new(
+ public Vector3 GetCenter() => new(
(X << ChunkBitShift) + ChunkLength / 2,
(Y << ChunkBitShift) + ChunkLength / 2,
(Z << ChunkBitShift) + ChunkLength / 2);
@@ -66,7 +66,7 @@ public readonly struct ChunkPos
public static class ChunkPosExtensions
{
- public static ChunkPos ToChunkPos(this Vector3D pos) => new(
+ public static ChunkPos ToChunkPos(this Vector3 pos) => new(
(int)MathF.Floor(pos.X) >> ChunkBitShift,
(int)MathF.Floor(pos.Y) >> ChunkBitShift,
(int)MathF.Floor(pos.Z) >> ChunkBitShift);
diff --git a/src/gaemstone.Bloxel/Client/Systems/ChunkMeshGenerator.cs b/src/gaemstone.Bloxel/Client/Systems/ChunkMeshGenerator.cs
index 45350a3..be81e2d 100644
--- a/src/gaemstone.Bloxel/Client/Systems/ChunkMeshGenerator.cs
+++ b/src/gaemstone.Bloxel/Client/Systems/ChunkMeshGenerator.cs
@@ -1,7 +1,7 @@
using System;
+using System.Numerics;
using gaemstone.Client.Systems;
using gaemstone.ECS;
-using Silk.NET.Maths;
using static gaemstone.Bloxel.Components.CoreComponents;
using static gaemstone.Client.Components.RenderingComponents;
using static gaemstone.Client.Components.ResourceComponents;
@@ -14,13 +14,13 @@ public class ChunkMeshGenerator
{
private const int StartingCapacity = 1024;
- private static readonly Vector3D[][] OffsetPerFacing = {
- new Vector3D[]{ new(1,1,1), new(1,0,1), new(1,0,0), new(1,1,0) }, // East (+X)
- new Vector3D[]{ new(0,1,0), new(0,0,0), new(0,0,1), new(0,1,1) }, // West (-X)
- new Vector3D[]{ new(1,1,0), new(0,1,0), new(0,1,1), new(1,1,1) }, // Up (+Y)
- new Vector3D[]{ new(1,0,1), new(0,0,1), new(0,0,0), new(1,0,0) }, // Down (-Y)
- new Vector3D[]{ new(0,1,1), new(0,0,1), new(1,0,1), new(1,1,1) }, // South (+Z)
- new Vector3D[]{ new(1,1,0), new(1,0,0), new(0,0,0), new(0,1,0) } // North (-Z)
+ private static readonly Vector3[][] OffsetPerFacing = {
+ new Vector3[]{ new(1,1,1), new(1,0,1), new(1,0,0), new(1,1,0) }, // East (+X)
+ new Vector3[]{ new(0,1,0), new(0,0,0), new(0,0,1), new(0,1,1) }, // West (-X)
+ new Vector3[]{ new(1,1,0), new(0,1,0), new(0,1,1), new(1,1,1) }, // Up (+Y)
+ new Vector3[]{ new(1,0,1), new(0,0,1), new(0,0,0), new(1,0,0) }, // Down (-Y)
+ new Vector3[]{ new(0,1,1), new(0,0,1), new(1,0,1), new(1,1,1) }, // South (+Z)
+ new Vector3[]{ new(1,1,0), new(1,0,0), new(0,0,0), new(0,1,0) } // North (-Z)
};
private static readonly int[] TriangleIndices
@@ -28,9 +28,9 @@ public class ChunkMeshGenerator
private ushort[] _indices = new ushort[StartingCapacity];
- private Vector3D[] _vertices = new Vector3D[StartingCapacity];
- private Vector3D[] _normals = new Vector3D[StartingCapacity];
- private Vector2D[] _uvs = new Vector2D[StartingCapacity];
+ private Vector3[] _vertices = new Vector3[StartingCapacity];
+ private Vector3[] _normals = new Vector3[StartingCapacity];
+ private Vector2[] _uvs = new Vector2[StartingCapacity];
[System]
[Expression("[in] Chunk, ChunkStoreBlocks, HasBasicWorldGeneration, !(Mesh, *)")]
@@ -48,8 +48,8 @@ public class ChunkMeshGenerator
// TODO: We'll need a way to get neighbors again.
// var storages = new ChunkStoreBlocks[3, 3, 3];
// foreach (var (x, y, z) in Neighbors.ALL.Prepend(Neighbor.None))
- // if (_chunkStore.TryGetEntityID(chunkPos.Add(x, y, z), out var neighborID))
- // if (_storageStore.TryGet(neighborID, out var storage))
+ // if (_chunkStore.TryGetEntityId(chunkPos.Add(x, y, z), out var neighborId))
+ // if (_storageStore.TryGet(neighborId, out var storage))
// storages[x+1, y+1, z+1] = storage;
// var centerStorage = storages[1, 1, 1];
@@ -61,11 +61,11 @@ public class ChunkMeshGenerator
for (var x = 0; x < 16; x++)
for (var y = 0; y < 16; y++)
for (var z = 0; z < 16; z++) {
- var block = universe.Lookup(centerBlocks[x, y, z]);
+ var block = universe.LookupAlive(centerBlocks[x, y, z]);
if (block == null) continue;
- var blockVertex = new Vector3D(x, y, z);
- var textureCell = block.Get();
+ var blockVertex = new Vector3(x, y, z);
+ var textureCell = block.GetOrThrow();
foreach (var facing in BlockFacings.All) {
if (!IsNeighborEmpty(storages, x, y, z, facing)) continue;
@@ -99,7 +99,7 @@ public class ChunkMeshGenerator
}
// TODO: Should dynamically generating meshes require getting GL this way?
- var GL = universe.LookupOrThrow().Get