feat: added sphere primitive

This commit is contained in:
2025-10-21 19:06:58 +03:00
parent 896f7876c1
commit 0db2cae1bb
7 changed files with 230 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
using LiteNetLib.Utils;
using Engine.Core;
namespace Engine.Systems.Network;
internal static class Sphere3DNetPacker
{
internal static void Write(NetDataWriter writer, Sphere3D data)
{
Vector3DNetPacker.Write(writer, data.Center);
writer.Put(data.Radius);
}
internal static Sphere3D Read(NetDataReader reader)
{
Vector3D center = Vector3DNetPacker.Read(reader);
float radius = reader.GetFloat();
return new Sphere3D(center, radius);
}
}