23 lines
536 B
C#
23 lines
536 B
C#
using LiteNetLib.Utils;
|
|
|
|
using Engine.Core;
|
|
|
|
namespace Engine.Systems.Network;
|
|
|
|
internal static class Ray3DNetPacker
|
|
{
|
|
internal static void Write(NetDataWriter writer, Ray3D data)
|
|
{
|
|
Vector3DNetPacker.Write(writer, data.Origin);
|
|
Vector3DNetPacker.Write(writer, data.Direction);
|
|
}
|
|
|
|
internal static Ray3D Read(NetDataReader reader)
|
|
{
|
|
Vector3D from = Vector3DNetPacker.Read(reader);
|
|
Vector3D direction = Vector3DNetPacker.Read(reader);
|
|
|
|
return new Ray3D(from, direction);
|
|
}
|
|
}
|