refactor: restructure interaction system into clean layers

This commit is contained in:
2026-08-28 22:35:09 +02:00
parent 3127c1b4af
commit 9fdd565637
33 changed files with 474 additions and 288 deletions
@@ -0,0 +1,26 @@
using Godot;
namespace Game.Features.Interactions.Domain;
public readonly record struct DropRayHit(
Vector3 Origin,
Vector3 Direction,
float RayLength,
bool IsBlocked,
Vector3 BlockPoint
);
public static class DropPosition
{
public static Vector3 CalculateFrom(DropRayHit hit)
{
float distance = hit.RayLength;
if (hit.IsBlocked)
{
distance = Mathf.Max(0.25f, hit.Origin.DistanceTo(hit.BlockPoint) - 0.2f);
}
return hit.Origin + hit.Direction * distance;
}
}