mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* add basis for debug drawing raycasts * rays * this was too much work * i assumed you could do string object stuff. you cant. * fixed a crash * Greatly improved DebugDrawingManager code with a struct and list as opposed to dictionary * change default ray debug color from green to magenta * reviewed changes * reviewed changes and adds network message to physicsmanager so it works without much user config
40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using System;
|
|
using Lidgren.Network;
|
|
using Robust.Shared.Interfaces.Network;
|
|
using Robust.Shared.Maths;
|
|
|
|
namespace Robust.Shared.Network.Messages
|
|
{
|
|
public class MsgRay : NetMessage
|
|
{
|
|
#region REQUIRED
|
|
|
|
public const MsgGroups GROUP = MsgGroups.Command;
|
|
public const string NAME = nameof(MsgRay);
|
|
public uint RequestId { get; set; }
|
|
public uint SessionId { get; set; }
|
|
|
|
public Ray RayToSend { get; set; }
|
|
|
|
public MsgRay(INetChannel channel) : base(NAME, GROUP)
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
public override void ReadFromBuffer(NetIncomingMessage buffer)
|
|
{
|
|
var origin = buffer.ReadVector2();
|
|
var dir = buffer.ReadVector2();
|
|
var mask = buffer.ReadInt32();
|
|
RayToSend = new Ray(origin, dir, mask);
|
|
}
|
|
|
|
public override void WriteToBuffer(NetOutgoingMessage buffer)
|
|
{
|
|
buffer.Write(RayToSend.Position);
|
|
buffer.Write(RayToSend.Direction);
|
|
buffer.Write(RayToSend.CollisionMask);
|
|
}
|
|
}
|
|
}
|