Audio occlusion parallelization (#2776)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
20kdc
2022-07-19 10:40:59 +01:00
committed by GitHub
parent 3eb295e3ef
commit 0ded41ebe1
12 changed files with 285 additions and 184 deletions

View File

@@ -0,0 +1,32 @@
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Network.Messages;
using Robust.Shared.Physics;
using Robust.Shared.Debugging;
namespace Robust.Server.Debugging;
[UsedImplicitly]
internal sealed class DebugRayDrawingSystem : SharedDebugRayDrawingSystem
{
protected override void ReceiveLocalRayAtMainThread(DebugRayData data)
{
// This code won't be called on release - eliminate it anyway for good measure.
#if DEBUG
var msg = new MsgRay {RayOrigin = data.Ray.Position};
if (data.Results != null)
{
msg.DidHit = true;
msg.RayHit = data.Results.Value.HitPos;
}
else
{
msg.RayHit = data.Ray.Position + data.Ray.Direction * data.MaxLength;
}
EntityManager.EventBus.RaiseEvent(EventSource.Network, msg);
#endif
}
}