fec2cd8d24
- serialization - chunks - parralelfor test
29 lines
800 B
C#
29 lines
800 B
C#
using MoonTools.ECS;
|
|
using System.Numerics;
|
|
|
|
namespace Nerfed.Runtime.Scene.Streaming;
|
|
|
|
/// <summary>
|
|
/// Marks an entity as a streaming observer (e.g. the player camera) that causes chunks
|
|
/// to be loaded around it.
|
|
/// </summary>
|
|
public struct ChunkObserverComponent
|
|
{
|
|
public float ViewRadius;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Tags an entity as belonging to a specific chunk, allowing it to be unloaded when the chunk is out of range.
|
|
/// </summary>
|
|
public struct ChunkMemberComponent
|
|
{
|
|
// A 64-bit spatial hash combining the X, Y, and Z coordinates.
|
|
public long ChunkId;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Added to entities that belong to a chunk that has been unloaded.
|
|
/// A dedicated system will process and destroy these slowly over multiple frames.
|
|
/// </summary>
|
|
public struct ChunkUnloadPendingTag { }
|